VyOS

VyOS Cheatsheet #

VyOS is an open-source network operating system based on Linux, providing features such as routing, firewall, and VPN functionalities. This cheatsheet covers common commands and configurations for VyOS.

Basic Commands #

Command/OptionExampleDescription
configureconfigureEnter configuration mode
commitcommitCommit changes to the configuration
savesaveSave the current configuration
exitexitExit configuration mode
showshowDisplay system information
rebootrebootReboot the system
shutdownshutdownShut down the system
system rebootsystem rebootReboot the system
system shutdownsystem shutdownShut down the system

Network Interface Configuration #

Command/OptionExampleDescription
configureconfigureEnter configuration mode
set interfaces ethernet eth0 address 192.168.1.1/24set interfaces ethernet eth0 address 192.168.1.1/24Configure IP address for interface eth0
set interfaces ethernet eth0 description "WAN"set interfaces ethernet eth0 description "WAN"Set description for interface eth0
commitcommitCommit changes to the configuration
savesaveSave the current configuration
exitexitExit configuration mode
show interfacesshow interfacesDisplay interface status

VLAN Configuration #

Command/OptionExampleDescription
configureconfigureEnter configuration mode
set interfaces ethernet eth0 vif 10 address 192.168.10.1/24set interfaces ethernet eth0 vif 10 address 192.168.10.1/24Configure VLAN 10 on interface eth0
set interfaces ethernet eth0 vif 10 description "Management VLAN"set interfaces ethernet eth0 vif 10 description "Management VLAN"Set description for VLAN 10
commitcommitCommit changes to the configuration
savesaveSave the current configuration
exitexitExit configuration mode
show interfacesshow interfacesDisplay interface and VLAN status

Firewall Configuration #

Command/OptionExampleDescription
configureconfigureEnter configuration mode
set firewall name WAN_IN rule 10 action acceptset firewall name WAN_IN rule 10 action acceptSet firewall rule action to accept
set firewall name WAN_IN rule 10 source address 192.168.1.0/24set firewall name WAN_IN rule 10 source address 192.168.1.0/24Set source address for firewall rule
set firewall name WAN_IN rule 10 destination port 80set firewall name WAN_IN rule 10 destination port 80Set destination port for firewall rule
commitcommitCommit changes to the configuration
savesaveSave the current configuration
exitexitExit configuration mode
show firewallshow firewallDisplay firewall rules and status

VPN Configuration #

Command/OptionExampleDescription
configureconfigureEnter configuration mode
set vpn ipsec ipsec-site-to-site peer 203.0.113.1set vpn ipsec ipsec-site-to-site peer 203.0.113.1Set VPN peer IP address
set vpn ipsec ipsec-site-to-site peer 203.0.113.1 authentication id "vpnuser"set vpn ipsec ipsec-site-to-site peer 203.0.113.1 authentication id "vpnuser"Set VPN authentication ID
set vpn ipsec ipsec-site-to-site peer 203.0.113.1 authentication password "vpnpassword"set vpn ipsec ipsec-site-to-site peer 203.0.113.1 authentication password "vpnpassword"Set VPN authentication password
commitcommitCommit changes to the configuration
savesaveSave the current configuration
exitexitExit configuration mode
show vpn ipsecshow vpn ipsecDisplay VPN IPsec status

Routing Configuration #

Command/OptionExampleDescription
configureconfigureEnter configuration mode
set protocols static route 0.0.0.0/0 next-hop 192.168.1.1set protocols static route 0.0.0.0/0 next-hop 192.168.1.1Set default route
commitcommitCommit changes to the configuration
savesaveSave the current configuration
exitexitExit configuration mode
show ip routeshow ip routeDisplay routing table

This cheatsheet provides essential VyOS commands for network configuration, firewall rules, VPNs, and routing. For more detailed information, consult the VyOS documentation.

VyOS

Explore our comprehensive cheatsheets to enhance your knowledge and efficiency. Each cheatsheet provides detailed command options, examples, and descriptions to help you master various tools and technologies.