Virtual Interfaces in Linux
Table of contents
Revision history
| Revision | Date | Remark | |
|---|---|---|---|
| 0.1 | Feb-02-2023 | Add Document | |
| 0.2 | Feb-02-2023 | Add description of Docker using VETH | |
| 0.3 | Feb-04-2023 | Add tunnel interface | |
| 0.34 | Feb-06-2023 | Add ipvlan interface |
Meaning and how to create various types of virtual interfaces on Linux
| Type | How to create | Meaning |
|---|---|---|
| Bridge |
Create interface
Delete interface
Add interface to bridge
Remove interface from bridge
|
Software bridge, L2 interface |
| 802.1Q VLAN |
Check if kernel is enabled
Create interface
|
802.1Q VLAN interface, L2 interface |
| MACVLAN |
Create interface
|
MACVLAN interface, Interface needs to support promiscuity mode, L2 interface |
| IPVLAN |
Create interface
|
Similar to macvlan, ipvlan supports L2 and L3. In L2 mode, interfaces have the same MAC but different IPs |
| TUN |
Create interface
|
- Only accepts L3 packets - Cannot be added to bridge - Cannot broadcast packets - Commonly used for VPN connections |
| TAP |
Create interface
|
- Operates at L2 - Can be added to bridge - Can broadcast packets - Commonly used in virtual machine systems |
| VETH |
Create interface
|
- Creates a pair of virtual interfaces with link connection to each other - Docker bridge mode uses this config, veth0 is bound to container, veth1 is added as member of bridge docker0 |
| TUNNEL |
Create interface
Delete interface
|
- Create tunnel interface, modes: ipip | gre | sit | isatap | vti | ip6ip6 | ipip6 |
ip6gre | vti6 | any |