/etc/network/interfaces中使用以下配置与Ubuntu建立虚拟网桥

auto brOffline
iface brOffline inet static
 address 192.168.5.10
 netmask 255.255.255.0
 bridge_ports eth11
 bridge_stp off
 bridge_fd 0.0
 pre-up ifdown eth11
 pre-up ifup eth11
 post-down ifdown eth11


代码:创建网桥接口。每个网桥都需要一个适配器,这里是我的物理网卡eth11。为确保其正常工作,请重新启动和关闭接口。

导致网络服务重新启动...

service networking restart
service networking status


...显示类似的错误

 ifup[2304]: Cannot find device "brOnline"
 dhclient[2330]: Error getting hardware address for "brOffline": No such device


如果您的接口被称为标准br0,则听起来像:

 default:
 Error getting hardware address for "br0": No such device

最佳答案

未安装网桥工具

我从一个系统迁移到另一个。目标操作系统是新安装的17.10。所缺少的是桥接工具:

sudo apt-get install -y bridge-utils


由于缺少工具,因此无法创建网桥...

现在ifconfig显示了我闪亮的桥

brOffline: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
    inet 192.168.5.10  netmask 255.255.255.0  broadcast 192.168.5.255
    inet6 fe80::6a05:caff:fe51:8eff  prefixlen 64  scopeid 0x20<link>
    ether 68:05:ca:51:8e:ff  txqueuelen 1000  (Ethernet)
    RX packets 2  bytes 501 (501.0 B)
    RX errors 0  dropped 0  overruns 0  frame 0
    TX packets 107  bytes 10316 (10.3 KB)
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0


Hint which helped me to find the solution

07-24 14:00