# snmptrap does not work



## spring_64 (Dec 3, 2019)

Hi
I'm on FreeBSD 12. The NET-SNMP version is 5.7.3. 

This my config :

```
view router_view included .1
view router_view included .1.3.6.1.2.1.1.1
view router_view excluded .1.3.6.1.2.1.6.16
view router_view excluded .1.3.6.1.2.1.7.6
view router_view excluded .1.3.6.1.2.1.25
view router_view excluded .1.3.6.1.2.1.28.1
view router_view excluded .1.3.6.1.2.1.55.1.5
view router_view excluded .1.3.6.1.2.1.104.1
view router_view excluded .1.3.6.1.2.1.88.1.3.1.1
view router_view excluded .1.3.6.1.2.1.88.1.4.2.1
view router_view excluded .1.3.6.1.2.1.88.1.4.3.1
view router_view excluded .1.3.6.1.2.1.28.2.1
view router_view excluded .1.3.6.1.2.1.7.6.1
view router_view excluded .1.3.6.1.2.1.6.13.1
view router_view excluded .1.3.6.1.2.1.6.16.1
view router_view excluded .1.3.6.1.4.1.8072
view router_view excluded .1.3.6.1.4.1.2021
view router_view included .1.3.6.1.4.1.2021.4.6
view router_view included .1.3.6.1.4.1.2021.4.11
view router_view included .1.3.6.1.4.1.2021.11.9
view router_view included .1.3.6.1.4.1.2021.11.50
view router_view included .1.3.6.1.4.1.2021.11.10
view router_view included .1.3.6.1.4.1.2021.11.52
view router_view included .1.3.6.1.4.1.2021.11.11
view router_view included .1.3.6.1.4.1.2021.11.53
view router_view included .1.3.6.1.4.1.2021.11.51
view router_view excluded .1.3.6.1.6
view router_view included .1.3.6.1.2.1.25.1
view router_view included .1.3.6.1.2.1.25.5
view router_view included .1.3.6.1.2.1.25.3.2
view router_view included .1.3.6.1.2.1.25.3.3

rocommunity public 

#createUser authOnlyUser  MD5 12345678
#createUser authPrivUser  SHA 12345678 DES
#createUser internalUser  MD5 12345678

#rouser   authOnlyUser

trapcommunity public
trap2sink   <ip>

#iquerySecName   internalUser       
#rouser          internalUser

defaultMonitors          yes

linkUpDownNotifications  yes
```

I run tcpdump on my server. I down and up an interface but The traps dose not send.

The tcpdump command is:
`tcpdump -ni re0 -U port 161`


----------



## SirDice (Dec 3, 2019)

Traps are sent to port 162.


----------



## spring_64 (Dec 3, 2019)

SirDice said:


> s are sent to port 162.



Thanks for your reply, I changed tcpdump command and replaced 161 with 162, but I can not see the trap.


----------



## spring_64 (Dec 3, 2019)

i defied a log file and show this error when I start the snmpd


```
You must specify a default user name using the agentSecName token
```

I search but I can't solve the problem.


----------



## SirDice (Dec 3, 2019)

It's been a long time ago but if I remember correctly you need to use `snmpconf` to create a basic configuration.


----------

