Re: SNMP OID for Interface IP Address

Adam Armstrong <[email protected]>
Newsgroups gmane.comp.security.firewalls.m0n0wall
Message-ID <[email protected]>
Aaron Cherman wrote:
> Is there any way to use SNMP to poll an OID to find an interface's IP address?
>
> I use a simple ADSL connection for a backup for our alarms.  So I open up our main m0n0wall (on fiber) to allow pings from the ADSL m0n0wall, but it uses DHCP and every once in a while the ISP screws with things and we end up getting assigned a new address (on a new subnet too).  Of course the fiber m0n0wall won't permit pings from that address and it appears to be down.  I have to redo the permit rule and routing info for the new subnet/address.  I'd like to monitor the IP address on the WAN interface and if it changes I can trigger an alert.
>
> Any ideas?  I done and SNMP walk and do see the address listed, but it appears in a table with the row ID being the address itself.  Weird.
>
> Thanks in advance.
>
> Aaron
>   
You need to work out what ifIndex is for each interface, so walk ifDescr:

IF-MIB::ifDescr.2 = STRING: eth0

Then you need to walk ipAdEntIfIndex :

IP-MIB::ipAdEntIfIndex.87.244.103.66 = INTEGER: 2

and then ipAdEntNetMask :

IP-MIB::ipAdEntNetMask.87.244.103.66 = IpAddress: 255.255.255.248

Hope that helps!

adam.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.