On Ubuntu 22.04 I am trying to render the incoming traffic of a certain port to another ip address. I have redirected several TCP ports with this command and they all work correctly: iptables -t nat -A PREROUTING -d 82.xxx.xx.xxx -p tcp --dport 8123 -j DNAT --to-destination 10.147.19.4:8123 However, when I try to redirect a UDP port, I see it closed from the outside. I use this command. What am I doing wrong?
iptables -t nat -A PREROUTING -d 82.165.55.176 -p udp --dport 1883 -j DNAT --to-destination 10.147.19.4:51820
Thanks
iptables-save -c
(rather thaniptables -L
).