I have Wireguard server on Rocky 8.7, when I connect to the server I route all client traffic through Wireguard
this is quotes from setup script, of course all variables is set (and all works good)
config for Wireguard server:
cat << EOF | sudo tee -a /etc/wireguard/${WG_INTERFACE}.conf
[Interface]
PostUp = wg set %i private-key /etc/wireguard/${WG_INTERFACE}.pk
Address = 10.0.0.1/32
ListenPort = ${WG_PORT}
[Peer]
PublicKey = ${WG_CLIENT_PUBLIC_KEY}
AllowedIPs = 10.0.0.2/32
EOF
config for Wireguard client:
cat << EOF >> ~/wg_client.conf
[Interface]
PrivateKey = ${WG_CLIENT_PRIVATE_KEY}
Address = 10.0.0.2/32
DNS = 8.8.8.8
[Peer]
PublicKey = ${WG_SERVER_PUBLIC_KEY}
Endpoint = ${SERVER_IP}:${WG_PORT}
AllowedIPs = 0.0.0.0/0
PersistentKeepalive = 25
EOF
server settings for traffic redirection and firewall:
echo 'net.ipv4.ip_forward=1' | sudo tee -a /etc/sysctl.conf 1>/dev/null
sudo firewall-cmd --zone=public --add-port=${WG_PORT}/udp --permanent
sudo firewall-cmd --zone=internal --add-interface=${WG_INTERFACE} --permanent
sudo firewall-cmd --zone=public --add-rich-rule='rule family=ipv4 source address=10.0.0.0/24 masquerade' --permanent
the question is: how to SSH to Wireguard server from Windows client with active VPN connection?