Build Vxlan environment with CentOS Linux Bridge

Source: Internet
Author: User

First, the basic environment
Use VMware virtual two Linux machines. The CentOS 7,linux kernel is as follows:
4.5.3-1.el7.elrepo.x86_64
If the kernel version is too low, Vxlan is not supported. Kernel upgrades can be done with commands

RPM--import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org

[Plain]View PlainCopy 
    1. RPM-UVH http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
    2. Yum--enablerepo=elrepo-kernel Install Kernel-ml-devel kernel-ml-y


Reboot to select New kernel after upgrade.

Second, the group Network Diagram

Two virtual machines VM1 and vm2,eth2 are network cards on the virtual machine. VXLAN10 is a virtual network card that is created to handle Vxlan. Veth1 and Veth0 are a pair of virtual ports that are created. BR-VX is the network bridge that is created.
Third, configuration commands
VM1:

[HTML]View PlainCopy 
  1. #创建网桥br-VX and make it up
  2. Brctl ADDBR BR-VX
  3. IP link Set br-vx up
  4. #增加一个类型为vxlan, the Vni-id is a virtual network card with the name Vxlan10 of 100, indicating that the peer address is 192.168.233.190,
  5. # (The address of this address is VM2 eth2) out interface is the eth2 of the local side
  6. IP link Add vxlan10 type Vxlan ID remote 192.168.233.190 dstport 4789 Dev eth2
  7. IP link Set vxlan10 up
  8. #把vxlan10加入到网桥中
  9. Brctl addif BR-VX Vxlan10
  10. #创建一对虚拟网卡, set the address of the Veth0 to 192.167.1.6, and tie the veth1 to the bridge BR-VX. From Veth0
  11. #发出的报文将会发给veth1, because Veth1 is in the bridge, it is entered into vxlan10 and sent to the peer through the Vxlan tunnel.
  12. IP link Add type Veth
  13. Ifconfig Veth0 192.167.1.6/24 up
  14. Ifconfig Veth0 MTU 1450
  15. Ifconfig veth1 up
  16. Ifconfig veth1 MTU 1450
  17. Brctl addif BR-VX veth1



VM2:

[HTML]View PlainCopy 
  1. #创建网桥br-VX and make it up
  2. Brctl ADDBR BR-VX
  3. IP link Set br-vx up
  4. #增加一个类型为vxlan, the Vni-id is a virtual network card with the name Vxlan10 of 100, indicating that the peer address is 192.168.233.180,
  5. # (The address of this address is VM2 eth2) out interface is the eth2 of the local side
  6. IP link Add vxlan10 type Vxlan ID remote 192.168.233.180 dstport 4789 Dev eth2
  7. IP link Set vxlan10 up
  8. #把vxlan10加入到网桥中
  9. Brctl addif BR-VX Vxlan10
  10. #创建一对虚拟网卡, set the address of the Veth0 to 192.167.1.7, and tie the veth1 to the bridge BR-VX. From Veth0
  11. #发出的报文将会发给veth1, because Veth1 is in the bridge, it is entered into vxlan10 and sent to the peer through the Vxlan tunnel.
  12. IP link Add type Veth
  13. Ifconfig Veth0 192.167.1.7/24 up
  14. Ifconfig Veth0 MTU 1450
  15. Ifconfig veth1 up
  16. Ifconfig veth1 MTU 1450
  17. Brctl addif BR-VX veth1



Iv. Verification
After building, you can use the ping command on the VM1 to verify: Vm1:ping 192.167.1.7, through the tcpdump grasp the message to see the structure.

Reference article: http://blog.csdn.net/xingyeping/article/details/51353321

Build Vxlan environment with CentOS Linux Bridge

Related Article

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.