[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

ifconfig - does it look beyond its subnet?

Posted on 2004-10-13
3
Medium Priority
?
207 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 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

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

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

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
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…
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…
Suggested Courses
Course of the Month19 days, 21 hours left to enroll

872 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