title: VyOS breadcrumbs:
A Debian-based router OS, forked from Vyatta. Junos-like CLI.
See Installation (VyOS).
vyos
and password vyos
.install image
to run the permanent installation wizard.
Steps to get SSH up ASAP so you can avoid the console. Assumes you already know how to configure VyOS, jump directly to "initial configuration" if not.
vyos
with the password you set during installation.set int eth eth0 address 10.0.0.10/24
(example)set int eth eth0 address dhcp
(example)set protocols static route 0.0.0.0/0 next-hop 10.0.0.1
set system name-server <ip-address>
set system time-zone Europe/Oslo
(example)run show date
set system login <user> authentication plaintext-password "<password>"
delete system login user vyos
set service ssh
An example of a full-ish configuration. Skip any steps already done in "minimum configuartion for remote access".
vyos
and password as set in the installation (or vyos
if using the live media).
configure
$
to #
.set system option keyboard-layout no
(Norwegian)commit
set system host-name <hostname>
set system domain-name <domain-name>
set system name-server <ip-address>
(for each server)set system time-zone Europe/Oslo
(example)delete service ntp server
set service ntp server <server>
(e.g. {0..3}.no.pool.ntp.org
)set system options ctrl-alt-del-action reboot
(or ignore
)run show interfaces ethernet detail
edit interfaces ethernet <if>
show int ...
): set hw-id <mac-addr>
set description <description>
set address <addr>/<prefix-length>
set address dhcp
set address dhcpv6
set ipv6 address autoconf
set firewall interface {local|in|out} {name|ipv6-name} <...>
set protocols static route[6] <0.0.0.0/0|::/0> next-hop <next-hop>
(for IPv4 and IPv6)set service ssh
set service ssh disable-host-validation
set service ssh disable-password-authentication
edit system login user <username>
set authentication plaintext-password "<password>"
encrypted-password
instead of specifying it as plaintext, run openssl passwd -6
on a "safe" machine. (TODO Is this broken in 1.3? It only adds the last characters of the supplied text.)set authentication public-keys <name> type ssh-rsa
set authentication public-keys <name> key <key>
delete system login user vyos
edit interfaces bonding bond<n>
set member interface <if>
set mode 802.3ad
lacp-rate fast
set hash-policy layer2+3
edit vif <VID>
set protocols static route[6] <prefix> blackhole
(for IPv4 and IPv6)set service lldp interface all
edit firewall global-options
set source-validation strict
(uRPF)set all-ping enable
set broadcast-ping disable
set receive-redirects disable
set ipv6-receive-redirects disable
set ip-src-route disable
set ipv6-src-route disable
set log-martians disable
set send-redirects disable
set syn-cookies enable
set twa-hazards-protection disable
-4
and -6
to avoid conflict.\n
.set system login banner pre-login ""
(disable)set system login banner post-login ""
ethtool
stuff to vyos-postconfig-bootup.script
anymore.commit
and save
.$
) after logging in. Enter "configuration mode" (#
) using the configure
command.?
to show alternatives and tab to auto-complete.run
to run operational mode commands in configuration mode.show log [tail]
show interfaces
show ip routes
and show ipv6 routes
show
commit
commit-confirm [comment <comment>] [minutes]
confirm
within N minutes when you've verified that the changes are working as intended.save
Reboot the device and wait for the boot screen. In the boot screen, select the "lost password change (KVM)" option. It will boot to into a prompt asking you to set a new password. After setting a new password, the device will automatically reboot.
This example shows how to download an application to persistent storage and run it at boot as a service.
cd /usr/lib/live/mount/persistence/
opt
dir to store apps in: mkdir opt
and cd opt
.wget <whatever-v0>
and extract it (keep the version number).ln -s <whatever-v0> <whatever>
mkdir systemd
systemd/<whatever>.service
(see example below)./config/scripts/vyos-postconfig-bootup.script
(see example below).systemctl status <whatever>.service
).Example service file (<whatever>.service
):
[Unit]
Description=Node Exporter
After=network.target
[Service]
Type=simple
Restart=always
ExecStart=/usr/lib/live/mount/persistence/opt/node_exporter/node_exporter --collector.interrupts
[Install]
WantedBy=multi-user.target
Example /config/scripts/vyos-postconfig-bootup.script
(excluding old stuff):
# ...
# Enable Node Exporter
if [[ -f /usr/lib/live/mount/persistence/opt/systemd/node-exporter.service ]]; then
ln -s /usr/lib/live/mount/persistence/opt/systemd/node-exporter.service /etc/systemd/system/node-exporter.service
systemctl daemon-reload
systemctl enable --now node-exporter.service
fi
{% include footer.md %}