0

I want to redirect SNMP traps.

Let's say, receive an SNMP trap on UDP port 162, and redirect the package to ports 10162 and 20162 (both of them). How can I achieve this using iptables?

I can successfully redirect the package to port 10162 using:

iptables -t nat -A PREROUTING -i eth0 -p udp --dport 162 -j REDIRECT --to-port 10162

Is it possible to redirect the package to two ports?

roaima
  • 107,089
  • 14
  • 139
  • 261
  • Possible duplicate of [IPTABLES: process a packet locally and send a copy to another host](https://unix.stackexchange.com/q/377407/100397) – roaima Feb 06 '19 at 07:54
  • That was very helpful. Thanks so much @roaima – Emmanuel Sosa Feb 06 '19 at 08:57
  • I hope so. If not, I'll happily withdraw the suggestion and we can continue on here, but you'd need to make it clear in your question why that wasn't a suitable answer. – roaima Feb 06 '19 at 15:35

0 Answers0