Issues with multiple IPs on single nic.

Amplificator

Member
Aug 5, 2020
21
2
8
37
Hi, I'm having some issues with multiple IPs (on the same subnet) with a single NIC.

I have a similar setup on a couple of other servers that work just fine, but this one doesn't for some reason. The others are using Proxmox 6.x and this one is using 7.x so maybe that has something to do with it?

My current attempt of setting it up looks like this:

Code:
auto lo
iface lo inet loopback

auto enp0s31f6
iface enp0s31f6 inet static
        address AAA.BBB.CCC.111
        netmask 255.255.255.192
        gateway AAA.BBB.CCC.1
        pointopoint AAA.BBB.CCC.1

auto vmbr0
iface vmbr0 inet static
        address AAA.BBB.CCC.111
        netmask 255.255.255.192
        bridge_ports none
        bridge_stp off
        bridge_fd 0
        bridge_maxwait 0
        pre-up brctl addbr virbr0
        post-up ip route add AAA.BBB.CCC.222/32 dev vmbr0
        post-down ip route del AAA.BBB.CCC.222/32 dev vmbr0
        post-up ip route add AAA.BBB.CCC.333/32 dev vmbr0
        post-down ip route del AAA.BBB.CCC.333/32 dev vmbr0

As I said, all the IPs are on the same subnet and the exact same thing works on other servers which why I can't figure out why it won't work now.

Any ideas?
 
Code:
iface enp0s31f6 inet static
        address AAA.BBB.CCC.111
        netmask 255.255.255.192
        gateway AAA.BBB.CCC.1

Really? ".1" is not in that network as Adresses for mask ".192" will go from ".65" to ".126"

Code:
~$ ipcalc 192.0.2.111/26
Address:   192.0.2.111          11000000.00000000.00000010.01 101111
Netmask:   255.255.255.192 = 26 11111111.11111111.11111111.11 000000
Wildcard:  0.0.0.63             00000000.00000000.00000000.00 111111
=>
Network:   192.0.2.64/26        11000000.00000000.00000010.01 000000
HostMin:   192.0.2.65           11000000.00000000.00000010.01 000001
HostMax:   192.0.2.126          11000000.00000000.00000010.01 111110
Broadcast: 192.0.2.127          11000000.00000000.00000010.01 111111
Hosts/Net: 62                    Class C

And: if you put an IP-Adress on vmbr0 (which is fine) do NOT assign it to the NIC too - remove it from enp0s31f6.


Good luck
 
Code:
iface enp0s31f6 inet static
        address AAA.BBB.CCC.111
        netmask 255.255.255.192
        gateway AAA.BBB.CCC.1

Really? ".1" is not in that network as Adresses for mask ".192" will go from ".65" to ".126"

And: if you put an IP-Adress on vmbr0 (which is fine) do NOT assign it to the NIC too - remove it from enp0s31f6.


Good luck
111, 222 and 333 are just placeholders for the actual IPs provided by my host, Hetzner.

If I change the line

Code:
iface enp0s31f6 inet static
to
Code:
iface enp0s31f6 inet manual

and add the gateway for the bridge, I get no connection to the main IP?