Getting CM's assigned IP | docsis.org

You are here

Getting CM's assigned IP

7 posts / 0 new
Last post
heyya
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.

TIA

emkowale
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?

emkowale

heyya
Hi, I am not using any

Hi,

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!

heyya
ok, I wrote a simple parser

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

kwesibrunee
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 1.3.6.1.4.1.9.9.116.1.3.1.1.3 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 1.3.6.1.4.1.9.9.116.1.3.1.1.3.0.17.34.175.190.205 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 0.17.34.175.190.205

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.

heyya
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 1.3.6.1.2.1.17.4.3.1.1 I get

SNMPv2-SMI::mib-2.17.4.3.1.1.0.26.173.128.26.108 = Hex-STRING: 00 1A AD 80 1A 6C
SNMPv2-SMI::mib-2.17.4.3.1.1.0.35.84.211.24.21 = 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.

TIA

emkowale
let me know

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

eric@starlightcable.com

Log in or register to post comments