Two-card bridging under Ubuntu

Source: Internet
Author: User

1. Install the Brctl tool sudo apt-get install BRIDGE-UTILS2. Add Bridge # brctl ADDBR br0 #创建桥接 br0# brctl addif br0 eth0 eth1 #添加 eth0, eth1 to br0# ifconfig br0 192.168.1.1 netmask 255.255.2 55.0 broadcast 192.168.1.255 UP3. Turn on IP forwarding sudo vim/etc/sysctl.confnet.ipv4.ip_forward=1 remove the comment before the line #sudo sysctl-p/etc/sysctl.conf file immediately takes effect 3. Modify Configuration Vim/etc/network/interfacesauto lo br0iface lo inet loopbackauto eth0iface eth0 inet manualauto eth1iface eth1 inet ma Nualiface br0 inet dhcpbridge_ports eth0 eth1 or using static IP iface br0 inet staticbridge_ports eth0 eth1address 192.168.1.2broad Cast 192.168.1.255netmask 255.255.255.0gateway 192.168.1.1 4. To restart the machine instance configuration:

[Email protected]:~# cat/etc/network/interfaces
# interfaces (5) file used by Ifup (8) and Ifdown (8)
Auto Lo br0
Iface Lo inet Loopback
Auto Enp4s0
Iface Enp4s0 inet Manual
Auto enx000ec6d22489
Iface enx000ec6d22489 inet Manual
Iface br0 inet Static
Bridge_ports Enp4s0 enx000ec6d22489
Address 192.168.4.147
Broadcast 192.168.4.255
Netmask 255.255.255.0
Gateway 192.168.4.1
Dns-nameservers 114.114.114.114

[Email protected]:~# ifconfig
BR0 Link ENCAP: Ethernet Hardware Address 00:0e:c6:d2:24:89
inet Address: 192.168.4.147 Broadcast: 192.168.4.255 Mask: 255.255.255.0
Inet6 Address: fe80::20e:c6ff:fed2:2489/64 Scope:link
Up broadcast RUNNING multicast mtu:1500 hop count: 1
Receive packet: 26213 Error: 0 Discard: 0 Overload: 0 Number of frames: 0
Send packet: 13242 error: 0 Discard: 0 Overload: 0 Carrier: 0
Collisions: 0 Send Queue Length: 1000
Receive bytes: 33057941 (33.0 MB) Send bytes: 1009375 (1.0 MB)

ENP4S0 Link ENCAP: Ethernet Hardware Address c8:5b:76:96:54:8d
Up broadcast RUNNING multicast mtu:1500 hop count: 1
Receive packet: 47984 Error: 0 Discard: 2 Overload: 0 Number of frames: 0
Send packet: 14024 error: 0 Discard: 47 Overload: 0 Carrier: 0
Collisions: 0 Send Queue Length: 1000
Receive bytes: 35367800 (35.3 MB) Send bytes: 1116775 (1.1 MB)

enx000ec6d22489 Link ENCAP: Ethernet Hardware Address 00:0e:c6:d2:24:89
Up broadcast multicast mtu:1500 metric: 1
Receive packets: 0 Error: 0 Discard: 0 Overload: 0 Number of frames: 0
Send packet: 0 Error: 0 Discard: 0 Overload: 0 Carrier: 0
Collisions: 0 Send Queue Length: 1000
Bytes Received: 0 (0.0 B) Send bytes: 0 (0.0 B)

Two-card bridging under Ubuntu

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.