You are on page 1of 2

Quick Start

This chapter will guide you on how to get up to speed quickly using your new VyOS system. It
will show you a very basic configuration example that will provide a NAT gateway for a device
with two network interfaces (eth0 and eth1).

Configuration Mode
By default, VyOS is in operational mode, and the command prompt displays a $. To configure
VyOS, you will need to enter configuration mode, resulting in the command prompt displaying a
#, as demonstrated below:

vyos@vyos$ configure
vyos@vyos#

Commit and Save


After every configuration change, you need to apply the changes by using the following
command:

commit

Once your configuration works as expected, you can save it permanently by using the following
command:

save

Interface Configuration
• Your outside/WAN interface will be eth0. It will receive its interface address via DHCP.
• Your internal/LAN interface will be eth1. It will use a static IP address of 192.168.0.1/24.

After switching to Configuration Mode issue the following commands:

set interfaces ethernet eth0 address dhcp


set interfaces ethernet eth0 description 'OUTSIDE'
set interfaces ethernet eth1 address '192.168.0.1/24'
set interfaces ethernet eth1 description 'LAN'
NAT
The following settings will configure SNAT rules for our internal/LAN network, allowing hosts
to communicate through the outside/WAN network via IP masquerade.

set nat source rule 100 outbound-interface name 'eth0'


set nat source rule 100 source address '192.168.0.0/24'
set nat source rule 100 translation address masquerade

Static
Static routes are manually configured routes, which, in general, cannot be updated dynamically
from information VyOS learns about the network topology from other routing protocols.
However, if a link fails, the router will remove routes, including static routes, from the RIPB that
used this interface to reach the next hop. In general, static routes should only be used for very
simple network topologies, or to override the behavior of a dynamic routing protocol for a small
number of routes. The collection of all routes the router has learned from its configuration or
from its dynamic routing protocols is stored in the RIB. Unicast routes are directly used to
determine the forwarding table used for unicast packet forwarding.

Static Routes
set protocols static route <subnet> next-hop <address>

Configure next-hop <address> for an IPv4 static route. Multiple static routes can be created.

set protocols static route <subnet> next-hop <address> disable

Disable this IPv4 static route entry.

set protocols static route <subnet> next-hop <address> distance <distance>

Defines next-hop distance for this route, routes with smaller administrative distance are elected
prior to those with a higher distance.

Range is 1 to 255, default is 1.

You might also like