The Linux network card is set to bridge mode

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.