I am having CentOS 7.6 version, and I installed test Wireguard VPN server. The whole installation and configuration is pretty easy, at least according to documentation, so what I did, I installed wireguard-tools, wireguard-dkms and linux-headers
next step was, that I generated private and public key of the server, and wrote configuration of the server as:
[Interface] Address = 10.7.0.1/24 ListenPort = 34777 PrivateKey = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= [Peer] PublicKey = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= AllowedIPs = 10.7.0.2/32 [Peer] PublicKey = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= AllowedIPs = 10.7.0.3/32 [Peer] PublicKey = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= AllowedIPs = 10.7.0.4/32 [Peer] PublicKey = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= AllowedIPs = 10.7.0.5/32
from the server side I opened port 34777 udp on a firewall, and set sysctl -w net.ipv4.ip_forward (to enable forwarding) as this server should suppose to forward traffic from client to other servers in the subnet of the VPN server. Now lets imagine that public IP of this server is 18.104.22.168/23
On the client side, configuration looks like this:
[Interface] Address = 10.7.0.4/24 PrivateKey = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= [Peer] PublicKey = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= AllowedIPs = 10.7.0.1/32,22.214.171.124/23 (for having route to 126.96.36.199/23 subnet) or 0.0.0.0/0 Endpoint = 188.8.131.52:34777
now 0.0.0.0/0 means that I will forward all traffic to my VPN (its not mandatory), it can be a split tunnel.... what I don't understand, when I connect, I can ping interface of the server 10.7.0.1, but I cannot ping anything from the network 184.108.40.206/23. Since network 220.127.116.11/23 is public, there is no NAT. Also to mention, on the CentOS I use firewalld instead of iptables.
How and why cannot I see the internal network behind tunneled interface?
P.S. On the picture, between host A and Wireguard server, there is another linux router (a main router), so please keep in mind that.