Main Topics
Browse All TopicsHowdy, I have a router on my home network that I am playing with. I've written some code where I can get all the info on it except the external ip address. The internal ip is 197.168.0.1 and the inner network is consecutive. I can get all ip addresses of each connected device, and so now the last thing I want to be able to get is the external ip of my router. Anyone know how? I am using VB 6.0
Thank you experts!
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
create a form
add a label, command box, and the Microsoft Internet Transfer Control 6.0
Then add this code
Option Explicit
Private Sub Command1_Click()
Dim Data As String
Data = Inet1.OpenURL("http://www.
If Not Inet1.StillExecuting Then
Label1.Caption = Left(Data, InStr(Data, " ") - 1)
End If
End Sub
yeah, i think he means tracert:
http://vbnet.mvps.org/inde
your external ip will be the second hop (usually) depending on your network setup
an extremely kludgy way to do it would be to open www.whatismyip.com and parse the results
Here is what I did. Using g0raths idea, I created a file myIP.shtml and added this one line of code
<!--#echo var="REMOTE_ADDR" -->
This showed my external ip address. Made sure it was the only line in the file and as such I was able to place the ip address into a text field and save it as a file. Problem solved.
isn't that correct?
a "hop" is the packet that goes from machine 1 to machine 2
So by definition shouldn't hop 1 be
local machine -> NAT reverse proxy --- for most users? as in those that use things like the linksys home firewall/NAT thingy...
my other setup using a linux box as a routher may be different since it reall isn't a "hop" between" the NICs
local machine -> local ip of linux dmz side -> external ip through the other NIC -> the wide open internet
or for networks I've been on are more like this....
local machine -> subnet router -> DMZ router -> Internet GateWay -> wherever....
either way it's not consistant or something not to be relied upon, so it's usually easier to connect to a "trusted" website that can give you back your IP using the environment var REMOTE_ADDR
Business Accounts
Answer for Membership
by: bobbit31Posted on 2004-03-25 at 11:25:24ID: 10680338
From: http://www.experts-exchang e.com/Prog ramming/ Pr ogramming_ Languages/ Visual_Bas ic/Q_11813 439.html
Comment from aRTie11
Date: 11/10/2000 07:47PM CST
Comment
an easy way to make your internet ip appear and not your lan Ip
is to use winsock like so
winsock1.connect "www.microsoft.com",80
InternetIP = winsock1.localip
calling it to access the internet will show the real ip address and not just the lan address
Hope it helps
aRTie11