Score:0

How to create multiple IP Addresses on a bonded interface with Netplan?

eg flag

Edit: This may not be possible. According to the Netplan Docs, aliasing cannot be implemented. If it can't, I suppose I will need to come up with another solution (e.g. use the old interfaces method).

Edit 2: Without using netplan try, and just netplan apply, I'm able to have multiple IP addresses with the same bonded interface (see config below). I will answer my question now.

I am trying to implement a netplan setup with something similar to this old /etc/network/interfaces setup:

em1       Link encap:Ethernet  HWaddr 12:34:56:78:90:12  
          inet addr:192.168.66.120  Bcast:192.168.127.255  Mask:255.255.192.0
          inet6 addr: 1234:1234:1234:1234/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:121492924671 errors:0 dropped:4395640 overruns:0 frame:3517
          TX packets:80073661297 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:112218751342378 (112.2 TB)  TX bytes:26536012742300 (26.5 TB)
          Interrupt:16 

em1:1     Link encap:Ethernet  HWaddr 12:34:56:78:90:12  
          inet addr:192.168.67.120  Bcast:192.168.127.255  Mask:255.255.192.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Interrupt:16 

em1:2     Link encap:Ethernet  HWaddr 12:34:56:78:90:12  
          inet addr:192.168.67.121  Bcast:192.168.127.255  Mask:255.255.192.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Interrupt:16 

em1:3     Link encap:Ethernet  HWaddr 12:34:56:78:90:12  
          inet addr:192.168.67.122  Bcast:192.168.127.255  Mask:255.255.192.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Interrupt:16 

em1:4     Link encap:Ethernet  HWaddr 12:34:56:78:90:12  
          inet addr:192.168.67.123  Bcast:192.168.127.255  Mask:255.255.192.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Interrupt:16 

em1:5     Link encap:Ethernet  HWaddr 12:34:56:78:90:12  
          inet addr:192.168.67.124  Bcast:192.168.127.255  Mask:255.255.192.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Interrupt:16 

However, it appears my syntax is wrong. I have 2 nics on a server, and I'm trying to create multiple IP Addresses on the bond. However, when I use netplan try, it tells me:

bond0: reverting custom parameters for bridges and bonds is not supported

network:
    bonds:
        bond0:
            addresses: 
            - 192.168.66.121/18
            - 192.168.67.125/18
            - 192.168.67.126/18
            - 192.168.67.127/18
            - 192.168.67.128/18
            - 192.168.67.129/18
            gateway4: 192.168.64.1
            interfaces:
            - eno1
            - eno2
            nameservers:
                addresses:
                - 192.168.3.222
                - 192.168.70.80
            parameters:
                mode: active-backup
                mii-monitor-interval: 100
    ethernets:
        eno1: {}
        eno2: {}
    version: 2

Where should the other IP Addresses be placed if it's bonded?

Score:0
eg flag

This config is working. I did not use aliases. Instead, I just used individual IP addresses, created a test firewall policy, and all is well it seems.

Here is the working config:

network:
    bonds:
        bond0:
            addresses:
            - 192.168.66.121/18
            - 192.168.67.125/18
            - 192.168.67.126/18
            - 192.168.67.127/18
            - 192.168.67.128/18
            - 192.168.67.129/18
            gateway4: 192.168.64.1
            interfaces:
            - eno1
            - eno2
            nameservers:
                addresses:
                - 192.168.3.222
                - 192.168.70.80
            parameters:
                mode: active-backup
                primary: eno1
                mii-monitor-interval: 100
    ethernets:
        eno1: {}
        eno2: {}
    version: 2
    renderer: networkd
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.