LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 02-06-2003, 11:47 AM   #1
peter72
Member
 
Registered: Oct 2002
Location: Charlottesville, VA
Distribution: Ubuntu (home), SLES (work)
Posts: 196
Blog Entries: 1

Rep: Reputation: 30
DSL/Cable modem router IP address


Is there a quick way to determine my routers IP outside address?

Because of the network address translation of the router I cannot see it via traceroute. However if something was coming in from the outside.

Why you may ask? I want to make a cron to check and see if my ISP has changed my IP and if it has email it to myself.

My current thought of a solutions is a PERL script with the HTTP modules talking to my router/switch, logging in and parsing out the DHCP client info from my cablemodem.

There has to be an easier way! This is not that hard, but a little more system intensive then I would like.

My network :

cablemodem - D-Link 905P (4 port switch out) - 4 PC's
 
Old 02-06-2003, 04:39 PM   #2
peter_robb
Senior Member
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 47
There are several websites you can visit to pick up your external ip address, and you may be behind another NATing router,

eg www.anonymizer.com/test_ip.shtml
or http://www.whatismyipaddress.com/
 
Old 02-06-2003, 07:29 PM   #3
peter72
Member
 
Registered: Oct 2002
Location: Charlottesville, VA
Distribution: Ubuntu (home), SLES (work)
Posts: 196
Blog Entries: 1

Original Poster
Rep: Reputation: 30
Thanks, that is sort of what I did.

I wrote a perl script to grab a web page and parse out the IP address. I plan on attaching it to a cron and any changes in my WAN ip address, it will generate an e-mail.

The perl script is at
http://w3.mivlmd.cablespeed.com/~plewis/wan.html

Cheers
Pete
 
Old 02-07-2003, 02:22 AM   #4
Noerr
Member
 
Registered: May 2002
Location: Dalec, HU
Distribution: Redhat 7.3
Posts: 696

Rep: Reputation: 30
just include this line in your script
ipppp0=`ifconfig ppp0 | grep "inet addr:" | awk '{print $2}' | awk -F'\:' '{print $2}'`

regards
 
Old 02-10-2003, 03:45 PM   #5
digantk
LQ Newbie
 
Registered: Oct 2002
Posts: 12

Rep: Reputation: 0
I assume you wanted that IP so you could remote login to your computer.

Try dyndns.org. Its free and all you have to do is run a daemon that will routinely check your router to see what the IP is and update their db with that so you can have a "static" domain name like yourname.dyndns.org.
 
Old 02-10-2003, 09:26 PM   #6
jqpdev
Member
 
Registered: Feb 2003
Location: New York, USA
Distribution: Trying out several distros.
Posts: 37

Rep: Reputation: 15
Question a slightly off topic question

Peter72,

I noticed that you're using a cable modem and some sort of router. Is it safe to assume the following:

- Cablemodem connect to Wan Interface of router box.
- Linux box connect to switch/internal interface of router box

looks like this:

ISP <--> cablemodem <--> router <--> linux box(s)

if the above is totally or partially correct. How did you set up everything? My situation is described above, but I can't get my linux box to talk to the router or any external internet hosts for that matter.

sorry to hit everyone with a potential newb question... but I would greatly appreciate some advice. I will reply with full details anyone has time to answer the questions...
Thanks in advance
 
Old 02-11-2003, 07:54 AM   #7
peter72
Member
 
Registered: Oct 2002
Location: Charlottesville, VA
Distribution: Ubuntu (home), SLES (work)
Posts: 196
Blog Entries: 1

Original Poster
Rep: Reputation: 30
This is exactly what I have set up. You just have to set up your DHCP(bootps). It is quite easy (if you know what you are looking for).

First make sure your Router is set up as a DHCP server (most are by default). Check under the DHCP tab on the top. Make sure the item "DHCP Server" is checked to enable.

Next, on the mandrake box, go through drakconf, and under the network wizard it will autodetect your network card. The last box for lan should be checked. Then hit next, and you will see where you enter your IP address. Don't put one in, there is a option box at the bottom that says something like DHCP/bootps. Check it and hit next. There are some other options, but nothing else is needed.

This should do it. I've set this up on the same router/switch several times.

Another cool this is to enable ip forwarding of ssh. This will allow you secure remote access to your network. Under advance, IP Forwarding, just enter port 22 and the ip address of your linux box you want to log into. WARNING, make sure you are up to date on all security updates for openSSH. I set up this to mantain a server at a small business. Make my life a lot easier. You can also download the client putty to log into the machine from a windows box, and winSCP2 to have access to files on the remote box.

To me, this is what make linux^H^H^H^Hunix so cool. The network is really just an extension of the computer.

Cheers, hope it helped
 
Old 02-11-2003, 08:03 AM   #8
Nu-Bee
Member
 
Registered: Dec 2002
Location: USA
Distribution: Mandrake 9.2
Posts: 269

Rep: Reputation: 30
Quote:
Originally posted by peter_robb
There are several websites you can visit to pick up your external ip address, and you may be behind another NATing router,

eg www.anonymizer.com/test_ip.shtml
or http://www.whatismyipaddress.com/
Anonymizer changed their site, the address now is:

http://www.anonymizer.com/snoop/test_ip.shtml
 
Old 02-22-2003, 08:49 PM   #9
jqpdev
Member
 
Registered: Feb 2003
Location: New York, USA
Distribution: Trying out several distros.
Posts: 37

Rep: Reputation: 15
Talking much success everyone

Thanks to everyone. I got my linux box up and running. I had a 3Com 3c905B-TX PCI card installed in my system. I re-seated the NIC into the same slot, screwed it in place and booted the system and it worked. Later I removed that card and re-enabled my embedded Broadcom 4401 10/100 NIC. I configured it as eth0 and all is working well with the NIC.

I later discovered how to get sound working on my system... just plug my speakers into the mic port of my sound card and then there was sound.

In case anynoe is wondering about my setup I have a Asus P4PE motherboard with 10/100 LAN, iEEE1394, USB 2.0, IDE RAID, Serial ATA, AC'97. ($140 US)

So I have sound working and LAN working USB, 1394 working. Very nice indeed. Again thanks everyone.

One last note for any Newbs out there hunting for information and the How-To's aren't working for you:
- don't give up yet.
- look though this site and go to the following sites
- www.mandrake.com
- www.suse.com
- www.redhat.com
- the linux documentation project
- www.justlinux.com
- www.tweakhound.com
- www.freshmeat.com

there are about another 40+ sites I scoured looking for info. In short you will learn alot assuming you dedicate a fews days to getting started.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Fast DSL/Cable Router/Switch kuphryn General 8 05-25-2006 01:59 AM
cable vs dsl modem???? wormraper Linux - Networking 2 06-19-2005 05:00 PM
Cable AND Dsl through router apberzerk Linux - Networking 4 02-02-2005 02:04 PM
DSL + Cable through one router apberzerk Linux - Networking 0 12-18-2004 04:01 AM
Linksys Cable/DSL router vs. wu-ftpd sonnik Linux - Networking 0 05-21-2001 09:50 PM


All times are GMT -5. The time now is 11:12 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration