Closed JesperLindberg closed 4 years ago
The problem is that CentOS 8 does not set DNS with systemd-resolved
even though the service is running. For setting the dns with systemd-resolved
and thereby use the script update-systemd-resolved
, you have to edit /etc/NetworkManager/NetworkManager.conf
and in the [main]
section, set: dns=systemd-resolved
.
More information on the topic: CHAPTER 33. USING DIFFERENT DNS SERVERS FOR DIFFERENT DOMAINS.
So I tried to setup a split tunnel on my server (my server is the vpn-client). Where a vpn-user would only be able to access the internet with the VPN interface (tun0).
I've followed and tried to "translate" a ubuntu guide to CentOS 8. The guide I have been following is Force Torrent which has been inspired by Force Torrent Traffic through VPN Split Tunnel Debian 8 + Ubuntu 16.04 and then I applied the updates I found in Split Tunnel Guide for Ubuntu 18.04.
This resulted in the following files:
Code/Scripts: (Results below)
/etc/systemd/system/openvpn@openvpn.service
:/etc/openvpn/openvpn.conf
:/etc/openvpn/firewalld.sh
:/etc/openvpn/routing.sh
:/etc/iproute2/rt_tables
:/etc/sysctl.d/9999-vpn.conf
:Results:
Using the command to check for DNS:
systemd-resolve --status
Checking VPN public IP with:
sudo -u vpn -i -- curl ipinfo.io
gave me:curl: (6) Could not resolve host: ipinfo.io
. Whilesudo curl ipinfo.io --interface tun0
works fine. I also get issues whenping www.google.se
as the vpn-user, but if I instead use the IP of that domain, it works fine.