Jump to content

Ip Help !


Recommended Posts

cowsmanaut:

tracert -h 2 www.hiddensoft.com

Maybe it depends on the router but I don't believe. All routers I work with don't give their assigned IP back to a tracert.

The 1st you get is the local adress of the router and the 2nd hop you get is normaly a Gateway IP at your ISP.

Did you really test the 2nd IP you get on a tracert with the IP that is assigned to your connect with your ISP? I ask because it's really interesting for me when it works at your place and not at mine.

arctor

Link to comment
Share on other sites

My first address is the inside address of the firewall/router and the second address is that of our ISP, not the external address of the firewall.

David Nuttall
Nuttall Computer Consulting

An Aquarius born during the Age of Aquarius

AutoIt allows me to re-invent the wheel so much faster.

I'm off to write a wizard, a wonderful wizard of odd...

Link to comment
Share on other sites

hmm.. interesting. I guess I should have checked that .. I had simply assumed since on a setting of 4 hops I got the routers local ip 192.168.0.1 and then I got annother IP (I assumed the outside IP of the router) and then got my ISP first address then it's second.. then from there it goes outside to the location etc..

so now I wonder.. what is between me and the outside?

Link to comment
Share on other sites

Different firewall manufacturers may or may not give the external address as a hop. Check the numbers from tracert against the result from whatismyip.com. Watchguard does not do that.

David Nuttall
Nuttall Computer Consulting

An Aquarius born during the Age of Aquarius

AutoIt allows me to re-invent the wheel so much faster.

I'm off to write a wizard, a wonderful wizard of odd...

Link to comment
Share on other sites

It all depends on your hardware, and your local configuration. You can have local gateways that would mess this up as well. You can't always be sure you can even get your outside IP, and if you can, it won't be the same number of hops for all clients on a traceroute.

[font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.

Link to comment
Share on other sites

  • 2 weeks later...

Hi,

i think i have a very useful solution.

My DSL modem uses IP-masquerading and it's very complicated to get the IP address, so i wrote this script.

The script use an url from the ini file and get the IP address.

If a site is unavailable the script use the next url.

Some checks are done.

MyIP.au3

AutoItSetOption("TrayIconHide", 1)
$INI = @ScriptDir & "\myip.ini"

;check for .ini
If FileExists($INI) = 0 Then Error($INI & " not found. EXIT!")

$POS = 0
$IP = 0
$URLS = IniRead($INI, "URL", "URLS", "")

;delete forgotten tempfiles
For $I = 1 To $URLS
   FileDelete(@ScriptDir & "\" & $POS + 1 & ".htm")
Next

While $POS < $URLS

   FileDelete(@ScriptDir & "\" & $POS - 1 & ".htm")
   $POS = $POS + 1
   $IPTMP = @ScriptDir & "\" & $POS & ".htm"
   $URL = IniRead($INI, "URL", $POS, "")
   $IP = URLDownloadToFile("http://" & $URL & "/ip.php", $IPTMP)
   $FS = FileGetSize($IPTMP)   
   If FileExists ($IPTMP) = 0 Then ContinueLoop
     If $FS > 16 Then
       ContinueLoop
     Else
        If $FS < 8 then ContinueLoop
     EndIf
 If $FS <= 16 then ExitLoop
Wend

If $POS >= $URLS then Error("NO URL AVAILABLE." & @CR & "ARE YOU OFFLINE!? EXIT!")

$FILE = FileOpen($IPTMP, 0)
If $FILE = -1 Then Error("Unable to open " & $URL)
$LINE = FileReadLine($FILE)

;check the result
$LINE1 = StringReplace($LINE, ".", "")
If StringIsDigit($LINE1) Then

;do something with the output
  ;ClipPut($LINE)
  ;WinSetTitle ( "FRITZ!web DSL", "", $line )
   MsgBox(0, "IP Address:", $LINE)
Else
;show the error in default browser instead of IE
   RunWait(@ComSpec & " /c start " & $IPTMP, "", @SW_HIDE)
   Sleep(1000)
EndIf
FileClose($FILE)
FileDelete($IPTMP)

Exit

Func Error($TXT)
   MsgBox(48, "Error", $TXT)
   Exit
EndFunc  ;==>Error

MyIP.ini

To speed up the function, sort the urls corresponding to your language/home.

If someone have improvements, let's go... but i think it's perfect :ph34r:

EDIT: shrinked :(

Edited by Westi
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...