0

I'm trying to convert a set of ip commands to a netplan configuration. I haven't had any luck so far, and I'm not sure why.

My script for creating the bridge is:

# Create the bridge
ip link add name br0 type bridge
ip link set dev br0 up

# Make eno1 the upstream connection for the bridge
ip link set eno1 master br0

# The brige needs an ip address. Give it a static one because I don't know how
# to give it one from dhcp
ip address add 192.168.1.2/24 dev br0
ip route add default via 192.168.1.1 dev br0

# Remove the old default root and eno1 roots. We'll send everything through br0.
ip route delete default via 192.168.1.1 dev eno1
ip route delete 192.168.1.0/24 dev eno1
ip route delete 192.168.1.1 dev eno1

And the netplan configuration that I'm working on is:

network:
  ethernets:
    eno1:
      dhcp4: true
    eno2:
      dhcp4: true
      optional: true
    eno3:
      dhcp4: true
      optional: true
    eno4:
      dhcp4: true
      optional: true
    enx0a94ef568c61:
      dhcp4: true
      optional: true
  bridges:
    br0:
      addresses:
        - 192.168.1.2/24
      interfaces:
        - eno1
      routes:
        - to: default
          via: 192.168.1.1
      nameservers:
        addresses:
          - 192.168.1.1
      parameters:
        forward-delay: 0
        stp: false
  version: 2

eno2-eno4 are unused (they're physical network interfaces).

The boot sequence stops--it's probably waiting for eno1 to get an ip address, and it never really comes. If I wait long enough, the boot will finish. When the boot finishes, I can ping the internet and local hosts. ip addr list shows that eno1 doesn't get an ip address.

I feel like my ip script has an implicit dependency on eno1 already having an ip address, and that my netplan configuration prevents eno1 from getting one.

Can anyone shed some light on what's going on?

Thanks for your help!

1
  • I've only added the br0 definition and added optional: true to the devices. When I ran the ip commands, eno1 already had a ip assigned by dhcp.
    – djshaw
    Commented Nov 7, 2023 at 15:15

0

You must log in to answer this question.

Browse other questions tagged .