[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-bro-test 
DEVICE="br0"
ONBOOT="yes"
TYPE="Bridge"
BOOTPROTO=static
IPADDR=172.16.1.80
NETMASK=255.255.255.0

 重启网络,发现网卡

[root@localhost ~]# ifconfig 
br0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 172.16.1.80  netmask 255.255.255.0  broadcast 172.16.1.255
        inet6 fe80::fc54:ff:febb:58c5  prefixlen 64  scopeid 0x20<link>
        ether fe:54:00:bb:58:c5  txqueuelen 1000  (Ethernet)
        RX packets 59  bytes 8920 (8.7 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 14  bytes 1766 (1.7 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

 kvm 可以新建网卡,选择br0 

 虚拟机也产生新的网卡

[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens10 
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=ens10
UUID=6ba22e94-9a7e-48df-9b08-9500eb19274b
DEVICE=ens10
ONBOOT=yes
IPADDR=172.16.1.12
PREFIX=24

重启网络 

可以看到网络以打通

 

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