Most Powerful Open Source ERP

HowTo Configure Edgecore Switch (Router, Re6st, SlapOS)

HowTo install a SlapOS node in a switch which have AOS installed and make it behave as a router
  • Last Update:2021-07-13
  • Version:003
  • Language:en

Configure a switch under AOS

This tutorial will guide you through the process of configuring a Edgecore switch under AOS (follow rapidspace-HowTo.Install.AOS.On.Edgecore.Switch if you want to install AOS on a Edgecore Switch. We will see how to upgrade the switch in order to install packets that we will need to configure the switch. We will also see how to install re6st and SlapOS, allow SSH connexion with ipv6 and finally, make the switch behave as a router

Table Of Content

  • Prerequisites
  • Create and configure VLAN
  • Configure Internet access on the switch
  • Update and upgrade the switch
  • Install re6st and SlapOS
  • Allow SSH connexion with ipv6
  • Make the switch a router

Prerequisites

Create and configure VLAN

First of all, we create a VLAN on the switch with the all the SFP+ interface and the AOS. It is important to put everything in 1 VLAN so that the computers can see the switch and vice versa.

you need to enter some CLI command, to tell the switch on which port you plug your test device and create a Vlan in which you will put your port.

Console#configure
Console(config)#vlan database
Console(config-vlan)#vlan 100
Console(config-vlan)#exit
Console(config)#exit
Console#


The code above will create one VLAN with id "100".

Console# configure
Console(config)# interface vlan 100
Console(config-if)# ip address YOUR_NETWORK_ADDRESS/YOUR_CIDR
Console(config-if)# exit
Console(config)# interface ethernet 1/1-54
Console(config-if)# switchport allowed vlan add 100 untagged
Console(config-if)# switchport native vlan 100
Console(config-if)# ex
Console(config)# ex

The "1/1-54" will put all 54 ports of the switch to same VLAN, which is expected configuration.

WARNING: you must use the proper IP address you want to give to the switch. Ideally, it should be a public IP address so that you can ssh to the switch directly, otherwise it can be a local IP like 10.10.1.1/24. Please note that the IP address you set here will be visible inside the Linux OS as the IP address set to VLAN100 interface. You shouldn't set the IP inside of the Linux (neither with the command "ip address add" nor in "/etc/network/interfaces" file).

Once you did the VLAN configuration, you need to save it in flash so that it is persistent after next reboot. Type "copy running-config startup-config" in the console.

Console#copy running-config startup-config
Startup configuration file name [startup1.cfg]: 
Write to FLASH Programming.
Write to FLASH finish.
Success.

Configure internet access on the switch

In order to install everything needed, your switch needs to access internet. In order to configure internet access on the switch, log inside the linux shell through minicom:

Username: admin
Password:

      CLI session with the AOS5810-54X is opened.
      To end the CLI session, enter [Exit].


Console#
Console#linux shell
# bash
root@test:/# 

Here you are inside a regular Debian 10 OS. You should make sure you can access internet (ping google.com should work).

Remember that VLAN100 interface is the VLAN with all your SFP+ ports. If you configured the correct IP address in the step above it should be visible in the OS and normally, you just need to set the default route to go through this interface with:

ip -4 r add default dev VLAN100 via YOUR_GATEWAY_IP

Please make sure you can ping google.fr after this step:

root@test:~# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=119 time=11.9 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=119 time=13.5 ms
^C
--- 8.8.8.8 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 2ms
rtt min/avg/max/mdev = 11.895/12.684/13.473/0.789 ms

 

Please, make the configuration persistent by adding a cron like this in root:

root@test:~# crontab -e
* * * * * ip -4 r add default dev VLAN100 via YOUR_GATEWAY_IP # add this line in your crontab

Please note that /etc/network/interfaces is totally ignored. So, even if you specify "gateway" in /etc/network/interfaces, the route by default is not correctly set by AOS. That's why you need to add the cron mentioned here.

 

Upgrade the switch

The following steps will guide you through the upgrade of the switch and which packets we will need to continue the configuration. First you need to remove the proxy in order to upgrade the switch.

Log in as root on the switch and change the proxy.conf file and comment every lines:


root@test:/# vi /etc/apt/apt.conf.d/proxy.conf 

#Acquire::http { Proxy "http://localhost:8111"; };
#Acquire::https::Proxy "DIRECT";


#Acquire::http { Proxy "http://localhost:3142"; };
#Acquire::https::Proxy "http://localhost:3142";

Then we need to give the good sources to the switch in order to install packets. You will need to modify the /etc/apt/sources.list file.


deb http://deb.debian.org/debian/ buster main
deb http://security.debian.org/debian-security buster/updates main 

You can now, update and upgrade the switch and install the wget packet . Don't forget to reboot after that.

apt update
apt upgrade
apt install wget

Install re6st and SlapOS

The following steps will guide you through the installation of re6st and SlapOS.

By default, the switch has only 2GB of disk in / which is too few for SlapOS. We thus need to create a new lvm entry in which we will put the /tmp, /opt and /srv of the switch. We will also increase the space for / up to the maximum to have enough space for logs:


apt install lvm2
lvcreate -n SLAPOS -L 20G ACCTON
mkfs.ext4 /dev/ACCTON/SLAPOS
lvextend -l +100%FREE /dev/ACCTON/sysroot1
resize2fs /dev/ACCTON/sysroot1


Then you need to find the uuid of your new mount and change fstab file in order to make your changes persistent after rebooting the switch.


blkid
vi /etc/fstab
	UUID='uuid'       /mnt/SLAPOS    ext4    defaults        0       0
	/mnt/SLAPOS/opt	/opt	none	bind
	/mnt/SLAPOS/srv	/srv	none	bind
	/mnt/SLAPOS/tmp	/tmp	none	bind

Next,we need to create a mount point and mount the logical volume.


mkdir -vp /mnt/SLAPOS
mount /dev/ACCTON/SLAPOS /mnt/SLAPOS

Now our new mount is ready to get /tmp, /opt and /srv.


cd /mnt/SLAPOS
cp -R /tmp tmp
cp -R /opt opt
cp -R /srv srv
chmod 1777 /mnt/SLAPOS/tmp
chmod 755 /mnt/SLAPOS/opt
chmod 755 /mnt/SLAPOS/srv
mount /opt
mount /srv

Rapid.Space Operator will give you one time token for re6stnet installation.

In order to request the token navigate to panel.rapid.space --> Tickets --> Add.

Use Ticket Type "Information", in "Subject" type "Production re6st new token" and in the "Your Message" write:

I need a new Production re6st token for machine named "name", which will be hosted in "DC name" datacenter.

Where the "name" and "DC name" are important information for the Rapid.Space Operator.

When Rapid.Space Operator will generate token for you, the given ticket will be closed, and you'll find the token in the reply.

With this token in hand you can start installing the re6st on the machine:

wget https://deploy.erp5.net/re6st
bash re6st

It will ask you for the token you got.

Once you have done the part about the installtion of re6st and of a slapos node, you need to modify the config file in order to make re6st work. You will put this line in the config file (/etc/re6stnet/re6stnet.conf):

default

Note that by default re6st attach the IPv6 address to "lo" interface. You can now restart the service by doing:


systemctl restart re6stnet

 

Try SSH connection with ipv6

You should now be able to do SSH on the IPv6 of re6st. In order to know your IPv6 of re6st, you should run "ip -6 a" and look at the IPv6 configured on your "lo" interface.

In order to be able to log in as root on AOS, you should setup a authorized_keys file:

root@test:/# mkdir -p /root/.ssh
root@test:/# vi /root/.ssh/authorized_keys # insert here your public SSH key.

Then from a location where you have IPv6, you can try:

ssh root@<IPv6 of the switch>

 

 

Thank You

Image Nexedi Office
  • Nexedi GmbH
  • 147 Rue du Ballon
  • 59110 La Madeleine
  • France