NAT/Bridge combi - Port Forwarding not working

BlackNeon

New Member
Oct 18, 2018
1
0
1
32
Hello

So i installed Proxmox on my server. I configured a Bridge and NAT interface for my VM's. I installed my first VM (Ubuntu) configured the port forwarding and tried to connect to it with putty -> Connection time out.

I double checked everything twice, firewall, ip configs, ports, but i cant find the mistake.

Maybe someone got an idea?

Host interfaces config:
source /etc/network/interfaces.d/*

auto lo
iface lo inet loopback

iface enp0s31f6 inet manual

auto vmbr0
iface vmbr0 inet static
address 182.36.58.76
netmask 255.255.255.192
gateway 182.36.58.65
bridge-ports enp0s31f6
bridge-stp off
bridge-fd 0


auto vmbr2
iface vmbr2 inet static
address 192.168.10.1
netmask 255.255.255.0
bridge_ports none
bridge_stp off
bridge_fd 0
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up iptables -t nat -A POSTROUTING -s '192.168.10.0/24' -o vmbr0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '192.168.10.0/24' -o vmbr0 -j MASQUERADE
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 2222 -j DNAT --to 192.168.10.2:22
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp --dport 2222 -j DNAT --to 192.168.10.2:22

Guest OS netplan config:
network:
version: 2
renderer: networkd
ethernets:
ens18:
addresses:
- 192.168.10.2/24
dhcp4: no
gateway: 192.168.10.1
nameservers:
addresses: [8.8.8.8,8.8.4.4]