WEBVTT

00:00:01.140 --> 00:00:01.940
In this demo,

00:00:01.940 --> 00:00:06.690
you will learn to do the following: download and install the VyOS router,

00:00:06.690 --> 00:00:12.260
the basic configuration to allow for remote management,

00:00:12.940 --> 00:00:17.160
and the basic routing and network address translation commands.

00:00:19.200 --> 00:00:21.240
The home lab is built as follows.

00:00:22.240 --> 00:00:27.060
You have a laptop configured with VMware Workstation Player 16,

00:00:27.640 --> 00:00:33.720
which is a free and light type 2 hypervisor from VMware and which will host

00:00:33.730 --> 00:00:39.460
a little machine with Ubuntu 18.04 and our VyOS router.

00:00:40.340 --> 00:00:44.260
Laptop is connected to internet by means of command router.

00:00:45.740 --> 00:00:48.820
Please take note that virtual machine is already configured with

00:00:48.820 --> 00:00:52.060
Docker which we will use in the next demos.

00:00:52.440 --> 00:00:56.210
And also take note that the picture contains interface

00:00:56.210 --> 00:00:59.440
naming, an IP address in the schema details,

00:00:59.450 --> 00:01:01.760
which we will use across the lab.

00:01:03.840 --> 00:01:07.670
The first thing to do is to download correct VyOS image.

00:01:07.670 --> 00:01:11.880
Let's go to VyOS public site and select the VyOS

00:01:11.880 --> 00:01:14.510
release 1.3 Release Candidate 6,

00:01:15.240 --> 00:01:21.030
which is the latest free snapshot before release 1.3 long term support,

00:01:21.200 --> 00:01:23.160
which is a commercial product.

00:01:25.940 --> 00:01:29.860
Once the download is completed, open VMware tool,

00:01:30.440 --> 00:01:33.260
select the Create a New Virtual Machine,

00:01:34.140 --> 00:01:39.860
selecte the ISO we have already download as the installer disk image.

00:01:41.440 --> 00:01:45.550
Select the Linux as guest operating system and provide a

00:01:45.550 --> 00:01:49.810
meaningful name for our first VyOS router,

00:01:49.810 --> 00:01:55.610
4 GB of disk size is more than enough in a small lab,

00:01:55.620 --> 00:01:57.950
as well as in production environment.

00:01:59.540 --> 00:02:02.150
Then we have to select the customized hardware.

00:02:04.240 --> 00:02:08.650
Let me select 1,024 MB of RAM.

00:02:09.539 --> 00:02:12.260
Configure network adapter as bridged.

00:02:12.640 --> 00:02:16.510
This will serve as main app link towards internet,

00:02:16.690 --> 00:02:19.260
as well main management interface.

00:02:21.040 --> 00:02:25.460
Now, at the second interface configure as a custom,

00:02:25.710 --> 00:02:28.930
which means that this interface is attached to the

00:02:28.930 --> 00:02:33.360
virtual internal network named VMnet0.

00:02:34.540 --> 00:02:37.260
And now we are ready to start the virtual machine.

00:02:38.940 --> 00:02:43.610
As soon as the boot process completes, we are presented with prompt.

00:02:43.820 --> 00:02:48.260
By default, user and password are set as VyOS.

00:02:48.940 --> 00:02:51.770
The installation so far is a live installation.

00:02:52.020 --> 00:02:53.220
To make it permanent,

00:02:53.410 --> 00:02:59.250
we have to install VyOS on the disk by means of the install image command.

00:03:00.840 --> 00:03:04.260
A script will work as through installation process.

00:03:05.140 --> 00:03:09.180
Basically, the quickest and safest way to do this is to

00:03:09.180 --> 00:03:12.160
acknowledge all steps by replying yes.

00:03:12.940 --> 00:03:17.950
At the end of installation, you will be asked to customize user and password.

00:03:19.740 --> 00:03:24.860
And after finalizing the GRUB, your installation is completed.

00:03:26.540 --> 00:03:29.200
The last step to make permanent here in

00:03:29.200 --> 00:03:31.960
installation is to issue a reboot command.

