WAN IP address from a computer..

S

Sajid Saeed

Hi,

Is there any possibility of getting the WAN IP address from a computer
connected on the LAN..

Lets say we have x computers, with static LAN IP address, and a router
which is connected on the LAN, and provides the WAN interface as well.

So how can we find the WAN IP address of the router directly using a
shell command from any computer on the LAN
Thanks well in advance

Sajid Saeed
 
H

Herb Martin

Sajid Saeed said:
Hi,

Is there any possibility of getting the WAN IP address from a computer
connected on the LAN..
Lets say we have x computers, with static LAN IP address, and a router
which is connected on the LAN, and provides the WAN interface as well.

So how can we find the WAN IP address of the router directly using a
shell command from any computer on the LAN
Thanks well in advance

Maybe someone else has an IP only scheme but I
don't.

I do it by ensuring that the external WAN interace is
registered with DNS (dynamically both internally
and with an Internet based DNS service).

Then by performing any command that shows the
resolution of that name you can retrieve it, i.e., ping
NAME or nslookup NAME
 
R

Ryan Hanisco

Sajid,

There is no way to do this in the environment you've described. Generally
you're doing your NAT on your router or firewall. Because this is outside
of the server, the server has no way of knowing what you've assigned to it.
Indeed, in a PAT situation it becomes even more impossible (is that
possible? <G>).

Herb is right. If you put the WAN address in the DNS manually, you will at
least have something with which to look it up, though I'd generally keep WAN
addresses in an external DNS in my DMZ and leave the internal DNS handling
LAN naming.

Use a spreadsheet or use internal comments to comment your router/ firewall
configs.

--
Ryan Hanisco
MCSE, MCDBA
Flagship Integration Services

PS: If you're using multihomed machines with a NIC in each network, both LAN
and WAN, you can find it with IPCONFIG, but this should almost never be
done. (I wasn't sure if this was your configuration or not, from your post.)
If you're doing this, quit it. Establish a DMZ and control the ports.
 
L

Lanwench [MVP - Exchange]

Sajid said:
Hi,

Is there any possibility of getting the WAN IP address from a computer
connected on the LAN..

Lets say we have x computers, with static LAN IP address, and a
router which is connected on the LAN, and provides the WAN interface
as well.

So how can we find the WAN IP address of the router directly using a
shell command from any computer on the LAN
Thanks well in advance

Sajid Saeed

http://www.whatismyip.com/ should work.
 
H

Herb Martin

Ryan Hanisco said:
Sajid,

There is no way to do this in the environment you've described. Generally
you're doing your NAT on your router or firewall. Because this is outside
of the server, the server has no way of knowing what you've assigned to it.
Indeed, in a PAT situation it becomes even more impossible (is that
possible? <G>).

Herb is right. If you put the WAN address in the DNS manually, you will at
least have something with which to look it up, though I'd generally keep WAN
addresses in an external DNS in my DMZ and leave the internal DNS handling
LAN naming.

Actually I do this automatically by having the router/NAT
register it's external address.

Even many (of the latest) simple hardware routers will do
this using various Internet based (programmatic) Dynamic
DNS services.
Use a spreadsheet or use internal comments to comment your router/ firewall
configs.
 
S

Shalom B.

You could use the services of http://www.whatismyip.com/ ,if you need to
know the IP address of the WAN interface of the router for a command
line /shell scripting purpose, you could extract the IP address from
the page returned using a scripting language like perl.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top