This has worked with every model of modem I have tried it with. Replace private with your snmp password
CPE Mac and IP is a bit tricky but doable.
again PHP
// Get the Mac and device type from the OIds
$cpes = snmpwalk($host, "private", ".1.3.6.1.2.1.17.4.3.1.1");
$type = snmpwalk($host, $readpass,".1.3.6.1.2.1.17.4.3.1.3");
// look at each one
for($t=0;$t
{
if (ereg_replace(".*= ", "",$type[$t]) !='4')
{
$modemclients[$t] = ereg_replace("^e", "", ereg_replace(".*= |Hex:|[^0-9A-Fa-f]", "",$cpes[$t]));
}
}
$modemclients will contain a list of all the cpes in the arp table of the modem. that are not the modem.
There is also an OID for IP address too but it was very difficult to script access to, so I got it from our dhcp server instead.
$type is a value that will tell you if the MAC address is an internal CPE(like a USB port on a cable modem would look like a CPE and have it's own MAC address but is Internal) or External(NIC card in a PC)
Here is the OID description of $value
The status of this entry. The meanings of the
values are:
other(1) : none of the following. This would
include the case where some other
MIB object (not the corresponding
instance of dot1dTpFdbPort, nor an
entry in the dot1dStaticTable) is
being used to determine if and how
frames addressed to the value of
the corresponding instance of
dot1dTpFdbAddress are being
forwarded.
invalid(2) : this entry is not longer valid
(e.g., it was learned but has since
aged-out), but has not yet been
flushed from the table.
learned(3) : the value of the corresponding
instance of dot1dTpFdbPort was
learned, and is being used.
self(4) : the value of the corresponding
instance of dot1dTpFdbAddress
represents one of the bridge's
addresses. The corresponding
instance of dot1dTpFdbPort
indicates which of the bridge's
ports has this address.
mgmt(5) : the value of the corresponding
instance of dot1dTpFdbAddress is
also the value of an existing
instance of dot1dStaticAddress.
Any spec related to this, let's assume i'm trying to reset Packetcable, and some in using phone call at that time, i should avoid the RESET, what is the SPec/RFC
CPE list 1.3.6.1.2.1.17.4.3.1.1
cmStandbyMode 1.3.6.1.4.1.1166.1.19.3.1.19.0
1.3.6.1.2.1.10.127.1.2.2.1.3 TX(US) POVER
1.3.6.1.2.1.10.127.1.1.1.1.6 RX(DS) POVER
see docsDev MIBS
I use snmpwalk snmpset from GNU net-snmp
Reset MODEM example PHP
snmpset($host, "private", ".1.3.6.1.2.1.69.1.1.3.0","i",1);
This has worked with every model of modem I have tried it with. Replace private with your snmp password
CPE Mac and IP is a bit tricky but doable.
again PHP
// Get the Mac and device type from the OIds
$cpes = snmpwalk($host, "private", ".1.3.6.1.2.1.17.4.3.1.1");
$type = snmpwalk($host, $readpass,".1.3.6.1.2.1.17.4.3.1.3");
// look at each one
for($t=0;$t
{
if (ereg_replace(".*= ", "",$type[$t]) !='4')
{
$modemclients[$t] = ereg_replace("^e", "", ereg_replace(".*= |Hex:|[^0-9A-Fa-f]", "",$cpes[$t]));
}
}
$modemclients will contain a list of all the cpes in the arp table of the modem. that are not the modem.
There is also an OID for IP address too but it was very difficult to script access to, so I got it from our dhcp server instead.
Hi,
Thanks. Works like a charm. What is the $type for?
emkowale
$type is a value that will tell you if the MAC address is an internal CPE(like a USB port on a cable modem would look like a CPE and have it's own MAC address but is Internal) or External(NIC card in a PC)
1 = Other
2 = Invalid
3 = External CPE
4 = Internal CPE
5 = Management
Generally you will only see 3 or 4
Here is the OID description of $value
The status of this entry. The meanings of the
values are:
other(1) : none of the following. This would
include the case where some other
MIB object (not the corresponding
instance of dot1dTpFdbPort, nor an
entry in the dot1dStaticTable) is
being used to determine if and how
frames addressed to the value of
the corresponding instance of
dot1dTpFdbAddress are being
forwarded.
invalid(2) : this entry is not longer valid
(e.g., it was learned but has since
aged-out), but has not yet been
flushed from the table.
learned(3) : the value of the corresponding
instance of dot1dTpFdbPort was
learned, and is being used.
self(4) : the value of the corresponding
instance of dot1dTpFdbAddress
represents one of the bridge's
addresses. The corresponding
instance of dot1dTpFdbPort
indicates which of the bridge's
ports has this address.
mgmt(5) : the value of the corresponding
instance of dot1dTpFdbAddress is
also the value of an existing
instance of dot1dStaticAddress.
Any spec related to this, let's assume i'm trying to reset Packetcable, and some in using phone call at that time, i should avoid the RESET, what is the SPec/RFC