Multiple IP4 Adresses on br0

I have installed KVM and Agorum (with Docker) in UCS 4.1-4

Now I will use a network software deployment tool. The IP Adress should be 192.168.100.254. The UCS Server (backupDC with all additional Apps of the network) has IP 192.168.100.92

If a add a new IP Adress to the br0 then the message came up:

br0: Mehrere IPv4 Adressen sind an diesem Gerät nicht unterstützt.

How can I now set the second IP-Adress?

Hey,

in general bridges support multiple IP addresses just fine, both IPv4 and IPv6. Here’s an example:

[0 mbunkus@chai-latte ~] brctl show
bridge name     bridge id               STP enabled     interfaces
clients         8000.1866da036f69       no              ecli
docker0         8000.02424e65ff93       no
[0 mbunkus@chai-latte ~] ip -4 a s dev clients
4: clients: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    inet 10.199.92.2/24 brd 10.199.92.255 scope global clients
       valid_lft forever preferred_lft forever
[0 mbunkus@chai-latte ~] sudo ip a a 192.168.1.2/24 dev clients
[0 mbunkus@chai-latte ~] ip -4 a s dev clients
4: clients: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    inet 10.199.92.2/24 brd 10.199.92.255 scope global clients
       valid_lft forever preferred_lft forever
    inet 192.168.1.2/24 scope global clients
       valid_lft forever preferred_lft forever

How did you try to set that second IP address? Can you post that command as well as the output of ip a, please?

Kind regards,
mosu

I try it to set via UCS-UI. I go to System - Network - i select the br0-NIC and press Edit.

Then I confirm the next Screen and the next Dialog show me the IP -Adresses. I put in 192.168.100.254 and press ok. Then I press the Save-Icon on the top Screen and now the message come up

Here the output of “ip a”

root@ucs100092:~# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master br0 state UP qlen 1000
    link/ether 38:d5:47:16:85:13 brd ff:ff:ff:ff:ff:ff
3: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP
    link/ether 38:d5:47:16:85:13 brd ff:ff:ff:ff:ff:ff
    inet 192.168.100.92/24 brd 192.168.100.255 scope global br0
       valid_lft forever preferred_lft forever
    inet6 fe80::3ad5:47ff:fe16:8513/64 scope link
       valid_lft forever preferred_lft forever
4: vnet0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master br0 state UNKNOWN qlen 500
    link/ether fe:54:00:0b:fc:48 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::fc54:ff:fe0b:fc48/64 scope link
       valid_lft forever preferred_lft forever
5: docker0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN
    link/ether 2a:68:10:48:eb:03 brd ff:ff:ff:ff:ff:ff
    inet 172.17.42.1/16 scope global docker0
       valid_lft forever preferred_lft forever
    inet 192.168.100.253/24 brd 192.168.100.255 scope global docker0:0
       valid_lft forever preferred_lft forever
    inet6 fe80::2868:10ff:fe48:eb03/64 scope link
       valid_lft forever preferred_lft forever

Hey,

I see, and yes, I can reproduce this. It’s not a generic limitation of the kernel, but rather a limitation of the current way that network interface configuration is stored in the Config Registry. See this bug for more details. The Univention Management Console is simply preventing you from running an error there due to that limitation.

You could implement a workaround by modifying how the script /etc/network/interfaces is generated. Fortunately the template that generates that file supports adding arbitrary options at the end of the iface block by setting appropriate UCR variables. For example, in a bridge configuration you already have two of those:

interfaces/br0/options/0: bridge_fd 0
interfaces/br0/options/1: bridge_ports eth0

You could add another one that uses the up keyword to execute the command that adds the IP address, e.g.:

ucr set interfaces/br0/options/2='up /sbin/ip address add 192.168.100.254/24 dev br0'

Attention: the act of setting this variable not only triggers rebuilding the generated file /etc/network/interfaces but also an immediate restart of the networking.

Note that it’s quite possible that such a manual modification will be lost as soon as you re-configure the interface via the Management Console. I advice that you actually give this a try: set the UCR variable, verify the address is present, go to the UMC, modify the interface somehow, and observe how that affects both the UCR variable and the generated interfaces file.

Kind regards,
mosu

Mastodon