[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: networking.service fails



    Hi.

On Mon, Apr 11, 2022 at 01:48:35AM +0200, Dmitry Katsubo wrote:
> The configuration is trivial: it adds both eth0 eth1 to the bridge
> br0.
>
> === cut /etc/network/interfaces ===
> auto lo
> auto eth0
> auto eth1
>
> iface lo inet loopback
>
> auto br0
> iface br0 inet static
>         address 10.0.1.100
>         gateway 10.0.1.1
>         netmask 255.0.0.0
>         bridge_ports eth0 eth1
>         bridge_maxwait 60
> === cut ===

Good news - it explains "ifup: unknown interface eth0" messages.
Bad news - this /e/n/i is not valid.

The reason being - both eth0 and eth1 lack interface definitions, i.e.
have no "iface" stanzas.

If you absolutely need both eth0 and eth1 in the UP state by the time
you create and bring up br0 you should either:

1) Define both eth0 and eth1 in /e/n/i like this:

auto eth0
iface eth0 inet manual

auto eth1
iface eth1 inet manual

auto br0
iface br0 inet static
    address 10.0.1.100
    gateway 10.0.1.1
    netmask 255.0.0.0
    bridge_ports eth0 eth1
    bridge_maxwait 60

2) Use pre-up and post-down hooks for br0, and remove both "auto eth0"
and "auto eth1":

auto br0
iface br0 inet static
    address 10.0.1.100
    gateway 10.0.1.1
    netmask 255.0.0.0
    bridge_ports eth0 eth1
    bridge_maxwait 60
    pre-up /sbin/ip link set eth0 up
    pre-up /sbin/ip link set eth1 up
    post-down /sbin/ip link set eth0 down
    post-down /sbin/ip link set eth1 down

Reco


Reply to: