Specify configuration parameters for VPN server.
# Configuration parameters VPN_PORT="22"
Generate and exchange keys between server and client. Set up key-based authentication.
# Server private key VPN_KEY="/etc/dropbear/dropbear_ed25519_host_key" # Generate server public key dropbearkey -y -f ${VPN_KEY} \ | sed -n -e "/^ssh-\S*\s/p" > sshserver.pub # Client public key VPN_PUB="$(cat sshclient.pub)" # Configure PKI cat << EOF >> /etc/dropbear/authorized_keys ${VPN_PUB} EOF
Consider VPN network as private. Assign VPN interface to LAN zone to minimize firewall setup. Allow access to VPN server from WAN zone.
# Configure firewall uci rename firewall.@zone[0]="lan" uci rename firewall.@zone[1]="wan" uci del_list firewall.lan.device="ppp+" uci add_list firewall.lan.device="ppp+" uci -q delete firewall.pppossh uci set firewall.pppossh="rule" uci set firewall.pppossh.name="Allow-PPPoSSH" uci set firewall.pppossh.src="wan" uci set firewall.pppossh.dest_port="${VPN_PORT}" uci set firewall.pppossh.proto="tcp" uci set firewall.pppossh.target="ACCEPT" uci commit firewall service firewall restart
Configure VPN service. Disable password authentication.
# Configure VPN service uci set dropbear.@dropbear[0].Port="${VPN_PORT}" uci set dropbear.@dropbear[0].PasswordAuth="0" uci set dropbear.@dropbear[0].RootPasswordAuth="0" uci commit dropbear service dropbear restart
Establish the VPN connection. Verify your routing with traceroute and traceroute6.
traceroute openwrt.org traceroute6 openwrt.org
Check your IP and DNS provider.
On router:
On client device depending on wireguard software:
Collect and analyze the following information.
# Restart services service log restart; service dropbear restart; sleep 10 # Log and status logread -e dropbear; netstat -l -n -p | grep -e dropbear # Runtime configuration pgrep -f -a dropbear; pgrep -f -a pppd ip address show; ip route show table all ip rule show; ip -6 rule show; nft list ruleset # Persistent configuration uci show network; uci show firewall; uci show dropbear