In this demo,
you will learn to do the following: download and install the VyOS router,
the basic configuration to allow for remote management,
and the basic routing and network address translation commands.
The home lab is built as follows.
You have a laptop configured with VMware Workstation Player 16,
which is a free and light type 2 hypervisor from VMware and which will host
a little machine with Ubuntu 18.04 and our VyOS router.
Laptop is connected to internet by means of command router.
Please take note that virtual machine is already configured with
Docker which we will use in the next demos.
And also take note that the picture contains interface
naming, an IP address in the schema details,
which we will use across the lab.
The first thing to do is to download correct VyOS image.
Let's go to VyOS public site and select the VyOS
release 1.3 Release Candidate 6,
which is the latest free snapshot before release 1.3 long term support,
which is a commercial product.
Once the download is completed, open VMware tool,
select the Create a New Virtual Machine,
selecte the ISO we have already download as the installer disk image.
Select the Linux as guest operating system and provide a
meaningful name for our first VyOS router,
4 GB of disk size is more than enough in a small lab,
as well as in production environment.
Then we have to select the customized hardware.
Let me select 1,024 MB of RAM.
Configure network adapter as bridged.
This will serve as main app link towards internet,
as well main management interface.
Now, at the second interface configure as a custom,
which means that this interface is attached to the
virtual internal network named VMnet0.
And now we are ready to start the virtual machine.
As soon as the boot process completes, we are presented with prompt.
By default, user and password are set as VyOS.
The installation so far is a live installation.
To make it permanent,
we have to install VyOS on the disk by means of the install image command.
A script will work as through installation process.
Basically, the quickest and safest way to do this is to
acknowledge all steps by replying yes.
At the end of installation, you will be asked to customize user and password.
And after finalizing the GRUB, your installation is completed.
The last step to make permanent here in
installation is to issue a reboot command.
After reboot is completed, let us check current VyOS version,
and let's confirm that the desired version release 1.3
release candidate 6 is in place.
Now,
we have to issue a couple of commands to make and label
our router for remote management.
First, we enter configuration mode with command configure.
Then we configure interface Ethernet 0, which is our
app link and management interface.
Then we enable SSH service for our VyOS router.
Then we issue the command commit which apply the configuration issued so far,
and then we should save command which makes the current configuration permanent.
Then we open a terminal emulator and we SSH to our router.
We provide the user and password, and here we go.
We have remote management enabled.
Finally,
we'll have to complete our configuration with a set of commands which allows
clients which connects to our router to go through internet.
First, we have to create a default route for our VyOS router.
We configure the second interface with suitable IP address.
And finally,
we issue three comments which create a network address
translation minimal configuration, and that's it.
Just remember to commit and save.
Now we move to the virtual machine which is part of our lab.
As you can see, virtual machine has two interfaces,
ens33, which is the interface we use for management,
and the ens37, which is attached to our router.
By default, interface ens37 is down.
So first task is to set this interface up.
Let's confirm the final state of the interface is the code1.
Then we'll create a Docker container which we will
use as an endpoint for our test.
We need two commands here.
The first command creates a Docker custom network.
I will not go in details here.
Just want to make you observe the IP VLAN parameter,
which means that we are binding the container directly to interface ens37.
Second command creates a container based on alpine image,
which is a light Linux distribution.
Finally,
we open a shell directly into the container and we
confirm three main things here,
container as IP address belonging to 172.16.1.0/24 network.
As expected,
we are able to ping the main interface on the router, and we
are able to communicate with the internet.
In the next demo, we will see how to create a VyOS API configuration,
and we will learn how to make API calls with simple Python scripts.