iptables in Debian 10 - port forwarding / translation

Kernels & Hardware, configuring network, installing services

iptables in Debian 10 - port forwarding / translation

Postby PlunderingPirate9000 » 2020-05-05 23:27

Hi,

How does one go about enabling port forwarding on Debian 10 with the new version of iptables, which I believe uses nf_tables rather than xtables. (Although I'm not really sure what that means.)

I am trying to run this command

$ sudo iptables -t nat -A PREROUTING -p tcp -d 192.168.2.254 --dport 2222 -j DNAT --to-destination 192.168.2.241:22
iptables v1.8.2 (nf_tables): unknown option "--to-destination"
Try `iptables -h' or 'iptables --help' for more information.

Basically I want to setup port forwarding on a router that I have. (It actually runs Raspbian but that appears to be pretty much the same as Debian 10 for this purpose.)

I've read the man pages, but it seems like --to-destination was completely removed. I am unsure if anything replaced it. In addition --dport appears to have been removed so I have no idea how one specifies the from and to ports.

Essentially this router sits between two private networks. I want incoming requests to the IP of the router with port 2222 to be sent to a local machine with IP 192.168.2.241 at port 22. (ssh).

Presumably this is still possible? Can anyone point me in the right direction. Reading the man page just didn't give me enough information.
PlunderingPirate9000
 
Posts: 31
Joined: 2017-11-30 15:17

Re: iptables in Debian 10 - port forwarding / translation

Postby PlunderingPirate9000 » 2020-05-06 01:27

I rebooted my system and now this appears to be working. I have no idea why
PlunderingPirate9000
 
Posts: 31
Joined: 2017-11-30 15:17


Return to System configuration

Who is online

Users browsing this forum: No registered users and 19 guests

fashionable