This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

How do i resolve my ip

Old posts that have not been replied to for several years.
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

Some while ago i got this form you guys verry greatfull for it but everytime i get a pc with a lan ip like 192.168 witch is c class ip aswell , ...

it doesn't show the internet ip but the lan ip ...

Code: Select all

set s [socket -server "" -myaddr [info hostname] 0]; 
set ip [lindex [fconfigure $s -sockname] 0] 
close $s
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

Code: Select all

set sock [socket -async 1.2.3.4 5]
set ip [lindex [fconfigure $sock -sockname] 0]
close $sock
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

result = ip 0.0.0.0
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

I found this and it seems to work so if anyone else would like it ..
The var is $MyIP incase you shouldn't know ;)

Code: Select all

set MyIP ""
foreach a {a b c d e f g h i j k} {
    catch {
	set external [socket $a.root-servers.net 53]
	set MyIP [lindex [fconfigure $external -sockname] 0]
	close $external				
  } 
if { ![string equal $MyIP ""] } { break }
}
Locked