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/Option | Example | Description |
---|
configure | configure | Enter configuration mode |
commit | commit | Commit changes to the configuration |
save | save | Save the current configuration |
exit | exit | Exit configuration mode |
show | show | Display system information |
reboot | reboot | Reboot the system |
shutdown | shutdown | Shut down the system |
system reboot | system reboot | Reboot the system |
system shutdown | system shutdown | Shut down the system |
Network Interface Configuration
#
Command/Option | Example | Description |
---|
configure | configure | Enter configuration mode |
set interfaces ethernet eth0 address 192.168.1.1/24 | set interfaces ethernet eth0 address 192.168.1.1/24 | Configure IP address for interface eth0 |
set interfaces ethernet eth0 description "WAN" | set interfaces ethernet eth0 description "WAN" | Set description for interface eth0 |
commit | commit | Commit changes to the configuration |
save | save | Save the current configuration |
exit | exit | Exit configuration mode |
show interfaces | show interfaces | Display interface status |
VLAN Configuration
#
Command/Option | Example | Description |
---|
configure | configure | Enter configuration mode |
set interfaces ethernet eth0 vif 10 address 192.168.10.1/24 | set interfaces ethernet eth0 vif 10 address 192.168.10.1/24 | Configure 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 |
commit | commit | Commit changes to the configuration |
save | save | Save the current configuration |
exit | exit | Exit configuration mode |
show interfaces | show interfaces | Display interface and VLAN status |
Firewall Configuration
#
Command/Option | Example | Description |
---|
configure | configure | Enter configuration mode |
set firewall name WAN_IN rule 10 action accept | set firewall name WAN_IN rule 10 action accept | Set firewall rule action to accept |
set firewall name WAN_IN rule 10 source address 192.168.1.0/24 | set firewall name WAN_IN rule 10 source address 192.168.1.0/24 | Set source address for firewall rule |
set firewall name WAN_IN rule 10 destination port 80 | set firewall name WAN_IN rule 10 destination port 80 | Set destination port for firewall rule |
commit | commit | Commit changes to the configuration |
save | save | Save the current configuration |
exit | exit | Exit configuration mode |
show firewall | show firewall | Display firewall rules and status |
VPN Configuration
#
Command/Option | Example | Description |
---|
configure | configure | Enter configuration mode |
set vpn ipsec ipsec-site-to-site peer 203.0.113.1 | set vpn ipsec ipsec-site-to-site peer 203.0.113.1 | Set 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 |
commit | commit | Commit changes to the configuration |
save | save | Save the current configuration |
exit | exit | Exit configuration mode |
show vpn ipsec | show vpn ipsec | Display VPN IPsec status |
Routing Configuration
#
Command/Option | Example | Description |
---|
configure | configure | Enter configuration mode |
set protocols static route 0.0.0.0/0 next-hop 192.168.1.1 | set protocols static route 0.0.0.0/0 next-hop 192.168.1.1 | Set default route |
commit | commit | Commit changes to the configuration |
save | save | Save the current configuration |
exit | exit | Exit configuration mode |
show ip route | show ip route | Display routing table |
This cheatsheet provides essential VyOS commands for network configuration, firewall rules, VPNs, and routing. For more detailed information, consult the VyOS documentation.