Solved

ifconfig - does it look beyond its subnet?

Posted on 2004-10-13
3
198 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
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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
number in printf 13 42
EXCHANGE. LINUX, SYMANTEC MESSAGING GATEWAY 2 49
linux - yum package installation issue 2 107
Fuzzy search functionality DB2 UDB 3 31
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…
SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

763 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