Sunday, 22 November 2020

VLAN on Ubuntu Live Disc

VLAN on Ubuntu Live Disc

Configure VLAN tagging on Ubuntu Live DVD

Most of the guides I found online show you how to configure a VLAN interface on ubuntu by running apt install vlan. That’s all good, however what happens if you’re booted to a Live DVD OS and you don’t already have network access to install a package. Well, it turns out you can use the ip command to add a VLAN tagged interface to your physical interface and get connectivity.


I’ve tested these commands on both a Ubuntu 16.04 and 20.04 Live DVD and both work fine.

Here’s what you need to do

Show your existing interfaces

ip -c -br a

Once you can see which interfaces are up, note the interface name of the one which has the VLAN you’re interested in. In my case enp4s0f1 has vlan id 777 tagged on it.

ip brief

Add a VLAN interface to your physical interface

sudo ip link add link enp4s0f1 name enp4s0f1.777 type vlan id 777

Bring the new interface up

sudo ip link set enp4s0f1.777 up

Add an IP address to the interface. You can use CIDR notation (eg. 192.168.0.1/24) or IP/Subnet (eg. 192.168.0.1/255.255.255.0)

sudo ip a add 172.23.98.176/24 dev enp4s0f1.777

Add a default gateway

sudo ip route add default via 172.23.98.254

Ping something

ping -c 3 172.23.98.254

commands

Hopefully you should now have connectivity.

Written with StackEdit.

No comments:

Post a comment

Please be nice! :)