Re: Experience with cable modem and dynamic IP addresses

Replies:

  • None.

Parents:


I too am a DHCP cable modem user, in fact I have 2 machines connected
to the internet that way.  Time Warner/Road Runner of Maine [1] allows
up to 5 machines to be connected to the internet for residential
service by simply using a hub (or 10/100 switch) connected to the
cable modem.

I'm about to do a network reorg and may end up with just 1 publically
connected host and use IP MASQ [2] more than I do (IP masquerading is
very cool if you're running linux and have public and private networks
at home or work).  One machine I host my domain guilds.net on and the
other so I can have a second public IP address and run another test
web server and such.  Only problem with this new plan is that I like
having multiple IP's.  Hugo set up a box for us at MIT that has
mulitple IPs on a single ethernet card.  Turns out to be very simple
simply copy and edit the /etc/sysconfig/network-script/ifcfg-eth0 for
instance:

bash$ cat ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
BROADCAST=18.29.255.255
IPADDR=18.29.5.20
NETMASK=255.255.0.0
NETWORK=18.29.0.0
ONBOOT=yes
bash$ cat ifcfg-eth0:0
DEVICE=eth0:0
BOOTPROTO=static
BROADCAST=18.29.255.255
IPADDR=18.29.5.151
NETMASK=255.255.0.0
NETWORK=18.29.0.0
ONBOOT=no

and so on, you can then ifup eth0*

Sadly trying the same on Road Runner didn't work (mac addresses
perhaps? even if using a dumb hub instead of a switch) and I might
just pop a 3rd nic card in this box and have 2 for public network and
1 private.  Why bother you may ask?  Well I can run various public
services off of different internal machines in addition to the one
publicly networked by IP and port number to my liking (can still do
with 1 IP but then I can't reuse port numbers) I should be able to set
up the IPCHAINS [3] (also for firewalling) to do this, called port
forwarding [4].  

[root@skalazub network-scripts]# ifup eth0:0
Determining IP information for eth0:0...Operation failed.
failed.

[root@skalazub network-scripts]# cat eth0:0
DEVICE=eth0:0
BOOTPROTO=dhcp
ONBOOT=yes

I use dyndns.org [5] for my test box, they have some interesting
domain names they will give you a hostname from including from various
countries.  They also let you specify another hostname for handling
mail.

I use their perl client ddclient but it couldn't tell which interface
was my public and which was my private so I wrote this little script
and have it run in a nightly cron.

#!/bin/sh
# didn't work with multi interfaces otherwise

/root/bin/ddclient -refresh -retry -force -ip `/sbin/ifconfig | egrep
'inet addr' | egrep -v ':(172|127)' | sed -e 's/^[^:]*://' -e 's/
.*$//'` -mx mail.guilds.net

[word-wrapped for readablity]

but I recently came accross a cleaner (less imaginative) way to get IP
per device:

/sbin/ifconfig eth1 | grep 'inet addr' | awk '{print $2}' | sed -e 's/.*://'

For my own domain name I had to go with a more commercial one [6]
although some of the free public ones seem like they can be persuaded
if your domainname is for non-commercial use.  A good list/resource
for dynamic dns is [7].

1. http://www.maine.rr.com
2. http://www.linuxdoc.org/HOWTO/IP-Masquerade-HOWTO.html
3. http://www.linuxdoc.org/HOWTO/IPCHAINS-HOWTO.html
4. http://www.linuxdoc.org/HOWTO/IP-Masquerade-HOWTO-6.html#ss6.8
5. http://www.dyndns.org
6. http://www.dyndns.com
7. http://www.technopagan.org/dynamic/

--
Ted Guild <[email protected]>
http://www.guilds.net

HURL: fogo mailing list archives, maintained by Gerald Oskoboiny