Difference between revisions of "Template:FAQ:Applications 25b"

From Net-SNMP Wiki
Jump to: navigation, search
 
(How do I specify IPv6 addresses in tools command line arguments?)
 
Line 1: Line 1:
= How do I specify IPv6 addresses in tools command line arguments? =
 
 
 
IPv6 addresses pose a particular problem for the Net-SNMP command line tools, which parse host names into pieces.  In particular, normally if you specify a simple host name, it assumes you want UDP in IPv4 on port 161.  IE, these two commands are actually the same (by default):
 
IPv6 addresses pose a particular problem for the Net-SNMP command line tools, which parse host names into pieces.  In particular, normally if you specify a simple host name, it assumes you want UDP in IPv4 on port 161.  IE, these two commands are actually the same (by default):
  

Latest revision as of 20:04, 30 August 2007

IPv6 addresses pose a particular problem for the Net-SNMP command line tools, which parse host names into pieces. In particular, normally if you specify a simple host name, it assumes you want UDP in IPv4 on port 161. IE, these two commands are actually the same (by default):

 snmpget 127.0.0.1 sysUpTime.0
 snmpget udp:127.0.0.1:161 sysUpTime.0

However, for IPv6 this causes a problem because IPv6 addresses also use a colon to separate addressing parts. Thus you need to enclose the address in square brackets ( [ and ] ). Because most shells use these brackets too, you also likely need to quote it:

 snmpget 'udp6:[::1]:161' sysUpTime.0