?
Solved

ifconfig - does it look beyond its subnet?

Posted on 2004-10-13
3
Medium Priority
?
202 Views
Last Modified: 2013-12-16
When I plug my linux box directly into the cable modem, among other info, "ifconfig" returns the address assigned to me via DHCP by the ISP.

When Im plugged into a router and then to the cable modem, "ifconfig" returns the local subnet ip (192.168.0.5 in my case).

Is there a command other than ifconfig that can return my cable modem's ip address from a linux box thats behind a router?  I want to script my box to monitor the ip address then do something when it changes... it seems that unless Im plugged directly into the cable modem, there is no way to find out that info.. even traceroute to an outside address seems to start at the gateway.
0
Comment
Question by:meuedyn
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 14

Assisted Solution

by:chris_calabrese
chris_calabrese earned 400 total points
ID: 12302645
Your Linux box sees only its local subnet and knows that the rest of the word is on the other side of the router, hence it has no need to know what the address of the router's outside interface is.

There may be a way to ask the router what IP address it has on its outside interface, depending on the type of router. Routers meant for home use usually let you get this through a web-based admin interface. In theory, you could write a script that logs into the router via the web interface, gets the IP addressing info, and parses the HTML for the answer.
0
 
LVL 6

Expert Comment

by:blkline
ID: 12302917
I'd recommend that you look at www.dyndns.org   

They have a tool that will provide DNS services for you, changing the IP address as appropriate.  You can get this as a freebie (depending on what you want) so the price is right!
0
 
LVL 10

Accepted Solution

by:
Luxana earned 600 total points
ID: 12304120
>Is there a command other than ifconfig that can return my cable modem's ip address from a linux box thats behind a router?

easiest way is use browser on linux box and have look on webpag like this:

http://www.ipchicken.com/

0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

rdate is a Linux command and the network time protocol for immediate date and time setup from another machine. The clocks are synchronized by entering rdate with the -s switch (command without switch just checks the time but does not set anything). …
Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month15 days, 16 hours left to enroll

741 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question