Experience with cable modem and dynamic IP addresses

Replies:

Parents:

  • None.
A lot of things happened with my connectivity recently, so I thought
that I would sum them up here since:
- I was first pissed and then happily surprised RCN's service.
- it could be useful information to someone:
+ who wants cable modem in the Boston area.
+ who doesn't have a fixed IP and wants a static host name
(cool hack).

This is kind-of long, but the stuff at the bottom can be useful if you
want dynamic DNS with Linux.

About RCN[0]
------------

So it all started when I discovered that my hostname was not on the
authoritative name servers for rcn.com. To cut a very long story short,
I spent 2 weeks *trying* to report the problem and got answers such as:
- Your machine is pingable.
- We do not support Linux.
- It is resolved here (they were not using the authoritative servers).

At some point I was desperate and I smacked one of the head when I had
him on the phone when he wanted to come home and check my computer! The
effect was that he listened carefully to what I was saying, discovered
(oh surprise!) and acknowledged the problem (they haven't fixed it yet),
and ended up telling me that I should upgrade my cable modem and giving
me an appointment.

So I knew that it wasn't really the right fix, but since IP's where tied
to the cable modem serial numbers, I thought that it could give me
another IP address and a hostname which this time would be in the DNS.

The first time, they come the day before my appointment: "Sorry, we
missed you, please reschedule." So they accept to "reschedule" for the
same day, and here they are at home.

About cable modems and RCN's connectivity
-----------------------------------------

They replaced my Hybrid cable modem by a 3Com one[1]. The installation
was successful and quick, and I discovered that I was now connected to
another network.

Now I have to read about how it works to understand that; however the
specifications I found[2] are huge... They probably use virtual LANs
based on the frequency of the link between the cable modem and the
router.

Anyhow, my new LAN has interesting features compared to the one I was
using before.

The connectivity to MIT is much better. The number of hops between my
cable modem and www.mit.edu is 7, and ping statistics give: round-trip
min/avg/max = 12.2/13.5/16.8 ms. That is really cool because the latency
before was around 110ms and I was jealous of Eric's Mediaone connection.

My IP address changed, and I am back in the DNS (woohoo). Well, kind of,
because this time this is RCN's internal DNS servers who don't know
about me. Oh well...

However, IP addresses are not addressed based on the cable modem serial
number anymore, but apparently completely random. And their DHCP server
gives 1-hour leases! This is IMHO crazy since I guess that the average
use of a computer hooked up to cable modem is more than 1 hour. I tried
to get a longer one, but no luck.

Now I wonder when my IP is going to change, because my TCP connections
won't like that. Hopefully, my DHCP client should be able to get the
same one as long as I am online and I will get a different one only if I
unplug my cable modem for a little while. I need to read about DHCP[3]
too.

Dynamic DNS
-----------

I originally wanted to assign a hostname easy to type to my machine in
order to access it remotely, but since I don't have a fixed IP anymore,
it was tricky.

So I decided not to reinveint the wheel and look into free dynamic DNS
providers.

I don't really like dynamic DNS because it puts a heavy load on the name
servers. However, it's more or less the only was I can keep track of my
machine, and I don't plan to use it a lot (and don't expect others to
use it at all), so I feel OK about that.

The one I decided to use is justlinux's DynDNS[4] because it was easy to
set up, you can assign the IP address that you want (and not the one it
thinks you have - too bad if you are sitting behind a proxy) and they
were giving a Perl script for updates under Linux.

I wanted to automate that, so I looked into DHCP clients and got rid of
pump for dhclient[5] (dhcp-client Debian package) which is extremely
configurable.

I rewrote their Perl script using netcat[6] since Perl was kind-of heavy
for a simple HTTP GET request, and I wrote a hook for the client so that
when my IP address is first assigned or changes, I update my DNS entry.

Here is what my /etc/dhclient-exit-hooks looks like:

 #!/bin/sh

 setname() {
 URLPREFIX="/bin/controlpanel/dyndns/jlc.pl?direct=1"
 SERVER="www.justlinux.com"
 USER="@@@"
 PASS="@@@"
 HOST="@@@.penguinpowered.com"
 (echo "GET $URLPREFIX&username=$USER&password=$PASS&HOST=host&IP=$1 HTTP/1.0" \
  && echo && sleep 1) | /usr/bin/nc $SERVER 80
 
 }

 if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \
    [ x$reason = xREBIND ]; then
 setname $new_ip_address;
 fi

 exit 0

This gives me a plug'n'play solution with a static hostname, which is
not too expensive (no cron job sending requests to justlinux every five
minutes).

Conclusion
----------

The conclusion of all that is that RCN's technical support is somewhat
clueless (well, I guess that the average tech support call isn't about a
problem with their DNS tables, but I couldn't talk to anybody who knew
what an authoritative answer was), but their connectivity is pretty good
and much better than what I had with my old cable modem.

 0. http://www.rcn.com/
 1. http://www.3com.com/products/cablemodem/external.html
 2. http://www.cablemodem.com/specifications.html
 3. http://www.faqs.org/rfcs/rfc2131.html
 4. http://www.justlinux.com/dynamic_dns.html
 5. http://www.isc.org/products/DHCP/
 6. http://www.l0pht.com/~weld/netcat/

--
Hugo Haas <[email protected]> - http://larve.net/people/hugo/
La libert� d'�crire et de parler impun�ment marque, soit l'extr�me
bont� du prince, soit le profond esclavage du peuple. On ne permet de
dire qu'� celui qui ne peut rien. -- Denis Diderot

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