Hello everyone. I have a problem.
I created a subnet so the VMs I create don't take up IP space. I have created a Windows Server 2012 machine used for my personal cloud (200GB SSD + 1TB External HDD).
I try to port forward 3389 port using these ip table commands:
post-up iptables -t nat -A PREROUTING -i vmbr0 -p udp --dport 3389 -j DNAT --to 150.40.0.2:3389
post-down iptables -t nat -A PREROUTING -i vmbr0 -p udp --dport 3389 -j DNAT --to 150.40.0.2:3389
and it doesn't work.
My interface config is this:
iface lo inet loopback
iface enp2s0 inet manual
auto vmbr0
iface vmbr0 inet static
address 192.168.2.100/24
gateway 192.168.2.1
bridge-ports enp2s0
bridge-stp off
bridge-fd 0
auto vmbr1
iface vmbr1 inet static
address 150.40.0.1/16
netmask 255.255.0.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 '150.40.0.0/16' -o vmbr0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '150.40.0.0/16' -o vmbr0 -j MASQUERADE
post-up iptables -t nat -A PREROUTING -i vmbr0 -p udp --dport 3389 -j DNAT --to 150.40.0.2:3389
post-down iptables -t nat -A PREROUTING -i vmbr0 -p udp --dport 3389 -j DNAT --to 150.40.0.2:3389
Any help? Thanks
I created a subnet so the VMs I create don't take up IP space. I have created a Windows Server 2012 machine used for my personal cloud (200GB SSD + 1TB External HDD).
I try to port forward 3389 port using these ip table commands:
post-up iptables -t nat -A PREROUTING -i vmbr0 -p udp --dport 3389 -j DNAT --to 150.40.0.2:3389
post-down iptables -t nat -A PREROUTING -i vmbr0 -p udp --dport 3389 -j DNAT --to 150.40.0.2:3389
and it doesn't work.
My interface config is this:
iface lo inet loopback
iface enp2s0 inet manual
auto vmbr0
iface vmbr0 inet static
address 192.168.2.100/24
gateway 192.168.2.1
bridge-ports enp2s0
bridge-stp off
bridge-fd 0
auto vmbr1
iface vmbr1 inet static
address 150.40.0.1/16
netmask 255.255.0.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 '150.40.0.0/16' -o vmbr0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '150.40.0.0/16' -o vmbr0 -j MASQUERADE
post-up iptables -t nat -A PREROUTING -i vmbr0 -p udp --dport 3389 -j DNAT --to 150.40.0.2:3389
post-down iptables -t nat -A PREROUTING -i vmbr0 -p udp --dport 3389 -j DNAT --to 150.40.0.2:3389
Any help? Thanks