Hi,
I’ve two dedicates servers in OVH (SRV1 and SRV2) each other with proxmox 6
I’ve activated a virtual rack (vRack OVH product) for build a LAN.
All the firewalls (dedicated servers, proxmox, virtual machines) are down (temporally).
Network configuration:
SRV1
ETH0
IP WAN SRV1: 50.50.50.12
GW SRV1: 50.50.50.254
ETH1
IP LAN SRV1: 172.16.0.1/12
SRV2
ETH0
IP WAN SRV2: 50.50.50.13
GW SRV2: 50.50.50.254
ETH1
IP LAN SRV2: 172.16.0.2/12
This is the SRV1 interfaces file:
auto lo
iface lo inet loopback
iface eth0 inet manual
iface eth1 inet manual
auto vmbr0
iface vmbr0 inet dhcp
bridge-ports eth0
bridge-stp off
bridge-fd 0
auto vmbr1
iface vmbr1 inet static
address 172.16.0.1/12
bridge-ports eth1
bridge-stp off
bridge-fd 0
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up iptables -t nat -A POSTROUTING -s 172.16.0.0/12 -o vmbr0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s 172.16.0.0/12 -o vmbr0 -j MASQUERADE
This is the SRV2 interfaces file:
auto lo
iface lo inet loopback
iface eth0 inet manual
iface eth1 inet manual
auto vmbr0
iface vmbr0 inet dhcp
bridge-ports eth0
bridge-stp off
bridge-fd 0
auto vmbr1
iface vmbr1 inet static
address 172.16.0.2/12
bridge-ports eth1
bridge-stp off
bridge-fd 0
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up iptables -t nat -A POSTROUTING -s 172.16.0.0/12 -o vmbr0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s 172.16.0.0/12 -o vmbr0 -j MASQUERADE
FILTER and NAT tables:
root@SRV2:/etc/network# iptables -t filter -S
-P INPUT ACCEPT
-P FORWARD ACCEPT
-P OUTPUT ACCEPT
root@SRV2:/etc/network# iptables -t nat -S
-P PREROUTING ACCEPT
-P INPUT ACCEPT
-P OUTPUT ACCEPT
-P POSTROUTING ACCEPT
-A POSTROUTING -s 172.16.0.0/12 -o vmbr0 -j MASQUERADE
-A POSTROUTING -s 172.16.0.0/12 -o vmbr0 -j MASQUERADE
I've installed a virtual machine (VM2) in SRV2 who has this configuration:
ETH0 (over vmbr1)
IP LAN 172.16.0.11
SUBNET MASK 255.254.0.0
GW 172.16.0.2
Ping testing:
From VM2 to 172.16.0.2 --> ok
From VM2 to 172.16.0.1 --> ok
From VM2 to 50.50.50.13 --> ok
From VM2 to 50.50.50.12 --> FAIL
From VM2 to www.google.com --> FAIL
Please, I need help with the configuration to connect the virtual machine to internet.
What’s the matter?
I’ve two dedicates servers in OVH (SRV1 and SRV2) each other with proxmox 6
I’ve activated a virtual rack (vRack OVH product) for build a LAN.
All the firewalls (dedicated servers, proxmox, virtual machines) are down (temporally).
Network configuration:
SRV1
ETH0
IP WAN SRV1: 50.50.50.12
GW SRV1: 50.50.50.254
ETH1
IP LAN SRV1: 172.16.0.1/12
SRV2
ETH0
IP WAN SRV2: 50.50.50.13
GW SRV2: 50.50.50.254
ETH1
IP LAN SRV2: 172.16.0.2/12
This is the SRV1 interfaces file:
auto lo
iface lo inet loopback
iface eth0 inet manual
iface eth1 inet manual
auto vmbr0
iface vmbr0 inet dhcp
bridge-ports eth0
bridge-stp off
bridge-fd 0
auto vmbr1
iface vmbr1 inet static
address 172.16.0.1/12
bridge-ports eth1
bridge-stp off
bridge-fd 0
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up iptables -t nat -A POSTROUTING -s 172.16.0.0/12 -o vmbr0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s 172.16.0.0/12 -o vmbr0 -j MASQUERADE
This is the SRV2 interfaces file:
auto lo
iface lo inet loopback
iface eth0 inet manual
iface eth1 inet manual
auto vmbr0
iface vmbr0 inet dhcp
bridge-ports eth0
bridge-stp off
bridge-fd 0
auto vmbr1
iface vmbr1 inet static
address 172.16.0.2/12
bridge-ports eth1
bridge-stp off
bridge-fd 0
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up iptables -t nat -A POSTROUTING -s 172.16.0.0/12 -o vmbr0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s 172.16.0.0/12 -o vmbr0 -j MASQUERADE
FILTER and NAT tables:
root@SRV2:/etc/network# iptables -t filter -S
-P INPUT ACCEPT
-P FORWARD ACCEPT
-P OUTPUT ACCEPT
root@SRV2:/etc/network# iptables -t nat -S
-P PREROUTING ACCEPT
-P INPUT ACCEPT
-P OUTPUT ACCEPT
-P POSTROUTING ACCEPT
-A POSTROUTING -s 172.16.0.0/12 -o vmbr0 -j MASQUERADE
-A POSTROUTING -s 172.16.0.0/12 -o vmbr0 -j MASQUERADE
I've installed a virtual machine (VM2) in SRV2 who has this configuration:
ETH0 (over vmbr1)
IP LAN 172.16.0.11
SUBNET MASK 255.254.0.0
GW 172.16.0.2
Ping testing:
From VM2 to 172.16.0.2 --> ok
From VM2 to 172.16.0.1 --> ok
From VM2 to 50.50.50.13 --> ok
From VM2 to 50.50.50.12 --> FAIL
From VM2 to www.google.com --> FAIL
Please, I need help with the configuration to connect the virtual machine to internet.
What’s the matter?