CMTS info

Helpful linux and DOCSIS/CMTS howtos and tips

Automatic upgrade of cable modem software using ISC DHCPD.

1)Overview

Depending on your dhcpd configuration upgrading cable modem software can be pain in the ass. Especially when each modem IP and config file is defined with host directive. Here is an example:

host modem_1_15{
hardware ethernet 00:11:22:33:44:55; 
fixed-address 172.16.1.15; 
filename "12M_256.bin";
}

After some research I've found that there seem to be an easy solution. Since you can't override filename directive (it's already overriden in host declaration), you have to change next-server option. On different tftp server you can place diferent config files with same filenames used on main tftp server!

2) Preparing tftp server for software upgrade

First you must decide where to run the new tftp server. Easiest way is to run it on the same machine as the original tftp server. You must make sure that old tftpd listens only on one IP. To do this find your tftpd starting script , kill the daemon, start it with extra option: -a IPADDRES:69. It should look something like this:

killall in.tftpd
in.tftpd -l -u nobody -s /boot/ -a 172.16.1.2:69

Now to set up next tftpd server you need extra IP, and a directory to hold config files for upgrade. Execute something like:

  ifconfig eth0:0 172.16.1.3 netmask 255.255.255.0
  mkdir /boot_upgrade
  in.tftpd -l -u nobody -s /boot_upgrade/ -a 172.16.1.3:69

Let's asume you have normal config files named: 1M_128.bin, 2M_256.bin, 4M_512.bin and upgrade_tcm410.bin - for upgrading Thomson tcm410 modem. Copy the upgrade_tcm410.bin to /boot_upgrade/1M_128.bin, /boot_upgrade/2M_256.bin etc.

  cp upgrade_tcm410.bin /boot_upgrade/1M_128.bin
  cp upgrade_tcm410.bin /boot_upgrade/2M_256.bin
  cp upgrade_tcm410.bin /boot_upgrade/4M_512.bin
3) Configure ISC DHCPD

First, you must know from what version you are upgrading. Execute something like:

  snmpwalk -v1 -c public 172.16.1.15 sysDescr.0

Look for "SW_REV:" or similar. Thomson: "SW_REV: ST32.0E.16;", Arris "SW_REV: 6.0.13;" etc.

The SW_REV is sent to dhcp server using dhcp discover option 43. It's encapsulated there with bunch of other suboptions. Software version is either suboption 6 or 202.
Dhcpd doesn't recognise option 43 and it's suboptions out of the box, so they must be specified manually on the begining of dhcpd.conf:

option space vsi;
option vsi.version code 6 = string;
option vsi.version_other code 202 = string;
option vsi-pkt code 43 = encapsulate vsi;

Now for the fun part. Create classes with next-server option overriden where only thomson CMs with software ST32.0E.10 are allowed. Paste this inside subnet declaration:

class "upgrade_tcm390" {
    match if option vsi.version_other = "ST32.0E.10";
    next-server 172.16.1.3;
}

class "upgrade_tcm410" {
    match if option vsi.version = "ST32.0E.10";
    next-server 172.16.1.3;
}

Restart dhcpd and enjoy. Note that after CM upgrades, it reboots and boots out of main tftpd.

Template: designsbydarren.com on license
All trademarks belong to their respective owners. All materials presented here for informational purposes only.