Re: Get interface IPV6 addresses

2020-02-27 Thread Michael Wu
>What OS is this? Is this your own compilation from the release tar ball
>or the versions provided by your distribution?

It is Debian Linux and my own compilation from older 5.8 last year (Tue Feb
26 commit 21260fdd60c172839f997fb6f888a6e21c6825eb)

>  I do, with the CentOS 7 provided version (5.7.2), and with a somewhat
>recent installation of the 5-8-patches branch.
 Actually I do too :) I was mistaken when I stated that I did not see
ipAddressPrefix.
So If I want to get "interface name" to "ipv6 address" mapping, I need to
get
1. ifIndex = 2  from
IP-MIB::ipAddressIfIndex.ipv6."20:01:04:70:df:9a:00:00:00:00:00:00:00:00:00:01"
= INTEGER: 2
2. Then get ifName from ifIndex

Niels, Thank you for your help,

Michael

On Thu, Feb 27, 2020 at 1:31 PM Niels Baggesen  wrote:

> Den 27-02-2020 kl. 18:40 skrev Michael Wu:
> > Dear Net-Snmp coders:
> >
> > I am using net-snmp v5.8 with ipv6 enabled. Trying to get interface's
> > ipv6 addresses. I tried a couple of oids but could not figure out how to
> > map the ifindex to the ipv6 address assigned to the interfaces. All
> > interfaces have both ipv4 and ipv6 addresses assigned.
>
> What OS is this? Is this your own compilation from the release tar ball
> or the versions provided by your distribution?


