Basic setup

From VyOS Wiki
Jump to: navigation, search

After following the Installation guide, you then need to assign your first IP address to your VyOS device.

Determining correct Interface

If your VyOS machine has more than one interface, you may be unsure which interface to use. Plug the network cable into the interface you want to use, and run the command 'show interfaces'. This will show you the link state of every interface detected on the machine.

vyos@example.com:~$ show interfaces
Codes: S - State, L - Link, u - Up, D - Down, A - Admin Down
Interface        IP Address                        S/L  Description
---------        ----------                        ---  -----------
eth0             -                                 u/u  <-- Note that this has the link UP
eth1             -                                 u/D
eth2             -                                 u/D
eth3             -                                 u/D
lo               127.0.0.1/8                       u/u
                 ::1/128
vyos@example.com:~$

In this case, eth0 is the interface we want to use. This will be our 'internal' interface.

Assigning an IP to an Interface

To change anything on your VyOS machine, you need to enter configure mode. This is done by typing 'configure' and pushing enter. When you do that, your prompt will change to signify this.

vyos@example.com:~$ configure
[edit]
vyos@example.com# 

As part of our examples, the 'internal' network will be 172.16.17.0/24. So we are going to assign 172.16.17.1 to this interface.

vyos@example.com# set interfaces ethernet eth2 address 172.16.17.1/24
[edit]
vyos@example.com#

Note that changes are not applied or saved automatically! You can build your changes up in a batch, and apply them all at once. To apply changes, type 'commit'.

vyos@example.com# commit
[edit]
vyos@example.com#

Running 'commit' validates your changes are correct, and then applies them to the system. It does not save them! If you make a mistake, or a typo, this allows you to reboot the device to return to the previously working configuration.

To save your changes so they are applied the next time the machine reboots, run 'save'.

vyos@example.com# save
Saving configuration to '/config/config.boot'...
Done
[edit]
vyos@example.com#

At this point you should then enable ssh access to your VyOS device to configure with configuration.