# ip link add vx0 type vxlan id 100 local 1.1.1.1 remote 2.2.2.2 dev eth0 dstport 4789įor reference, you can read the VXLAN kernel documentation or this VXLAN introduction. VXLAN is typically deployed in data centers on virtualized hosts, which may be spread across multiple racks. VXLAN encapsulates Layer 2 frames with a VXLAN header into a UDP-IP packet, which looks like this: With a 24-bit segment ID, aka VXLAN Network Identifier (VNI), VXLAN allows up to 2^24 (16,777,216) virtual LANs, which is 4,096 times the VLAN capacity. VXLAN (Virtual eXtensible Local Area Network) is a tunneling protocol designed to solve the problem of limited VLAN IDs (4,096) in IEEE 802.1q. Note: When configuring a VLAN, you need to make sure the switch connected to the host is able to handle VLAN tags, for example, by setting the switch port to trunk mode. This adds VLAN 2 with name eth0.2 and VLAN 3 with name eth0.3. # ip link add link eth0 name eth0.3 type vlan id 3 # ip link add link eth0 name eth0.2 type vlan id 2 Use a VLAN when you want to separate subnet in VMs, namespaces, or hosts. VLANs allow network administrators to group hosts under the same switch or between different switches. It's another failover master net device for virtualization and manages a primary ( passthru/VF device) slave net device and a standby (the original paravirtual interface) slave net device.Ī VLAN, aka virtual LAN, separates broadcast domains by adding tags to network packets.
This creates a team interface named team0 with mode active-backup, and it adds eth0 and eth1 as team0's sub-interfaces.Ī new driver called net_failover has been added to Linux recently. Use a team when you want to use some features that bonding doesn't provide. For further details about the differences between bonding and team, see Bonding vs. For example, a team supports LACP load-balancing, NS/NA (IPV6) link monitoring, D-Bus interface, etc., which are absent in bonding. What it does is to solve the same problem using a different approach, using, for example, a lockless (RCU) TX/RX path and modular design.īut there are also some functional differences between a bonded interface and a team. The main thing to realize is that a team device is not trying to replicate or mimic a bonded interface. Similar a bonded interface, the purpose of a team device is to provide a mechanism to group multiple NICs (ports) into one logical one (teamdev) at the L2 layer. For other modes, please see the kernel documentation. This creates a bonded interface named bond1 with mode active-backup. Ip link add bond1 type bond miimon 100 mode active-backup Use a bonded interface when you want to increase your link speed or do a failover on your server.
The behavior of the bonded interface depends on the mode generally speaking, modes provide either hot standby or load balancing services. The Linux bonding driver provides a method for aggregating multiple network interfaces into a single logical "bonded" interface. This creates a bridge device named br0 and sets two TAP devices ( tap1, tap2), a VETH device ( veth1), and a physical device ( eth0) as its slaves, as shown in the diagram above.
Use a bridge when you want to establish communication channels between VMs, containers, and your hosts. It also supports STP, VLAN filter, and multicast snooping. It's usually used for forwarding packets on routers, on gateways, or between VMs and network namespaces on a host. It forwards packets between interfaces that are connected to it.
VXLAN (Virtual eXtensible Local Area Network)Īfter reading this article, you will know what these interfaces are, what's the difference between them, when to use them, and how to create them.įor other interfaces like tunnel, please see An introduction to Linux virtual interfaces: Tunnels BridgeĪ Linux bridge behaves like a network switch.This post covers the following frequently used interfaces and some interfaces that can be easily confused with one another: A list of interfaces can be obtained using the command ip link help. Anyone with a network background might be interested in this blog post.
There is no code analysis, only a brief introduction to the interfaces and their usage on Linux.
In this post, I will give a brief introduction to all commonly used virtual network interface types. Linux has rich virtual networking capabilities that are used as basis for hosting VMs and containers, as well as cloud environments.