> > 1. The ipv6AddrPrefixTable documented in
> > http://www.net-snmp.org/docs/mibs/ipv6MIB.html
> >  was not available:
> >
> > snmpwalk -v 2c -c public x.x.x.x .1.3.6.1.2.1.55.1.7
> > IPV6-MIB::ipv6AddrPrefixTable = No Such Object available on this agent
> > at this OID
>
> No, the IPV6-MIB has been deprecated in favor of the augmented IP-MIB
> (as used below)
>
> > 2. ipAddressTable (1.3.6.1.2.1.4.34) has entries of ipv6 prefix:
> >
> > snmpwalk -v 2c -c public x.x.x.x .1.3.6.1.2.1.4.34
> > IP-MIB::ipAddressIfIndex.ipv4."243.0.3.129" = INTEGER: 230
> >
> IP-MIB::ipAddressIfIndex.ipv6."fe:80:00:00:00:00:00:00:02:e0:ec:ff:fe:e1:5e:44"
>
> > = INTEGER: 230
> > IP-MIB::ipAddressType.ipv4."243.0.3.129" = INTEGER: unicast(1)
> >
> IP-MIB::ipAddressType.ipv6."fe:80:00:00:00:00:00:00:02:e0:ec:ff:fe:e1:5e:44"
>
> > = INTEGER: unicast(1)
> > ...
> > But I don't see ipAddressPrefix ( .1.3.6.1.2.1.4.34.5) from the output.
>
> I do, with the CentOS 7 provided version (5.7.2), and with a somewhat
> recent installation of the 5-8-patches branch.
>
> IP-MIB::ipAddressPrefix.ipv6."00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:01"
>
> = OID:
> IP-MIB::ipAddressPrefixOrigin.1.ipv6."00:00:00:00:00:00:00:00:00:00:00:00:
>   00:00:00:01".128
> IP-MIB::ipAddressPrefix.ipv6."20:01:04:70:df:9a:00:00:00:00:00:00:00:00:00:01"
>
> =   OID:
> IP-MIB::ipAddressPrefixOrigin.2.ipv6."20:01:04:70:df:9a:00:00:00:00:00:00:
>   00:00:00:00".64
> IP-MIB::ipAddressPrefix.ipv6."fe:80:00:00:00:00:00:00:de:98:3e:20:92:51:bd:11"
>
> =   OID:
> IP-MIB::ipAddressPrefixOrigin.2.ipv6."fe:80:00:00:00:00:00:00:00:00:00:00:
>   00:00:00:00".64
>
>
> > 3. Also tried ipAdEntIfIndex ( 1.3.6.1.2.1.4.20.1.2)
> >
> > snmpwalk -v 2c -c public x.x.x.x 1.3.6.1.2.1.4.20.1.2
> > ...
> > IP-MIB::ipAdEntIfIndex.243.0.3.129 = INTEGER: 230
> > ...
> > But it only has ipv4 addresses.
>
> Yes, this is a IPv4 only table.
>
> > What is the right approach to get the ipv6 address from the interface?
>
> I would look at
> IP-MIB::ipAddressIfIndex.ipv6."00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:01"
>
> = INTEGER: 1
> IP-MIB::ipAddressIfIndex.ipv6."20:01:04:70:df:9a:00:00:00:00:00:00:00:00:00:01"
>
> = INTEGER: 2
>
> /Niels
>
> PS: Sorry about the line wrap of these extreme OIDs :-(
>
> --
> 
>
>
>
> ___
> Net-snmp-coders mailing list
> Net-snmp-coders@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
>
___
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders


Re: Get interface IPV6 addresses

2020-02-27 Thread Niels Baggesen

Den 27-02-2020 kl. 18:40 skrev Michael Wu:

Dear Net-Snmp coders:

I am using net-snmp v5.8 with ipv6 enabled. Trying to get interface's 
ipv6 addresses. I tried a couple of oids but could not figure out how to 
map the ifindex to the ipv6 address assigned to the interfaces. All 
interfaces have both ipv4 and ipv6 addresses assigned.


What OS is this? Is this your own compilation from the release tar ball 
or the versions provided by your distribution?


1. The ipv6AddrPrefixTable documented in 
http://www.net-snmp.org/docs/mibs/ipv6MIB.html 
 was not available:


snmpwalk -v 2c -c public x.x.x.x .1.3.6.1.2.1.55.1.7
IPV6-MIB::ipv6AddrPrefixTable = No Such Object available on this agent 
at this OID


No, the IPV6-MIB has been deprecated in favor of the augmented IP-MIB 
(as used below)



2. ipAddressTable (1.3.6.1.2.1.4.34) has entries of ipv6 prefix:

snmpwalk -v 2c -c public x.x.x.x .1.3.6.1.2.1.4.34
IP-MIB::ipAddressIfIndex.ipv4."243.0.3.129" = INTEGER: 230
IP-MIB::ipAddressIfIndex.ipv6."fe:80:00:00:00:00:00:00:02:e0:ec:ff:fe:e1:5e:44" 
= INTEGER: 230

IP-MIB::ipAddressType.ipv4."243.0.3.129" = INTEGER: unicast(1)
IP-MIB::ipAddressType.ipv6."fe:80:00:00:00:00:00:00:02:e0:ec:ff:fe:e1:5e:44" 
= INTEGER: unicast(1)

...
But I don't see ipAddressPrefix ( .1.3.6.1.2.1.4.34.5) from the output.


I do, with the CentOS 7 provided version (5.7.2), and with a somewhat 
recent installation of the 5-8-patches branch.


IP-MIB::ipAddressPrefix.ipv6."00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:01" 
= OID: 
IP-MIB::ipAddressPrefixOrigin.1.ipv6."00:00:00:00:00:00:00:00:00:00:00:00: 
 00:00:00:01".128
IP-MIB::ipAddressPrefix.ipv6."20:01:04:70:df:9a:00:00:00:00:00:00:00:00:00:01" 
=   OID: 
IP-MIB::ipAddressPrefixOrigin.2.ipv6."20:01:04:70:df:9a:00:00:00:00:00:00: 
 00:00:00:00".64
IP-MIB::ipAddressPrefix.ipv6."fe:80:00:00:00:00:00:00:de:98:3e:20:92:51:bd:11" 
=   OID: 
IP-MIB::ipAddressPrefixOrigin.2.ipv6."fe:80:00:00:00:00:00:00:00:00:00:00: 
 00:00:00:00".64




3. Also tried ipAdEntIfIndex ( 1.3.6.1.2.1.4.20.1.2)

snmpwalk -v 2c -c public x.x.x.x 1.3.6.1.2.1.4.20.1.2
...
IP-MIB::ipAdEntIfIndex.243.0.3.129 = INTEGER: 230
...
But it only has ipv4 addresses.


Yes, this is a IPv4 only table.


What is the right approach to get the ipv6 address from the interface?


I would look at
IP-MIB::ipAddressIfIndex.ipv6."00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:01" 
= INTEGER: 1
IP-MIB::ipAddressIfIndex.ipv6."20:01:04:70:df:9a:00:00:00:00:00:00:00:00:00:01" 
= INTEGER: 2


/Niels

PS: Sorry about the line wrap of these extreme OIDs :-(

--




___
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders


Get interface IPV6 addresses

2020-02-27 Thread Michael Wu
Dear Net-Snmp coders:

I am using net-snmp v5.8 with ipv6 enabled. Trying to get interface's ipv6
addresses. I tried a couple of oids but could not figure out how to map the
ifindex to the ipv6 address assigned to the interfaces. All interfaces have
both ipv4 and ipv6 addresses assigned.

1. The ipv6AddrPrefixTable documented in
http://www.net-snmp.org/docs/mibs/ipv6MIB.html was not available:

snmpwalk -v 2c -c public x.x.x.x .1.3.6.1.2.1.55.1.7
IPV6-MIB::ipv6AddrPrefixTable = No Such Object available on this agent at
this OID

2. ipAddressTable (1.3.6.1.2.1.4.34) has entries of ipv6 prefix:

snmpwalk -v 2c -c public x.x.x.x .1.3.6.1.2.1.4.34
IP-MIB::ipAddressIfIndex.ipv4."243.0.3.129" = INTEGER: 230
IP-MIB::ipAddressIfIndex.ipv6."fe:80:00:00:00:00:00:00:02:e0:ec:ff:fe:e1:5e:44"
= INTEGER: 230
IP-MIB::ipAddressType.ipv4."243.0.3.129" = INTEGER: unicast(1)
IP-MIB::ipAddressType.ipv6."fe:80:00:00:00:00:00:00:02:e0:ec:ff:fe:e1:5e:44"
= INTEGER: unicast(1)
...
But I don't see ipAddressPrefix ( .1.3.6.1.2.1.4.34.5) from the output.

3. Also tried ipAdEntIfIndex ( 1.3.6.1.2.1.4.20.1.2)

snmpwalk -v 2c -c public x.x.x.x 1.3.6.1.2.1.4.20.1.2
...
IP-MIB::ipAdEntIfIndex.243.0.3.129 = INTEGER: 230
...
But it only has ipv4 addresses.

What is the right approach to get the ipv6 address from the interface?

Thanks and best regards,

Michael
___
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders