Network configuration - Single public address

oqp2

Member
Nov 30, 2020
1
0
6
31
Hi all,

When first installing proxmox I used the default network config (I have a single public IP) :

Code:
auto lo
iface lo inet loopback

iface eno1 inet manual

auto vmbr0
iface vmbr0 inet static
        address 142.X.X.X
        netmask 255.255.255.0
        gateway 142.X.X.1
        bridge-ports eno1
        bridge-stp off
        bridge-fd 0

Then, I wanted to go for the routed one and masquerading (so as to allow my VM to access internet and build a local network) :

Code:
auto lo
iface lo inet loopback

auto eno1
#real IP address
iface eno1 inet static
        address  142.X.X.X
        netmask  255.255.255.0
        gateway  142.X.X.1

auto vmbr0
#private sub network
iface vmbr0 inet static
        address  192.168.0.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 '192.168.0.0/24' -o eno1 -j MASQUERADE
        post-down iptables -t nat -D POSTROUTING -s '192.168.0.0/24' -o eno1 -j MASQUERADE

But as soon as I switch from the vmbr0 bridge to the eno1 for the public IP, it doesn't work (no access to the server and not able to ping anything when using the server CLI).

Anyone having an idea about that ? (I'm still a beginner concerning proxmox so maybe I'm missing something ..)

Thanks.
 
Last edited:
hi,

maybe you're missing routes?

can you try:

Code:
auto eno1
#real IP address
iface eno1 inet static
        address  142.X.X.X
        netmask  255.255.255.0
        gateway  142.X.X.1
        up route add -net <net> netmask <netmask> gw <gateway> dev eno1