AREDN on Proxmox: Difference between revisions

From Bay Area Mesh
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 74: Line 74:
   
 
You can now open the AREDN UI using '''<nowiki>http://192.168.51.253</nowiki>''' and set up the node as you normally would. Don’t forget the default AREDN username and password is “root” and “hsmm”.
 
You can now open the AREDN UI using '''<nowiki>http://192.168.51.253</nowiki>''' and set up the node as you normally would. Don’t forget the default AREDN username and password is “root” and “hsmm”.
  +
  +
== Connecting to the Mesh ==
  +
To connect the VM to the rest of your mesh, you need to route VLAN 2 out of the VM.
  +
  +
Unfortunately, there's no Proxmox UI, or even command line tools, to do this. So you need to edit the VM's configuration by hand.
  +
  +
On your Proxmox host change to the directory '''/etc/pve/qemu-server'''
  +
  +
<code>cd /etc/pve/qemu-server</code>
  +
  +
When the VM is stopped, edit the file 100.conf (or whatever ID you gave your VM) and look for a line which looks something like this (the mac address, here in italics, will be different from shown here):
  +
  +
<code>net0: virtio=''62:1b:33:cf:67:01'',bridge=vmbr0</code>
  +
  +
Change this line to append '''trunks=2''', so it looks like this:
  +
  +
<code>net0: virtio=''62:1b:33:cf:67:01'',bridge=vmbr0,trunks=2</code>
  +
  +
You can now restart the VM and the DtD/VLAN2 will be connected from your AREDN VM to your Proxmox host.
  +
  +
=== Proxmox Host VLANs ===
  +
Next you have to connect the host's VLAN2 to your mesh network. There are many ways you could do this, so it's difficult to provide instructions for this step. One option is to use a hAP lite or hAP ac2 and connect Port 5 (the DtD out port) to your Proxmox server either via a dumb switch or to an extra ethernet port on your Proxmox host. How to configure VLANs on the Proxmox host is beyond the scope of this article, but you may find this YouTube video "[https://www.youtube.com/watch?v=zx5LFqyMPMU Proxmox NETWORKING: VLANs, Bridges, and Bonds!]" helpful.

Revision as of 16:18, 23 August 2023

We’re going to create a VM on Proxmox and use an AREDN x86 image as the boot disk. To do this we’ll first create a normal VM, import the AREDN disk image, and then boot the VM.

Create a VM

First create a VM by using the normal Proxmox Create VM UI. Pick a name for your node, not forgetting to include your callsign at the beginning as usual.

Aredn Proxmox Create VM.png

We’re not going to install AREDN from an install image, so here we just picked “Do not use any media”.

Aredn Proxmox No CD.png

For the system, we just use the defaults.

Aredn Proxmox Default System.png

We’re not going to use the default disk (we’ll add our own later) so hit the trash icon next to “scsi0” on the top/left to remove it.

Aredn Proxmox Trash Disk.png

It will look like this when you’re done.

Aredn Proxmox No Disks.png

You can leave the CPU as the default.

Aredn Proxmox Default CPU.png

For memory you won’t want anything like as much as the default. 128MB is plenty.

Aredn Proxmox 128M Memory.png

Networking can be left with the defaults. Later you might want to change these, but I’m going to assume you know what you’re doing if you’re changing VLAN tags.

Aredn Proxmox Default Networking.png

Finally hit Finish and you’re done with the first step.

Aredn Proxmox Confirm.png

Adding the AREDN boot image

The next step needs to be completed from the command line, so log into your Proxmox server.

Download the AREDN x86 boot image from the AREDN server. The URL will end ext4-combined.img.gz and will have the form:

http://downloads.arednmesh.org/snapshots/targets/x86/64/aredn-VERSION-x86-64-generic-ext4-combined.img.gz

So to download the image you might type:

wget http://downloads.arednmesh.org/snapshots/targets/x86/64/aredn-20230510-ca49646-x86-64-generic-ext4-combined.img.gz

Next we uncompress the image:

gunzip aredn-20230510-ca49646-x86-64-generic-ext4-combined.img.gz

You may see a message about trailing garbage. You can safely ignore this.

We now need to import the disk into our VM. When we created out VM we gave it the ID 100, so we do this using the following command:

qm disk import 100 aredn-20230510-ca49646-x86-64-generic-ext4-combined.img local

Change the 100 in the above command to match the ID of your VM.

Making the VM bootable

We now have a VM with an AREDN disk, but the VM isn’t yet read to boot. We now need to make our newly imported disk the boot disk.

Back in the Proxmox UI, select the VM and then the Hardware tab, which should look something like this:

Aredn Proxmox Basic VM.png

Notice the “Unused Disk 0” at the bottom - that’s the disk we just imported. Double tap on the “Unused Disk 0” row to bring up the following dialog:

Aredn Proxmox Disk Setup.png

And then just hit the ‘Add” button. The disk is now added.

The final step is to make it the boot disk. Select the VM again, but this time pick the “Options” tab, and then double click the “Boot Order” row.

Aredn Proxmox Check Boot Order.png

On the displayed popup make sure to only select the SCSI disk, like this:

Aredn Proxmox Set Boot Disk.png

Hit OK.

Booting

We’re ready to boot up the AREDN VM for the first time. Hit the Start button and and select the VM’s Console. Hit the RETURN key a couple of times after the text stops scrolling and the screen will look something like this:

Aredn Proxmox Booted.png

Congratulations!

Configuring AREDN

The version of AREDN that boots up is exactly like any other version of AREDN; it’s accessible on IP address 192.168.1.1 and must be configured through the AREDN UI.

Depending on the configuration of your Proxmox server, address 192.168.1.1 might not be the easiest address to work with. For example, my Proxmox server uses the subnet 192,.168.51.X. So before configuring AREDN for the first time, we will quickly change the default IP address by typing:

ifconfig br-lan 192.168.51.253

Replace the 192.168.51.253 IP address with whatever makes sense for your setup.

You can now open the AREDN UI using http://192.168.51.253 and set up the node as you normally would. Don’t forget the default AREDN username and password is “root” and “hsmm”.

Connecting to the Mesh

To connect the VM to the rest of your mesh, you need to route VLAN 2 out of the VM.

Unfortunately, there's no Proxmox UI, or even command line tools, to do this. So you need to edit the VM's configuration by hand.

On your Proxmox host change to the directory /etc/pve/qemu-server

cd /etc/pve/qemu-server

When the VM is stopped, edit the file 100.conf (or whatever ID you gave your VM) and look for a line which looks something like this (the mac address, here in italics, will be different from shown here):

net0: virtio=62:1b:33:cf:67:01,bridge=vmbr0

Change this line to append trunks=2, so it looks like this:

net0: virtio=62:1b:33:cf:67:01,bridge=vmbr0,trunks=2

You can now restart the VM and the DtD/VLAN2 will be connected from your AREDN VM to your Proxmox host.

Proxmox Host VLANs

Next you have to connect the host's VLAN2 to your mesh network. There are many ways you could do this, so it's difficult to provide instructions for this step. One option is to use a hAP lite or hAP ac2 and connect Port 5 (the DtD out port) to your Proxmox server either via a dumb switch or to an extra ethernet port on your Proxmox host. How to configure VLANs on the Proxmox host is beyond the scope of this article, but you may find this YouTube video "Proxmox NETWORKING: VLANs, Bridges, and Bonds!" helpful.