Build Vxlan environment with CentOS Linux Bridge

Source: Internet
Author: User

One 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

RPM-UVH Http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpmyum--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:

#创建网桥br-VX and make it upbrctl addbr BR-VXIP link Set br-vx up# add a virtual network card of type Vxlan,vni-id 100 with the name Vxlan10, indicating that the peer address is 192.168.233.190 , # (this address is VM2 's eth2 address) out interface for the ETH2IP link add vxlan10 type Vxlan ID of the remote 192.168.233.190 dstport 4789 dev eth2ip link se T vxlan10 up# add vxlan10 to the bridge brctl addif br-vx vxlan10# Create a pair of virtual network cards, set the Veth0 address to 192.167.1.6, and bind the veth1 to the bridge BR-VX. Messages sent from veth0# will be sent to Veth1, as veth1 in the bridge will be entered into VXLAN10 via the Vxlan Tunnel sent to the peer IP link Add type vethifconfig veth0 192.167.1.6/24 Upifconfig Veth0 MTU 1450ifconfig veth1 upifconfig veth1 MTU 1450brctl addif BR-VX veth1


VM2:
#创建网桥br-VX and make it upbrctl addbr BR-VXIP link Set br-vx up# add a virtual network card of type Vxlan,vni-id 100 with the name Vxlan10, indicating that the peer address is 192.168.233.180 , # (this address is VM2 's eth2 address) out interface for the ETH2IP link add vxlan10 type Vxlan ID of the  remote 192.168.233.180 dstport 4789 Dev Eth2ip Lin K Set Vxlan10 up# add Vxlan10 to the bridge brctl addif br-vx vxlan10# Create a pair of virtual network cards, set the address of the Veth0 to 192.167.1.7, and bind the veth1 to the bridge BR-VX. Messages sent from veth0# will be sent to Veth1, as veth1 in the bridge will be entered into VXLAN10 via the Vxlan Tunnel sent to the peer IP link Add type vethifconfig veth0 192.167.1.7/24 Upifconfig Veth0 MTU 1450ifconfig veth1 upifconfig veth1 MTU 1450brctl addif BR-VX veth1


Four Verify
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.



Building a Vxlan environment using 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.