VyOS is an open source network operating system based on Debian GNU/Linux.
VyOS provides a free routing platform that competes directly with other commercially available solutions from well known network providers. Because VyOS is run on standard amd64, i586 and ARM systems, it is able to be used as a router and firewall platform for cloud deployments.
In order to run VyOS on cloud provider, we need to install it from ISO or using snapshot images (it can be https://vyos.net/get/snapshots/) at this moment i wrote this article, so we need to install it from ISO. In this case, i'll show how to deploy VyOS on Vultr.
But sadly this page was unavailable (First, we need Vultr account, you can open vultr account and fill balance, or pay directly with your card. And then we need to get latest build of VyOS from : https://vyos.net/get/nightly-builds . I prefer use latest image, since it should fix previous release bugs.
From Vultr dashboard, navigate to Products -> ISO and then click Add ISO.
From VyOS download page, paste public link of Vultr ISO. Vultr will handle at their end, by downloading VyOS image that we choose before (this link will also download latest build of VyOS : https://s3-us.vyos.io/rolling/current/vyos-rolling-latest.iso).
After Vultr finish download VyOS ISO, it will looks like this :
Next, we can continue to create instance (please pay attention, i'll attach ISO at this step). While deploy new instance please do configuration like below :
- Choose Server : Cloud Compute
- CPU & Storage Technology : Intel (Regular Performance)
- Server Location : Choose location that near to you :)
- Server Size : Choose as your needs (5$)
- Add Auto Backup : No
- Firewall Group : Blank
- Server Hostname & Label : Empty
For Server Image please select Upload ISO and then choose vyos-rolling-release.iso and then click Deploy Now.
After the instance was ready, we can access console to do basic configuration. From Products -> Instance click to three dots, and then click View Console. A new window will open up.
Default username and password to login is vyos.
To start installation process, type install image and left all configuration by default (press enter to continue), especially for This will destroy all data on /dev/vda , confirm it by type Yes. After that, you must set password for login, you can also name this image with anything you like, in this case, i'll give it name as "router" since this will do a router job. After all installation finish, please don't do reboot, but shutdown it (remember that we need to remove ISO image that we attach at first step creating new instance).
To shutdown instance, please switch to root by type sudo su - , and then type this command : shutdown -h now. The instance will shutting down.
Next, we'll need to remove ISO, navigate to Settings -> Custom ISO -> Select "Remove ISO" -> Restart server (top right)
After server booting up, login with username and password that you've set before, enter configuration mode by type config
Basic configuration :
set interface ethernet eth0 address dhcp
set service ssh port 4747
set system name-server 1.1.1.1
set system name-server 9.9.9.9
set system name-server 8.8.8.8
What we config with above command ?
We set eth0 interface to get interface configuration automatically (IP addresses that assigned to this instance), because we just have one IP, is it more easier rather than set it manually (Vultr assign public IP directly rather than private IP to this instance). And then we set ssh service to run on custom port (for security reason) on 4747. Last, we set system resolver using Cloudflare (primary), Quad9 (Secondary) and Google (for backup).
Below is final configuration that we have:
Congratulations, you've just completed first step of VyOS basic configuration, now we can access it using SSH rather than using Vultr Console to do configuration. Next, i'll wrote some configuration for specific case.