PDA

View Full Version : networking.service fails to bring up bidge interface: 'ifup: failed to bring up br0'



anoduck
2023-10-31, 00:02
Not a newb here. Been using Kali since it was Backtrack-3 at least.

I can setup a temporary bridge interface via the `ip` command stack.



#!/usr/bin/env bash

ip link add name br0 type bridge
ip link set dev br0 up
ip addr add 192.168.xx.xx/xx dev br0
ip route append default via 192.168.xx.xx dev br0
ip link set eth0 master br0
ip addr del 192.168.xx.xx/xx dev eth0
echo "DONE"


This works fine, but it is not persistent. In order to get persistence, I have to modify `/etc/network/interfaces`. Which is done as described in the debian documentation.



# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
iface eth0 inet manual

# Bridge network interface
auto br0
iface br0 inet static
address 192.168.xx.xx
network 192.168.x.xx
netmask 255.255.255.0
broadcast 192.168.xx.xx
gateway 192.168.xx.xx
dns-nameservers xxx.xx.xx.xx xx.xx.xx.xx
bridge_ports eth0
bridge_fd 5
bridge_stp off
bridge_vlan_aware yes
bridge_hw xx:xx:xx:xx:xx:xx
pre-up ip addr flush dev eth0


Yet, systemctl fails when asking it to restart the networking.service. The log states:



ifup[96060]: RTNETLINK answers: File exists
ifup[96008]: ifup: failed to bring up br0


This occurs whether the device is actually up or not. That is, if I set the br0 device to the down state, I will still receive the error
RTNETLINK answers: File exists.

What gives?