1. sudo apt-get install bridge-utils
2. brctl --help
Usage: brctl [commands]
commands:
addbr add bridge
delbr delete bridge
addif add interface to bridge
delif delete interface from bridge
hairpin {on|off} turn hairpin on/off
setageing set ageing time
setbridgeprio set bridge priority
setfd set bridge forward delay
sethello set hello time
setmaxage set max message age
setpathcost set path cost
setportprio set port priority
show [ ] show a list of bridges
showmacs show a list of mac addrs
showstp show bridge stp info
stp {on|off} turn stp on/off
3. 创建网桥
brctl addbr newbr
4. 将物理网卡1划入网桥
bectl addif newbr eth1
5. 取消物理网卡1的IP信息
ifconfig eth1 0.0.0.0
6. 分配IP地址给网桥
ifconfig newbr 3.242.164.147
linux 网桥的配置与实现