The Linux network card is set to bridge mode 1. Add a network card and modify the associated Profile 1.1 virtual machine add NIC and configure related files
such as: eth2 for new add NIC
Cd/etc/sysconfig/network-scripts
CP Ifcfg-eth1 Ifcfg-eth2
VI ifcfg-eth2
Type=ethernet
Bootproto=none
Defroute=yes
Peerdns=yes
Peerroutes=yes
Ipv4_failure_fatal=no
Ipv6init=yes
Ipv6_autoconf=yes
Ipv6_defroute=yes
Ipv6_peerdns=yes
Ipv6_peerroutes=yes
Ipv6_failure_fatal=no
Name=eth2 # # #此处修改为eth2
#UUID =ea571b82-4ad0-4a1b-b831-a90fe5a682f5 Log off this line
Device=eth2 # # #修改为eth2
Onboot=yes
BRIDGE=BR1 # # #网桥设置为br1
VI IFCFG-BR1
Type=bridge
Defroute=yes
Peerdns=yes
Peerroutes=yes
Ipv4_failure_fatal=no
Ipv6init=no
Ipv6_autoconf=yes
Ipv6_defroute=yes
Ipv6_peerdns=yes
Ipv6_peerroutes=yes
Ipv6_failure_fatal=no
Name=br1
Device=br1
Onboot=yes
ipaddr=172.16.4.8
netmask=255.255.255.0
gateway=172.16.4.254
# # #根据需要设置ip或者不设置
2. Installing the Bridge Tool 2.1 installation Bridge-utils
Yum-y Install Bridge-utils
3. Activating eth2, BR1 and detecting 3.1 activating eth2, BR1
Ifup eth2
Ifup BR1
3.2 Test Results
IP addr
4:eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> MTU Qdisc pfifo_fast Qlen 1000
Link/ether 00:50:56:83:FF:CB BRD FF:FF:FF:FF:FF:FF
11:BR1: <BROADCAST,MULTICAST,UP,LOWER_UP> MTU Qdisc Noqueue
Link/ether 00:50:56:83:FF:CB BRD FF:FF:FF:FF:FF:FF
inet 172.16.4.8/24 BRD 172.16.4.255 Scope Global BR1
# # #发现两者mac地址相同, and IP can ping through
[[Email protected]***]# brctl Show
Bridge name Bridge ID STP enabled interfaces
BR1 8000.00505683FFCB No eth2
The Linux network card is set to bridge mode