Catalog / VPN Configuration & Management Cheat Sheet
VPN Configuration & Management Cheat Sheet
A handy reference for VPN commands and configurations, covering various aspects of VPN setup, management, and troubleshooting across different platforms and tools. This cheat sheet provides quick access to essential commands and configurations for OpenVPN, WireGuard, IPsec, and common network utilities.
OpenVPN Management
Basic OpenVPN Commands
|
Start OpenVPN client with a specific configuration file. |
|
Start OpenVPN server in daemon mode (background process). |
|
Start OpenVPN client service (using systemd). |
|
Stop OpenVPN server service (using systemd). |
|
Check the status of the OpenVPN client service. |
|
View OpenVPN server logs (using journalctl). |
Configuration File Directives
|
Specifies that this is a client configuration. |
|
Configures OpenVPN server with a specific subnet. |
|
Specifies the remote VPN server address and port. |
|
Uses a TUN (Layer 3) virtual network device. |
|
Uses a TAP (Layer 2) virtual network device. |
|
Uses UDP protocol for the VPN connection. |
|
Uses TCP protocol for the VPN connection. |
|
Enables TLS client mode. |
Troubleshooting
Check OpenVPN logs for error messages. Common issues include certificate errors, firewall problems, and incorrect configuration settings. |
Verify that the OpenVPN service is running using |
Use |
WireGuard Essentials
Basic WireGuard Commands
|
Activate WireGuard interface |
|
Deactivate WireGuard interface |
|
Show current WireGuard status and configuration. |
|
Show configuration and status for interface |
|
Generate a private key and save it to |
|
Generate a public key from a private key and save it to |
Configuration File Parameters
|
Section for interface-specific settings. |
|
Sets the private key for the interface. |
|
Sets the IP address and subnet for the interface. |
|
Sets the port WireGuard listens on. |
|
Section for peer-specific settings. |
|
Sets the peer’s public key. |
|
Sets the allowed IPs for the peer. |
|
Sets the peer’s endpoint (IP address and port). |
Troubleshooting
Ensure that the WireGuard interface is active using |
Verify that the firewall allows UDP traffic on the specified port (default is 51820). |
Use |
IPsec VPN Configuration
StrongSwan Commands
|
Start the IPsec service. |
|
Stop the IPsec service. |
|
Restart the IPsec service. |
|
Check the status of IPsec connections. |
|
Initiate a specific IPsec connection. |
|
Terminate a specific IPsec connection. |
IPsec Configuration Files
|
Main configuration file for IPsec connections. |
|
File containing pre-shared keys or RSA private keys. |
|
Local IP address or identifier. |
|
Remote IP address or identifier. |
|
Automatically start the connection when IPsec starts. |
|
Use IKEv2 key exchange protocol. |
|
IKE (Phase 1) encryption, hash, and DH group. |
|
ESP (Phase 2) encryption and hash algorithm. |
Troubleshooting
Check the IPsec logs for errors. These are typically located in |
Use |
Verify that the firewall rules allow UDP ports 500 and 4500 for IKE and NAT-T traffic, respectively. |
Network Utility Commands
Basic Network Commands
|
Test network connectivity to a host. |
|
Trace the route packets take to reach a host. |
|
Display network interface configuration. |
|
Display the routing table. |
|
Query DNS to find the IP address of a host. |
|
Capture network traffic on a specific interface with a filter. |
VPN-Specific Network Checks
|
Check the configuration of the TUN interface (OpenVPN). |
|
Check the configuration of the TAP interface (OpenVPN). |
|
Check the status of the WireGuard interface. |
|
Ping a host using the TUN interface. |
|
Trace the route via the TUN interface. |
Firewall Commands (iptables)
|
|
|
|
|