AREDN on Proxmox: Difference between revisions

From Bay Area Mesh
Jump to navigation Jump to search
No edit summary
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
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, import the AREDN disk image, and then boot the VM.
+
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 ==
 
== Create a VM ==
Line 43: Line 43:
   
 
Change the 100 in the above command to match the ID of your VM.
 
Change the 100 in the above command to match the ID of your VM.
  +
  +
Note; depending on your Proxmox configuration, <code>local</code> may not be correct for you. Another common possibility here is <code>local-lvm</code> so if this command errors, try that instead.
   
 
== Making the VM bootable ==
 
== Making the VM bootable ==
Line 48: Line 50:
   
 
Back in the Proxmox UI, select the VM and then the Hardware tab, which should look something like this:
 
Back in the Proxmox UI, select the VM and then the Hardware tab, which should look something like this:
  +
[[File:Aredn Proxmox Basic VM.png|none|thumb]]
 
 
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:
 
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:
  +
[[File:Aredn Proxmox Disk Setup.png|none|thumb]]
 
 
And then just hit the ‘Add” button. The disk is now added.
 
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.
 
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.
  +
[[File:Aredn Proxmox Check Boot Order.png|none|thumb]]
 
 
On the displayed popup make sure to only select the SCSI disk, like this:
 
On the displayed popup make sure to only select the SCSI disk, like this:
  +
[[File:Aredn Proxmox Set Boot Disk.png|none|thumb]]
 
 
Hit OK.
 
Hit OK.
   
 
== Booting ==
 
== 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:
 
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:
  +
[[File:Aredn Proxmox Booted.png|none|thumb]]
 
 
Congratulations!
 
Congratulations!
   
 
== Configuring AREDN ==
 
== 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.
+
The version of AREDN that boots up is exactly like any other version of AREDN. However, because we dont have easy access to the UI yet, we can finish the configuration from the console.
  +
  +
From the console execute the following command:
  +
  +
<code>/usr/local/bin/firstuse_setup <NODE NAME> <PASSWORD></code>
  +
  +
Where <code><NODE NAME></code> should be replaced by your node's new name, and <code><PASSWORD></code> should be a password to protect access to this node. For example:
  +
  +
<code>/usr/local/bin/firstuse_setup KN6PLV-MyNewNode mysecretpassword</code>
  +
  +
Then reboot the node using the command:
  +
  +
<code>/sbin/reboot</code>
  +
  +
Once the node has rebooted, the setup will have been completed and the node will have a 10.X.Y.Z address like all AREDN nodes.
  +
  +
== 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:
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:
 
   
  +
<code>net0: virtio=''62:1b:33:cf:67:01'',bridge=vmbr0,trunks=2</code>
<code>ifconfig br-lan 192.168.51.253</code>
 
   
  +
You can now restart the VM and the DtD/VLAN2 will be connected from your AREDN VM to your Proxmox host.
Replace the 192.168.51.253 IP address with whatever makes sense for your setup.
 
   
  +
=== Proxmox Host VLANs ===
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”.
 
  +
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.

Latest revision as of 21:57, 3 November 2024

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.

Note; depending on your Proxmox configuration, local may not be correct for you. Another common possibility here is local-lvm so if this command errors, try that instead.

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. However, because we dont have easy access to the UI yet, we can finish the configuration from the console.

From the console execute the following command:

/usr/local/bin/firstuse_setup <NODE NAME> <PASSWORD>

Where <NODE NAME> should be replaced by your node's new name, and <PASSWORD> should be a password to protect access to this node. For example:

/usr/local/bin/firstuse_setup KN6PLV-MyNewNode mysecretpassword

Then reboot the node using the command:

/sbin/reboot

Once the node has rebooted, the setup will have been completed and the node will have a 10.X.Y.Z address like all AREDN nodes.

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.