Solved

ifconfig - does it look beyond its subnet?

Posted on 2004-10-13
3
199 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 100 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 150 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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Check for Linux process in script 7 88
Install XRDP on Ubuntu Server 16.10 x64 3 116
Linux kernel panic ext3-fs error 14 73
umask commands 5 15
Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
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

739 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