iptables port forwarding

vmanyushin

Member
Jan 9, 2017
3
0
21
46
Hi,

trying make a port forwarding from host to guest

Code:
iptables -t nat -D PREROUTING -i vmbr0 -p tcp --dport 2222 -j DNAT --to 192.168.0.3:22
iptables: No chain/target/match by that name.

iptables always fail when i specify --dport
Code:
iptables -A INPUT -p tcp --dport 2222 -j LOG
iptables: No chain/target/match by that name.

uname -a Linux debian 4.4.35-1-pve
lsmod | grep ipt

Code:
ipt_MASQUERADE         16384  1
nf_nat_masquerade_ipv4    16384  1 ipt_MASQUERADE
iptable_nat            16384  1
nf_nat_ipv4            16384  1 iptable_nat
iptable_filter         16384  0
ip_tables              28672  2 iptable_filter,iptable_nat
x_tables               36864  5 ip6table_filter,ip_tables,ipt_MASQUERADE,iptable_filter,ip6_tables

in clear debian 8.6 system i see xt_tcpudp module and commands with --dport work well...
 
iptables -t nat -D PREROUTING -i vmbr0 -p tcp --dport 2222 -j DNAT --to 192.168.0.3:22
-D --delete is for delete
use
-A --append
or
-I --insert
 
pardon, i was mistyped, of course

Code:
iptables -t nat -A PREROUTING -p tcp --dport 2222 -j DNAT --to-destination 192.168.0.3:22

in additional this messages loggen when i try to add a rule

Code:
Jan  9 17:23:43 debian kernel: [1491384.468411] xt_tcpudp: disagrees about version of symbol module_layout