4

Hello everyone!

I have installed Ubuntu Server 18.04 in na Hyper-V VM (please, no flack, not my fault...) and this particular network is a VLAN. No other traffic is permitted through the relevant switch, only that one VLAN id (let's say, 39).

So... I have no connectivity to the internet to apt-get the vlan package, but without the vlan package I can't set up eth0.39 to get internet connectivity. A nasty egg/chicken problem.

I can't even download the sole package to another machine on the same subnet, because without the vlan setting on my eth0 I can't even access neighbouring machines.

I have no access to the Hypervisor disks also, so I can't mount them.

What sould I do?

Henrique
  • 701

1 Answers1

2

The answer on Thomas' comment actually Works (and I quote):

You should be able to add a VLAN interface manually, then install the vlan package.

Try with

ip link add link eth0 name eth0.39 type vlan id 39

then

ip link set eth0.39 up

and configure your IP on the device.

BUT...

If you are using Microsoft's Hyper-V, you can simply configure it on Hyper-V and let your Ubuntu be oblivious about the whole VLAN business. You can do it on the Hyper-V Manager software or using the new (web-based) Windows Admin Center.

For Hyper-V Manager

  1. Open Hyper-V Manager.
  2. In the results pane, under Virtual Machines, select the appropriate virtual machine and then right-click Settings.
  3. Under Hardware, select an virtual switch that's set up with a VLAN.
  4. In the right pane, select Enable virtual LAN identification, and then type the same VLAN ID as the one you specified for the virtual switch.

For Windows Admin Center

  1. Open Windows Admin Center with your browser

  2. Click on the machine that hosts your VM

  3. Click on Virtual Machines > Inventory

  4. Click on the desired VM

  5. Click on More > Configuration

  6. Click on Network

  7. In the VLAN Identifierfield, inform the apropriate VLAN ID.

  8. Click Save

Your Ubuntu VM on Hyper-V is now networking on the correct VLAN without even noticing.

Henrique
  • 701