Getting CM's assigned IP |

You are here

Getting CM's assigned IP

7 posts / 0 new
Last post
Getting CM's assigned IP

I am having trouble (and have no idea except parsing DHCP server's log - but this seems to be too slow and buggy) with getting the CM's assigned IP address. I have DHCP server running on the same machine where the provisioning sw runs, IP addresses are assigned dynamically.

I have the MAC address of course.


You need to parse..

What provisioning software are you using? This seems like it should be pretty simple. Are you just trying to assign a static to a CM? Or to a CPE?


Hi, I am not using any


I am not using any particular provisioning sw - just plain ISC DHCP / TFTP server with docsis generated CM conf files. I need the IP address that is assigned to CMs - I have assigned dynamic IP addresses to them and I just got an idea that DHCP leases file has got the combinations of all the MACs and IP addresses. Should I parse that one? I need the IP address to perform some SNMP on it.

I have another question - what interests me is how can I get the CPE's (dynamically assigned) IP address somehow via SNMP through every particular CM?

Thanks a lot!

ok, I wrote a simple parser

ok, I wrote a simple parser for .leases file and it works at it should.

I have found that trying to

I have found that trying to get the IP address from the DHCP server a lot more trouble than its worth..... Especially when multiple leases exist per client.

personally I retrieve this info from the CMTS, and given the mac address can easily get the CPE IP with one SNMP call. This is cisco specific, but most cmts vendors should have something similar.

The Oid in question is info about it found Here

it is indexed by mac address written in decimal form

i.e. to find the ip belonging to mac address 00:11:22:af:be:cd you would first convert the mac to decimal

00 = 0
11 = 17
22 = 34
af = 175
be = 190
cd = 205

then query the response will be the IP address in question.

some php code to convert macs in the format of 001122aebecd to their decimal counterpart is

$formattedMac = split("_", ereg_replace("_$", "", chunk_split($macAddress, 2, "_")));
$formattedMac2 = array_map("hexdec", $formattedMac);
$formattedMac = join (".", $formattedMac2);

if the mac is in the format of 00:11:22:af:be:cd then the following code will work.

$formattedMac = split(":", $macAddress);
$formattedMac2 = array_map("hexdec", $formattedMac);
$formattedMac = join (".", $formattedMac2);

both of these will give you the string

If you still prefer to get the info from DHCPd look into using OMAPI to retrieve the info, there is some info on it in these forums, it will be a lot cleaner and you don't have to play with a leases file.

IPs of CPEs behind CM

OK, one thing is still bugging me:

When I do a snmpwalk on a (testing) CM that has some device behind with the following OID I get

SNMPv2-SMI::mib- = Hex-STRING: 00 1A AD 80 1A 6C
SNMPv2-SMI::mib- = Hex-STRING: 00 23 54 D3 18 15

How can I get IP from this data? I would like to have the list of IPs that are assigned to the devices behind CM for every CM.


let me know

I can develop you a nice little system. I've wrote many for many people.

Log in or register to post comments