iptables port forwarding

vmanyushin

Member
Jan 9, 2017
3
0
21
45
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
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!