I am using net-snmp 5.7.3 (linux platform) and using it to have a master agent for my service acting as sub agent.
I am forwarding all the v1 traps generated by my service via snmp.
my snmpd.conf has folllowing entry for this:
rocommunity public
master agentx
agentxsocket tcp:localhost:705
agentaddress 10161
authtrapenable 1
trapsink 192.168.42.2 public 10162
my snmptrapd.conf file is like this:
disableAuthorization yes
snmpTrapdAddr 127.0.0.1:162
forward default agentx
authCommunity log,execute,net
Problem i have observed is that net-snmp is running on machine 192.168.42.1 but when i check the forwarded trap details at NMS application , i get different Source IP Address which is 'SNMPv1 agent address': 1.1.1.1
1.1.1.1 that is an internal ip address for my service which is configured at different interface eth0.1. Why the net-snmp is using wrong interface to fetch the ipaddress of the box its running on?
Can i specify perticular interface name somehow so that the trap contains the correect source ip adress?
my interfaces are configurred as follows:
root@machine2:/etc/init.d# ifconfig -a
br0 Link encap:Ethernet HWaddr 00:e0:07:0c:e4:2a
inet addr:1.1.1.1 Bcast:1.1.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:6 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1968 (1.9 KiB) TX bytes:0 (0.0 B)
eth0 Link encap:Ethernet HWaddr 00:e0:07:0c:e4:29
inet6 addr: fe80::2e0:7ff:fe0c:e429/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:32927 errors:0 dropped:0 overruns:0 frame:0
TX packets:32665 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1892324 (1.8 MiB) TX bytes:12070683 (11.5 MiB)
Memory:fe4e4000-fe4e4fff
eth1 Link encap:Ethernet HWaddr 00:e0:07:0c:e4:2a
inet6 addr: fe80::2e0:7ff:fe0c:e42a/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:15977 errors:0 dropped:0 overruns:0 frame:0
TX packets:14405 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:864714 (844.4 KiB) TX bytes:4295638 (4.0 MiB)
Memory:fe4e6000-fe4e6fff
**eth0.1 Link encap:Ethernet HWaddr 00:e0:07:0c:e4:29
inet addr:192.168.42.1 Bcast:192.168.42.255 Mask:255.255.255.0**
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:32939 errors:0 dropped:0 overruns:0 frame:0
TX packets:32424 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1761348 (1.6 MiB) TX bytes:11926597 (11.3 MiB)
My expectation is that i should see 192.168.42.1 as source ip address for traps received at NMS application
Thanks.