Welcome to the world of high speed cable access. Now that you have it, you will probably find yourself not being able to live without it! I do love my Road Runner cable modem (despite the stupid logo). This is an overview of some of the things that I did to get my system working. These are specific to my machine, but should be easily changed to fit any setup. I am also open to any suggestions.
Here are some of the files that you need to get going:
One of the most important parts of the RR login process is getting that dynamically assigned IP address. This is usually where most of the pain occurs. I suggest the isc-dhcp2 port. It works very well for me in the Columbus, Ohio area. It is also possible to use the Linux rrdhcpcd program, but I haven't had much luck with it, and it is written so that it is a pain to compile depending on what version you attempt to use. There are 2 protocols that are used to login to RR's service. The Linux version of the login program works well, but I have not used the Linux version of the "old protocol". Most places are now using the new protocol. I would suggest trying the perl script to login first. It is easy to install and tells you exactly what is happening as it goes along. If you follow the instructions in the README file of either package you should be fine. I will stick to the perl login on the page however since that is what I use.
A note on the perl login script. If you follow the README, your username and password will be correctly placed inside the rrlogin perl script. You will probably have to edit the script and change this line:
$remote = "sms1"; # Session Management Server
to the name of your logon-server. In Columbus this is simply
"logon-server". I have to hand it to them, that actually made
sense ;-)
I have separated the dhcp and Rad Runner login process into two configuration files. The first file is rc.dhcp. This file gets my dynamic IP address before any of the networking scripts are ran. This file takes care of all the networking setup on your network card. Therefore, if you have this card setup in /etc/rc.conf, remove it from that file. I placed the rc.dhcp file right after the filesystem checks in /etc/rc and before rc.serial:
# Add additional swapfile, if configured.
if [ "x$swapfile" != "xNO" -a -w "$swapfile" -a -b /dev/vn0b ]; then
echo "Adding $swapfile as additional swap."
vnconfig /dev/vn0b $swapfile && swapon /dev/vn0b
fi
# Get my Road Runner dhcp address.
if [ -f /etc/rc.dhcp ]; then
. /etc/rc.dhcp
fi
# configure serial devices
if [ -f /etc/rc.serial ]; then
. /etc/rc.serial
fi
The Road Runner login process occurs after rc.network is ran and the firewall and natd are setup. You really don't have to worry about this unless you are running a firewall. The only reason I do it this way is to leave that option open, or at least easy to implement. This also works best of you want to setup natd for a local LAN. This second file, named rc.rrlogin, is placed in /etc/rc after rc.network:
# start up the initial network configuration.
if [ -f /etc/rc.network ]; then
. /etc/rc.network # We only need to do this once.
network_pass1
fi
# Login to Road Runner.
if [ -f /etc/rc.rrlogin ]; then
. /etc/rc.rrlogin
fi
echo -n "Mounting NFS file systems"
mount -a -t nfs
echo .
The rc.dhcp file first gets my dynamic ip address and then all the configuration information for the NIC card and /etc/resolv.conf. This is all handled by the dhclient program. This is my /etc/rc.dhcp file:
#!/bin/sh
# Get address for main NIC.
echo "Setting for IP address..."
dhclient fxp0
Substitute your Ethernet card for "fxp0". You will also have to create Berkeley Packet filters to use this dhcp client. To do this you must compile your kernel with BPF support. Add this to your kernel configuration file:
# The `bpfilter' pseudo-device enables the Berkeley Packet Filter. Be
# aware of the legal and administrative consequences of enabling this
# option. The number of devices determines the maximum number of
# simultaneous BPF clients programs runnable.
pseudo-device bpfilter 4 #Berkeley packet filter
See the LINT file in the /usr/src/sys/i386/conf directory
or the FreeBSD
handbook
for more details. Don't forget to create 4 bpf devices in /dev with
"MAKEDEV bpf0". Repeat for devices bpf1, bpf2, and bpf3. This gives you
a total of 4 bpfilter devices. Actually you can just make one if you
want (bpf0), but I always make 4.
The second rc.rrlogin file is what handles the Road Runner login process. This is my /etc/rc.rrlogin file:
#!/bin/sh
# Login to Road Runner.
echo "Logging into Road Runner..."
rrlogin
# Set hostname properly.
echo "Setting hostname..."
ip=`ifconfig fxp0 | grep inet | awk '{print $2}'`
name=`host $ip | awk '{print $5}'`
hostname $name
# Remove bogus route. For some reason a route gets added for my
# main NIC's IP address. This is not a big problem, but causes
# arpresolve errors (and I can't ping my IP). This fixes that.
echo "Removing bogus route to $ip..."
route delete $ip
The login is done by the rrlogin program. The next section does a little magic to set my hostname properly. I have to do this because Road Runner seems not to provide me with that information. You might not have to worry about it. If you do need it, substitute your NIC card for fxp0. If you are wondering why I delete the route to my IP, it is because if I don't a route to my IP with a gateway of 127.0.0.1 is added. This is not correct and results in not being able to ping my own IP along with arpresolve warnings. YMMV, and you might not have to do this... in fact it isn't all that important as I went for a while without even noticing it at all.
On a final note, if you want to use Network Address Translation, please see this page for my notes on that as well.
Back to FreeBSD Projects and Notes