Date created: 03/15/20 11:39:23. Last modified: 03/15/20 11:50:23

VLAN Interfaces

Old Style / vconfig

# Setup:
$sudo apt-get install vconfig
$sudo modprobe 8021q
$vconfig add eth0 2
$sudo ip addr add 192.168.58.34/27 dev eth0.2
$sudo ip link set up eth0.2
# Remove:
$sudo vconfig rem eth0.2

 

New Style / iproute3

# Setup:
$sudo ip link add link eth0 name eth0.2 type vlan id 2
$sudo ip a a 192.168.58.34/27 brd 192.168.58.63 dev eth0.2
$sudo ip link set dev eth0.2 up
$ip -d link show eth0.2
# Remove:
$sudo ip link set dev eth0.2 down
$sudo link delete eth0.2