Hello,
my current problem is, that im trying to forward the port 81 from my VM (privat ip: 192.168.0.250), but i can't access it from outside and it shows that the port 81 as closed.
Firewall is currently disabled.
Host interfaces config:
source /etc/network/interfaces.d/*
auto lo
iface lo inet loopback
auto enp2s0
iface enp2s0 inet manual
up route add -net 148.251.x.x netmask 255.255.255.192 gw 148.251.x.x dev enp2s0
auto vmbr0
iface vmbr0 inet static
address 148.251.x.x/26
gateway 148.251.x.x
bridge-ports enp2s0
bridge-stp off
bridge-fd 0
auto vmbr1
iface vmbr1 inet static
address 192.168.0.254/24
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.0.0/24' -o vmbr0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '192.168.0.0/24' -o vmbr0 -j MASQUERADE
iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 80 -j DNAT --to 192.168.0.250:80
iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 81 -j DNAT --to 192.168.0.250:81
iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 443 -j DNAT --to 192.168.0.250:443
my current problem is, that im trying to forward the port 81 from my VM (privat ip: 192.168.0.250), but i can't access it from outside and it shows that the port 81 as closed.
Firewall is currently disabled.
Host interfaces config:
source /etc/network/interfaces.d/*
auto lo
iface lo inet loopback
auto enp2s0
iface enp2s0 inet manual
up route add -net 148.251.x.x netmask 255.255.255.192 gw 148.251.x.x dev enp2s0
auto vmbr0
iface vmbr0 inet static
address 148.251.x.x/26
gateway 148.251.x.x
bridge-ports enp2s0
bridge-stp off
bridge-fd 0
auto vmbr1
iface vmbr1 inet static
address 192.168.0.254/24
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.0.0/24' -o vmbr0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '192.168.0.0/24' -o vmbr0 -j MASQUERADE
iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 80 -j DNAT --to 192.168.0.250:80
iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 81 -j DNAT --to 192.168.0.250:81
iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 443 -j DNAT --to 192.168.0.250:443