Thursday, August 19, 2010

Fedora: Install & configure Net-SNMP running on IPv6

I've install net-snmp on my fedora machine for 'secret' purpose :P
Here are some basic tutorial but it works for me and perhaps all fedora user. I've experienced some errors if directly install the net-snmp. Thus, I try to install perl first (latest version) before installing and afterwards I didn't face any error to install.

Step 1: Installing Perl from source
Download tar ball (.tar.gz) of the latest version with type (maint) here

login as root, go to directory where the tar ball is located, extract and go inside directory
$ su
# tar xzvf perl-version.tar.gz
# cd perl-version

now, we configure (with default setting) to confirm with your platform
# ./Configure -de

compile and install
# make && make install

Note that it won't be installed if there is an error

if it is successfully installed, try . .
$ perl -v

output will be the version of newly installed perl. In my case:
This is perl 5, version 12, subversion 1 (v5.12.1) built for i686-linux

Step 2: Installing net-snmp from source
Go to net-snmp page and download source file (.tar.gz) under 'current release'. Same thing, extract the tar file
# tar xzvf net-snmp-version.tar.gz
# cd net-snmp-version

Then, configure using several option (press enter for each prompt)
# ./configure --enable-ipv6 --with-transports="UDP UDPIPv6" --with-libs=-lpthread --with-perl-modules

finally compile and install
# make && make test && make install

remember, if any error occurs installation won't finish

Step 3: snmpd configuration file
Go to snmp directory
# cd /usr/local/share/snmp

Then, we can create snmpd.conf file using this command
# snmpconf

Would you like me to read them in? Their content will be merged with the
output files created by this session.

Valid answer examples: "all", "none","3","1,2,5"

Read in which (default = all): none

next . .

I can create the following types of configuration files for you.
Select the file type you wish to create:
(you can create more than one as you run this program)

1: snmpd.conf
2: snmptrapd.conf
3: snmp.conf

Other options: quit

Select File: 1

Lastly, type 'finished' and 'quit'. You will get output like this
The following files were created:

snmpd.conf

Now, edit this file and replace with all content posted here
# gedit snmpd.conf

and add this line after this line '# sec.name source community'
[...]

com2sec6 local ::1 public

[...]

save the file and close.

Now, Run snmpd first just on udp with IPv6 on port 161 (as root)
# snmpd udp6:161

Then, try snmpwalk (You should have IPv6 configured)
# snmpwalk -v 1 -c public 'ipv6:[::1]' IP-MIB::ipAdEntIfIndex

Output will be somehow like this
IP-MIB::ipAdEntIfIndex.10.1.27.140 = INTEGER: 3
IP-MIB::ipAdEntIfIndex.127.0.0.1 = INTEGER: 1

If you got this, so i think it works ;)

3 comments:

  1. Just to add,
    The answer for
    # snmpwalk blabla

    could be different from mentioned above. But it's similar.

    If your snmpwalk didnt work, yet... It will returned error. So that is the way to recognize error, as long as you got some output, means your snmp is working just fine. ;) :ice

    ReplyDelete
  2. Hi angkat bahu,

    I had installed Net snmp 5. 4 with ipv6 enabled on redhat 5. But it works fine on ip v4. In ipv6 it works only with the loopback address that is "[::1]". But it does not work on link-local address(machine generated ipv6 address)

    let me have some solution regarding this.

    ReplyDelete
  3. Hi Raja,
    Thanks for visiting. actually, in your case, I haven't tried using link local address, but last time i tried using manual configuration of IPv6 address for two hosts, such as 2002::1 and 2002::2. I'll try to check it out.

    Please share with me if you have found the solution :-)

    ReplyDelete