iptables unknown option "--to-destination"

SchattenMann

New Member
Aug 21, 2025
5
0
1
Hey all.

I'm just getting started with proxmox v9 and been fighting for a while with port redirection.

iptable manual says I should use -d or --destination

1755796088821.jpeg

but I get this

1755796102289.jpeg
or
1755796130988.jpeg

this makes no sense to me.

it tells me I *must* use --to-destination but when I do use it it says it's an unknown option?
 
I think you have to remove the dport setting, since for DNAT you set it in to-destination.
 
Seems like the order is important, this works for me:

Code:
iptables -t nat -A PREROUTING -i <iface> -p tcp -m tcp -j DNAT --dport 1337 --to-destination 192.0.2.1:1337
 
I can confirm this works, brilliant!

thanks

PS: people doing an inplace upgrade from v8 to v9 will have some fun times...