00:03:32.940 --> 00:03:37.660
After reboot is completed, let us check current VyOS version,

00:03:37.930 --> 00:03:42.300
and let's confirm that the desired version release 1.3

00:03:42.570 --> 00:03:45.260
release candidate 6 is in place.

00:03:48.840 --> 00:03:49.430
Now,

00:03:49.430 --> 00:03:53.050
we have to issue a couple of commands to make and label

00:03:53.050 --> 00:03:55.650
our router for remote management.

00:03:56.540 --> 00:04:00.460
First, we enter configuration mode with command configure.

00:04:02.140 --> 00:04:07.020
Then we configure interface Ethernet 0, which is our

00:04:07.030 --> 00:04:09.360
app link and management interface.

00:04:10.140 --> 00:04:14.550
Then we enable SSH service for our VyOS router.

00:04:15.540 --> 00:04:20.660
Then we issue the command commit which apply the configuration issued so far,

00:04:22.440 --> 00:04:27.150
and then we should save command which makes the current configuration permanent.

00:04:28.740 --> 00:04:33.750
Then we open a terminal emulator and we SSH to our router.

00:04:34.440 --> 00:04:37.500
We provide the user and password, and here we go.

00:04:37.770 --> 00:04:39.960
We have remote management enabled.

00:04:40.740 --> 00:04:41.280
Finally,

00:04:41.280 --> 00:04:46.200
we'll have to complete our configuration with a set of commands which allows

00:04:46.200 --> 00:04:50.850
clients which connects to our router to go through internet.

00:04:51.130 --> 00:04:55.760
First, we have to create a default route for our VyOS router.

00:04:56.240 --> 00:05:00.050
We configure the second interface with suitable IP address.

00:05:00.540 --> 00:05:01.430
And finally,

00:05:01.500 --> 00:05:05.030
we issue three comments which create a network address

00:05:05.030 --> 00:05:09.050
translation minimal configuration, and that's it.

00:05:09.340 --> 00:05:12.060
Just remember to commit and save.

00:05:14.040 --> 00:05:18.150
Now we move to the virtual machine which is part of our lab.

00:05:19.040 --> 00:05:21.950
As you can see, virtual machine has two interfaces,

00:05:22.440 --> 00:05:27.490
ens33, which is the interface we use for management,

00:05:27.670 --> 00:05:33.550
and the ens37, which is attached to our router.

00:05:34.340 --> 00:05:38.510
By default, interface ens37 is down.

00:05:38.600 --> 00:05:42.350
So first task is to set this interface up.

00:05:43.240 --> 00:05:47.460
Let's confirm the final state of the interface is the code1.

00:05:48.440 --> 00:05:51.660
Then we'll create a Docker container which we will

00:05:51.660 --> 00:05:54.360
use as an endpoint for our test.

00:05:55.340 --> 00:05:57.050
We need two commands here.

00:05:58.040 --> 00:06:01.250
The first command creates a Docker custom network.

00:06:01.740 --> 00:06:03.450
I will not go in details here.

00:06:03.450 --> 00:06:07.050
Just want to make you observe the IP VLAN parameter,

00:06:07.440 --> 00:06:14.580
which means that we are binding the container directly to interface ens37.

00:06:14.870 --> 00:06:19.370
Second command creates a container based on alpine image,

00:06:19.380 --> 00:06:22.050
which is a light Linux distribution.

00:06:23.240 --> 00:06:23.630
Finally,

00:06:23.630 --> 00:06:27.120
we open a shell directly into the container and we

00:06:27.120 --> 00:06:29.150
confirm three main things here,

00:06:29.940 --> 00:06:38.170
container as IP address belonging to 172.16.1.0/24 network.

00:06:38.180 --> 00:06:39.280
As expected,

00:06:39.290 --> 00:06:44.370
we are able to ping the main interface on the router, and we

00:06:44.370 --> 00:06:46.650
are able to communicate with the internet.

00:06:48.640 --> 00:06:53.800
In the next demo, we will see how to create a VyOS API configuration,

00:06:53.950 --> 00:06:58.660
and we will learn how to make API calls with simple Python scripts.
