No announcement yet.

Outside IP through a firwall

  • Filter
  • Time
  • Show
Clear All
new posts

  • Outside IP through a firwall

    Hey Guys,

    Is there anyway to use winsock to get the outside IP of your internet connection through a firewall?

    The only way I know how at the moment, is to use and have the browser return it, but I can't automate that into a form.

    I'm building a little file transfer program, and it would be nice if I can include the outside IP of my internet connection in the form for my VB project. winsock.localip only returns my internal IP (ie but does work if you are not through a firewall.

    The other option I can think of is to have a script running on my web server, that could be queried from the VB app over the internet to retrieve this IP.

    Has anyone had a play with this idea?

    I can't think of anyway to actually make this work. Any help would be appreciated.


    BjBlaster! Car MP3 & Carputer!

    "The solution to one problem is only the beginning of another"

  • #2
    You will probably need the third party to grab the natted address from a sent packet. Just getting the IP is probably not enough for an external source to initiate a connection in (if that is what you are wanting to do). The firewall will most likely remap the port number too, and unless the firewall is a promiscuous firewall, you won't be able to come back in from a different IP than the third part looking at your IP. It is far easier to punch out through a firewall to establish a connection to the outside world.

    I did a lot of the networking stuff on FireWarrior, and NATs were the worst part, especially where there were two involved. NAT negotiation is possible but involves a third party to "guess" ports on port remapping for you and therefore isn't straight forward.

    Old Systems retired due to new car
    New system at design/prototype stage on BeagleBoard.


    • #3
      I Think I might have it sorted - except for one thing.

      I have put up a web page on my site that returns the remote addr header to the page - see it here just like does. I then use the Inet control in VB to do a HTTP read of the site and it returns my IP ! The only problem is that it doesn't return the "client IP" when I do this on my mates dial up through ICS. I think it's his ISP, only because if we do a it is not returning the correct IP, just the same one that never changes.

      Other than this one, it works fine on DSL through firewalls, other dialups and I think it will work, it's just this particular mates dial up that has got me stuffed.

      Thanks for the reply anyway

      BjBlaster! Car MP3 & Carputer!

      "The solution to one problem is only the beginning of another"


      • #4
        Could it be a Proxy??
        Car: About to change

        Player: VIA Eden, 256Mb RAM, Bootable from 64MB Compactflash, 40GB MP3 HD, IRMan, Wireless Keyboard, 5.6" In-dash TFT, 12v DC-DC, running Windows XP Embedded with Wireless LAN, Mobile Internet, GPS Sat Navigation.

        == Running MediaEngine for the front end whilst I build a front end in VB.NET, but may stick with ME 2.0 ==


        • #5
          you can call traceroure (tracert for wintel) to the some well know external site, intercept output and check IP address of the second hop.
 next generation police speedtrap locator. Free database for your GPS system (includes US/Canada).


          • #6
            Bj, go to and setup an account (it's free), then download one of their client programs that runs as a service on your computer.

            This client software will take the same address that you get from and upddates's servers with your current IP address, you can have the service update the IP address every 24 hours, or however long your ISP has the DHCP IP addresses leased for. Then all you would have to do is forward the port on your firewall to the computer you want to recieve it.