I have a proxmox host with a single network interface. Now I want a second interface for my VMs with its own subnet.. Also I want to reach the main net from the VMs..
I tried a lot and this seems to work somewhat:
- can remote into a windows VM (10.0.10.11)
- can reach the 192.168.10.0/24 net from the same windows vm when I set gateway to 192.168.10.50
- can not reach the internet from the windows vm
These Lines seems not to be needed, but why?:
post-up iptables -t nat -A POSTROUTING -s 10.0.10.0/24 -o vmbr0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s 10.0.10.0/24 -o vmbr0 -j MASQUERADE
This is my config, please comment if this is not correct in any way..
Thank you very much!
# the PVE managed interfaces into external files!
auto lo
iface lo inet loopback
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
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up echo 1 > /proc/sys/net/ipv4/conf/vmbr0/proxy_arp
auto vmbr1
iface vmbr1 inet static
address 10.0.10.1/24
bridge-ports none
bridge-stp off
bridge-fd 0
post-up iptables -t nat -A POSTROUTING -s 10.0.10.0/24 -o vmbr0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s 10.0.10.0/24 -o vmbr0 -j MASQUERADE
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 13389 -j DNAT --to 10.0.10.11:3389
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp --dport 13389 -j DNAT --to 10.0.10.11:3389
source /etc/network/interfaces.d/*
I tried a lot and this seems to work somewhat:
- can remote into a windows VM (10.0.10.11)
- can reach the 192.168.10.0/24 net from the same windows vm when I set gateway to 192.168.10.50
- can not reach the internet from the windows vm
These Lines seems not to be needed, but why?:
post-up iptables -t nat -A POSTROUTING -s 10.0.10.0/24 -o vmbr0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s 10.0.10.0/24 -o vmbr0 -j MASQUERADE
This is my config, please comment if this is not correct in any way..
Thank you very much!
# the PVE managed interfaces into external files!
auto lo
iface lo inet loopback
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
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up echo 1 > /proc/sys/net/ipv4/conf/vmbr0/proxy_arp
auto vmbr1
iface vmbr1 inet static
address 10.0.10.1/24
bridge-ports none
bridge-stp off
bridge-fd 0
post-up iptables -t nat -A POSTROUTING -s 10.0.10.0/24 -o vmbr0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s 10.0.10.0/24 -o vmbr0 -j MASQUERADE
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 13389 -j DNAT --to 10.0.10.11:3389
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp --dport 13389 -j DNAT --to 10.0.10.11:3389
source /etc/network/interfaces.d/*