Overview:
Author: Diyaa
Published date: August 3rd, 2024
Last updated: August 16th, 2024
This article is documentation of the basic CLI system configuration commands for VyOS Router.
Command Line Syntax:
Operational Mode:
Note
The
#
sign after the hostname indicate that you are in editing mode. This is known as configuration mode on VyOS.
You will see the console look like this after you enter configure mode. This indicates that you are now in config mode. You can use the VyOS command line syntax to make changes to the system configuration.
Configuration Mode:
Note
The
:~$
sign after the hostname indicate that you are not in config mode. This is known as operational mode on VyOS.
You must type the command below to go into configure mode.
Operational Mode Commands in Configuration Mode:
Tip
Using this command in configuration mode allows you to run operational mode commands from configuration mode without having to exit back out to operational mode.
Save Configuration:
You must commit the configuration changes to merge them into the running configuration. You can save the running configuration to the startup configuration after merging the changes into the running configuration.
Commit Configuration Changes:
Tip
Utilize the commit comments to allow for easier system configuration revision review.
This command will merge the system changes into the running system configuration. However, This is not going to merge your configuration changes to the startup config. This means that your changes are not going to persist a reboot.
Show Uncommitted Configuration:
Running the following command in configuration mode will show you what changes have not been committed to the system configuration yet.
Save Configuration to Disk:
Tip
Keep in mind that this command will not merge uncommitted changes. You must merge the changes by committing them as shown in this section.
You need to use the following command to save your configuration and merge it to the system startup config on the disk.
Show Configuration:
You can use the following command to show the full system configuration in configure
mode:
The following command will allow you to see the configuration of the router in command line style:
Change Configuration Mode Hierarchy Level:
You can change the hierarchy level in configuration mode by using the edit
command:
As you can see now we are in the ethernet eth0
section of the config:
To exit out of the hierarchy configuration you can use the exit command:
Change hostname:
Change Interface Address:
Physical Interface Configuration:
Tip
Once again let tab completion be your friend.
Dummy Interface Configuration:
Note
This interface is similar to a loopback interface. You can create multiple dummy interfaces and route their addresses. You can not create aliases to the loopback interface as you would with Cisco IOS.
Show Interfaces Configuration:
Running the following command in configuration mode will show the configuration on all the interfaces:
Configure Static Routes:
Note
This is the simplest way to setup a static route to get the router access to the internet. Use tab completion to see more of the command syntax.
Configure Local User:
Note
Tip
Let tab completion be your friend.
- I am using ed25519 SSH keys. You need to change the command to match the SSH key format you have.
- Replace the SSH with your own key.
- The user password will be hashed and stored in the configuration after you set it.
Customize SSH Service:
Set SSH listen address and port:
Set the allowed SSH MACs:
Set allowed SSH ciphers:
Set System Configuration Revisions:
Note
My example below will save up to 100 revisions.
This command allows you to set how many system configuration revisions must be saved on the disk. You can rollback the configuration if you make a mistake.
You can show system revisions in operational mode:
Restore Default Configuration:
Warning
This will disconnect you if you are connected remotely to the VyOS router.
Load the default config:
Commit your change:
Save the configuration:
Dynamic Routing Commands:
BGP:
Set the BGP autonomous system number instance:
Configure neighbors:
Set the BGP router ID:
Redistribute connected routes into BGP:
Redistribute default route into BGP neighbor:
Related Notes:
- Link to Home-Page.
References:
VyOS 1.3 quick start documentation VyOS documentation - configuration navigation VyOS BGP setup documentation