This presentation provides some basics on Linux networking options, including network namespaces, VLAN interfaces, MACVLAN interfaces, and virtual Ethernet (veth) interfaces.
Blogger (11 years at http://blog.scottlowe.org) • Author (7 books so far, 8th book in the works) • Speaker (VMworld, Interop, OpenStack Summits, other events worldwide) • Podcaster (The Full Stack Journey podcast) • Engineering Architect at VMware, Inc. • Jack of all trades, master of none
on multiple VLANs via a single physical interface • Physical interface acts like a VLAN trunk (and must be connected to an appropriately configured switch port) • Can place VLAN interfaces in a separate network namespace, if desired, to support unique IP routing tables per VLAN
<name> type vlan id <ID> - Adds a VLAN interface • ip link list - Lists interfaces • ip link set <if> up/down - Configure a VLAN interface • ip addr add <addr> dev <if> - Configure IP addressing on a VLAN interface
the network namespaces • ip netns add <name> - Adds a network namespace • ip netns del <name> - Removes a network namespace • ip link set <if> netns <name> - Puts an interface into a network namespace • ip netns exec <cmd> - Executes a command in the context of a specific network namespace
are pairs of logical interfaces • Traffic ingressing one veth interface egresses the peer interface • Can be used to connect network namespaces together
<name> type veth peer name <name> - Create a veth pair • ip link list - List interfaces • ip link set <if> up/down - Configure a veth interface (peers managed independently) • ip addr add <addr> dev <if> - Configure IP addressing on a veth interface (peers managed independently)
interfaces on a single interface • These logical interfaces are differentiated by MAC address • Can host macvlan interfaces on physical interfaces or VLAN interfaces • Can place macvlan interfaces in a separate network namespace, if desired • Can use with KVM guest domains (macvtap)
<name> type macvlan mode <mode> - Add a macvlan interface • ip link list - List interfaces • ip link set <if> up/down - Configure a macvlan interface • ip addr add <addr> dev <if> - Configure IP addressing on a macvlan interface
is very similar to MACVLAN interfaces • L3 is a different beast entirely • Open vSwitch (OVS) • Highly programmable, multilayer virtual switch • Kernel module is part of upstream Linux kernel (since 3.3) • Can be used in conjunction with some of things discussed here (veth interfaces, as one example)