1

I installed ubuntu 18.04, I trying to configure bond interface

network:
   bonds:
       bond0:
           addresses: [10.11.6.119/24]
           gateway4: 10.11.6.1
           nameservers:
              addresses: [8.8.8.8,8.8.4.4]
           interfaces:
           - ens192
           - ens160
           parameters:
               lacp-rate: fast
               mode: 802.3ad
               transmit-hash-policy: layer2
       ethernets:
           ens160:
               addresses: []
               dhcp4: false
               dhcp6: false
           ens192:
               addresses: []
               dhcp4: false
               dhcp6: false
version: 2

I see the following error after applying the settings

root@admin:~# netplan apply
Error in network definition /etc/netplan/50-cloud-init.yaml line 8 column 13: bond0: interface ens192 is not defined

But ens192 exist:

    root@admin:~# ip link show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: ens160: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether 00:50:56:94:b5:21 brd ff:ff:ff:ff:ff:ff
3: ens192: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether 00:50:56:94:c0:d2 brd ff:ff:ff:ff:ff:ff

Please tell me what I'm doing wrong. I'm a newbie.

  • 1
    I think the lines following interfaces: should be indented. – Jos Mar 28 at 9:38
  • I wrote 'interfaces: [ens160, ens192]' as follows. The result is the same – Ayrat Mar 28 at 10:13
0

Comments do not allow me to format this well, so I present this as a preliminary answer. I indented (moved to the right) the two lines with the names of the interfaces. Also, I think the last line version: 2 ought to be indented.

network:
   bonds:
       bond0:
           addresses: [10.11.6.119/24]
           gateway4: 10.11.6.1
           nameservers:
              addresses: [8.8.8.8,8.8.4.4]
           interfaces:
               - ens192                    <--- changed
               - ens160                    <--- changed
           parameters:
               lacp-rate: fast
               mode: 802.3ad
               transmit-hash-policy: layer2
       ethernets:
           ens160:
               addresses: []
               dhcp4: false
               dhcp6: false
           ens192:
               addresses: []
               dhcp4: false
               dhcp6: false
    version: 2                            <--- changed
  • Thank you, the problem was really in lines. – Ayrat Mar 28 at 11:13
  • I think the ethernets block needs to have the same indent level as the bonds block rather than the bond0 block. – Dennis Williamson Mar 28 at 18:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.