DevOps Engineer

VyOS Network configuration

VyOS boot screen

VyOS boot screen

I like to have a separate network for testing purposes. We could call it my playground network.
To achieve this, I use VyOS on my ESX server. I run this on my ESX server since I prefer to use VMware for my test environment.
More about my preferred playground hypervisor environment on: https://www.devopsengineer.eu/nutanix-ce-versus-vmware-esx-as-home-lab/
Why? I just do not want to mix my home network (which is configured more or less normal for maximum 254 IP addresses) with my test environment.
When I connect to the control panel of my router, I don’t want to see a bunch of stuff I only use to test.
Also, at some point when playing too much, at some point 254 IP addresses just ain’t enough.
This is why I’ve chosen for a /22 netmask.

Anyway, let’s talk about a very simple VyOS network configuration which works just fine for this goal.

First we need to install it. Create a new virtual machine, give it some CPU, some memory and a some hard drive.
Download the ISO from their official website: https://downloads.vyos.io/?dir=rolling/current/amd64

The screenshot below illustrates some example which runs fine on my environment.
Boot from the ISO.
Login with vyos/vyos
Type ‘install image‘ to begin installation and follow the instructions. (check out https://wiki.vyos.net/wiki/Installation if required)

VyOS virtual machine settings. An example of possible VM settings to run VyOS.

It must have two network cards in order to communicate with both networks: my home network and my test network.

Below you can find my example configuration file, which is ideal for my own environment.
There might be some items on it you will not need yourself, or some stuff you need might be missing 😉

set interfaces ethernet eth0 address 'dhcp'
set interfaces ethernet eth0 description 'MAIN'
set interfaces ethernet eth0 hw-id '00:0c:29:cc:xx:xx'
set interfaces ethernet eth1 address '10.99.0.1/22'
set interfaces ethernet eth1 description 'LAB'
set interfaces ethernet eth1 hw-id '00:0c:29:cc:xx:xx'
set interfaces loopback lo
set nat source rule 100 outbound-interface 'eth0'
set nat source rule 100 source address '10.99.0.0/22'
set nat source rule 100 translation address 'masquerade'
set protocols static route 10.81.70.0/24 next-hop 10.81.70.1 distance '1'
set service dhcp-server shared-network-name LAN subnet 10.99.0.0/22 default-router '10.99.0.1'
set service dhcp-server shared-network-name LAN subnet 10.99.0.0/22 dns-server '10.99.0.1'
set service dhcp-server shared-network-name LAN subnet 10.99.0.0/22 domain-name 'wlab'
set service dhcp-server shared-network-name LAN subnet 10.99.0.0/22 lease '500000'
set service dhcp-server shared-network-name LAN subnet 10.99.0.0/22 range 0 start '10.99.0.30'
set service dhcp-server shared-network-name LAN subnet 10.99.0.0/22 range 0 stop '10.99.3.240'
set service dhcp-server shared-network-name LAN subnet 10.99.0.0/22 static-mapping DC1 ip-address '10.99.0.10'
set service dhcp-server shared-network-name LAN subnet 10.99.0.0/22 static-mapping DC1 mac-address '00:0C:29:1D:25:23'
set service dns forwarding allow-from '10.99.0.0/22'
set service dns forwarding cache-size '0'
set service dns forwarding domain pigeon.net server '10.99.0.10'
set service dns forwarding listen-address '10.99.0.1'
set service dns forwarding name-server '8.8.8.8'
set service dns forwarding name-server '8.8.9.9'
set service ssh port '22'
set system config-management commit-revisions '100'
set system console device ttyS0 speed '115200'
set system host-name 'VyOS-1'
set system login user vyos authentication encrypted-password 'xxxxxxxxxxxxxxxxxxxxxxxxx'
set system login user vyos authentication plaintext-password ''
set system login user vyos level 'admin'
set system ntp server 0.pool.ntp.org
set system ntp server 1.pool.ntp.org
set system ntp server 2.pool.ntp.org
set system syslog global facility all level 'info'
set system syslog global facility protocols level 'debug'

 

Exit mobile version