Solved

ifconfig - does it look beyond its subnet?

Posted on 2004-10-13
3
196 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
3 Comments
 
LVL 14

Assisted Solution

by:chris_calabrese
chris_calabrese earned 100 total points
Comment Utility
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
Comment Utility
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 150 total points
Comment Utility
>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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Currently, there is not an RPM package available under the RHEL/Fedora/CentOS distributions that gives you a quick and easy way to allow PHP to interface with Oracle. As a result, I have included a set of instructions on how to do this with minimal …
This is the error message I got (CODE) Error caused by incompatible libmp3lame 3.98-2 with ffmpeg I've googled this error message and found out sometimes it attaches this note "can be treated with downgrade libmp3lame to version 3.97 or 3.98" …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

728 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now