debian 桥接网卡设置方法

这里的方法的配置文件的方式.
手动命令行不太稳定: 配好了几个星期后回莫名其妙的消失了.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

# apt install bridge-utils


root@debian:~/bridge# cat /etc/network/interfaces
# 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

# 板载网卡
auto eno1
iface eno1 inet manual


# 桥接网卡
auto br0
iface br0 inet dhcp
hwaddress ether 98:90:96:d3:CD:AE
bridge_ports eno1

root@debian:~/bridge#

auto 永远启用网卡(dhcpclient 不退出)