CentOS 7 网卡配置网桥

本文最后更新于:2022年6月1日 下午

1 编辑网卡bridge配置文件

1
2
3
4
5
6
7
8
9
10
11
12
13
[root@test ~]# vim /etc/sysconfig/network-scripts/ifcfg-br0

DEVICE=br0
TYPE=Bridge
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
IPADDR=10.0.0.230
NETMASK=255.255.240.0
GATEWAY=10.0.0.130
DNS1=8.8.8.8
IPV6INIT=no
USERCTL=no

2 编辑需要bridge的网口配置

1
2
3
4
5
6
7
8
9
10
[root@test ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth4

DEVICE=eth4
HWADDR=90:e2:ba:f1:45:4c # 注意此处的mac地址需要与原本ip a的一样
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=no
USERCTL=no
BRIDGE=br0

3 重启网络

1
[root@test ~]# systemctl restart network

4 查看网桥

1
[root@test ~]# brctl show

CentOS 7 网卡配置网桥
https://simple2ich4n.top/33371/
作者
2ich4n
发布于
2022年5月20日
更新于
2022年6月1日
许可协议