cen tos8桥接配置网络
时间: 2023-06-22 16:25:11 浏览: 247
在 CentOS 8 中配置桥接网络可以按照以下步骤进行:
1. 禁用 NetworkManager 服务:
```
systemctl stop NetworkManager
systemctl disable NetworkManager
```
2. 安装 bridge-utils 工具:
```
yum install bridge-utils
```
3. 编辑网络配置文件:
```
vi /etc/sysconfig/network-scripts/ifcfg-ens33
```
其中,ens33 是网卡名称,根据实际情况进行修改。将文件中的内容修改为如下:
```
TYPE=Ethernet
BOOTPROTO=none
NAME=ens33
DEVICE=ens33
ONBOOT=yes
BRIDGE=br0
```
4. 创建桥接网络配置文件:
```
vi /etc/sysconfig/network-scripts/ifcfg-br0
```
将文件中的内容修改为如下:
```
TYPE=Bridge
BOOTPROTO=none
NAME=br0
DEVICE=br0
ONBOOT=yes
IPADDR=192.168.1.100
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
DNS1=8.8.8.8
DNS2=8.8.4.4
```
其中,IPADDR、NETMASK、GATEWAY、DNS1、DNS2 根据实际情况进行修改。
5. 重启网络服务:
```
systemctl restart network
```
完成上述步骤后,CentOS 8 的网络就配置好了桥接模式。
阅读全文
相关推荐

















