[SOLVED] Hetzner Proxmox /etc/network/interfaces for public and private ip

ropiecin

Member
May 7, 2015
9
0
21
applying the following configuration

auto lo
iface lo inet loopback

iface enp2s0 inet manual

auto vmbr0
iface vmbr0 inet static
address [public IP]
hwaddress 44:XX:5X:DX:8X:20
netmask 255.255.255.255
pointopoint [public gateway IP]
gateway [public gateway IP]
bridge-ports enp2s0
bridge-stp off
bridge-fd 1

auto vmbr10
iface vmbr10 inet static
address 10.10.10.1
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

public network is working but the private network 10.10.10.0 doen't go outside to internet

where is the mistake?
someone can pls help me in order to solve?
 

bobmc

Well-Known Member
May 17, 2018
600
96
48
65
That all looks fine to me - I have a similar setup on one of my servers
Code:
auto lo
iface lo inet loopback

iface enp3s0f0 inet manual

auto vmbr0
iface vmbr0 inet static
        address xxx.xxx.xxx.162/24
        gateway xxx.xxx.xxx.254
        bridge-ports enp3s0f0
        bridge-stp off
        bridge-fd 0

auto vmbr1
iface vmbr1 inet static
        address 10.0.0.1/24
        bridge-ports none
        bridge-stp off
        bridge-fd 0

auto vmbr2
iface vmbr2 inet static
        address 10.0.10.1/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 '10.0.0.1/24' -o vmbr0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '10.0.0.1/24' -o vmbr0 -j MASQUERADE
post-up   iptables -t nat -A POSTROUTING -s '10.0.10.1/24' -o vmbr0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '10.0.10.1/24' -o vmbr0 -j MASQUERADE
post-up   iptables -t nat -A PREROUTING -p tcp --dport 3389 -j DNAT --to 10.0.10.11:3389
post-down iptables -t nat -A FORWARD -p tcp --dport 3389 -j ACCEPT

The only obvious difference I can see is you have bridge-fd 1 where the default is bridge-fd 0

I assume that you have restarted the networking after making changes?
 
Last edited:

ropiecin

Member
May 7, 2015
9
0
21
hi Bob and thanks for your answer!

what is the gateway using on client on vmbr1 and vmbr2?
 

bobmc

Well-Known Member
May 17, 2018
600
96
48
65
clients use either 10.0.0.1 or 10.0.10.1 as their gateway
 

bobmc

Well-Known Member
May 17, 2018
600
96
48
65
Ahh you need to amend your iptables config as follows
post-up iptables -t nat -A POSTROUTING -s ’10.10.10.1/24’ -o vmbr0 -j MASQUERADE post-down iptables -t nat -D POSTROUTING -s ’10.10.10.1/24’ -o vmbr0 -j MASQUERADE
 

ropiecin

Member
May 7, 2015
9
0
21
hi Bob,
quotes are invalid! The right one is the following:
iptables -t nat -A POSTROUTING -s '10.10.10.1/24' -o vmbr0 -j MASQUERADE

Now it's working fine!!!
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get your own in 60 seconds.

Buy now!