Thanks for your reply.Hello,
how do you want to connect to your VMs? Via RDP, or SSH?
Ports are not just 'subgroups of IP addresses', they work on a different network layer.
So if you think that instead of 'aaa.bbb.ccc.ddd' you can input 'aaa.bbb.ccc.ddd:9001' in all your favourite programs then that won't in general.
Kind regards,
Benedikt
auto lo
iface lo inet loopback
iface enp5s0 inet manual
auto vmbr0
iface vmbr0 inet static
address 192.168.12.105/24
gateway 192.168.12.1
bridge-ports enp5s0
bridge-stp off
bridge-fd 0
auto vmbr2
iface vmbr2 inet static
address 10.10.10.254
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 '10.10.10.0/24' -o vmbr0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '10.10.10.0/24' -o vmbr0 -j MASQUERADE
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp –dport 9001 -j DNAT –to 10.10.10.1:3389
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp –dport 9001 -j DNAT –to 10.10.10.1:3389
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp –dport 9002 -j DNAT –to 10.10.10.2:3389
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp –dport 9002 -j DNAT –to 10.10.10.2:3389
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp –dport 9003 -j DNAT –to 10.10.10.3:3389
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp –dport 9003 -j DNAT –to 10.10.10.3:3389
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp –dport 9004 -j DNAT –to 10.10.10.4:3389
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp –dport 9004 -j DNAT –to 10.10.10.4:3389
I had change to correct ip but can not remote to VMs. also enable Remote Desktop and disable Firewall in VMs.The config looks good so far, although the IPs do not match your picture above. From the 192.168.12.0/24 subnet you should be able to RDP to 192.168.12.105:9001 - 192.168.12.105:9004 and reach your VMs that way.
It is quite normal that you can't ping your VMs from outside, since that happens on a different layer. Your port forwardings do not apply to pings. Pinging inside -> outside works because of your Masquerade rule, but pinging outside -> inside won't work.
iface enp57s0 inet manual
auto vmbr0
iface vmbr0 inet static
address 192.168.10.50/24
gateway 192.168.10.1
bridge-ports enp57s0
bridge-stp off
bridge-fd 0
auto vmbr1
iface vmbr1 inet static
address 10.10.10.254
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 '10.10.10.0/24' -o vmbr0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '10.10.10.0/24' -o vmbr0 -j MASQUERADE
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp –dport 9001 -j DNAT –to 10.10.10.1:3389
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp –dport 9001 -j DNAT –to 10.10.10.1:3389
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp –dport 9002 -j DNAT –to 10.10.10.2:3389
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp –dport 9002 -j DNAT –to 10.10.10.2:3389
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp –dport 9003 -j DNAT –to 10.10.10.3:3389
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp –dport 9003 -j DNAT –to 10.10.10.3:3389
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp –dport 9004 -j DNAT –to 10.10.10.4:3389
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp –dport 9004 -j DNAT –to 10.10.10.4:3389
source /etc/network/interfaces.d/*
We use essential cookies to make this site work, and optional cookies to enhance your experience.