Hi,
I would like to only route DNS request through the vpn tunnel. I can successfully do this when connected on wifi (IPv4) by using the following NEPacketTunnelNetworkSettings:
let dnsSettings = NEDNSSettings(servers: ["208.67.222.123", "208.67.220.123"])
// This overrides system DNS settings
dnsSettings.matchDomains = [""]
networkSettings.dnsSettings = dnsSettings
networkSettings.ipv4Settings?.excludedRoutes = [NEIPv4Route.default()]
networkSettings.ipv4Settings?.includedRoutes = [
NEIPv4Route(destinationAddress: "208.67.222.123", subnetMask: "255.255.255.0"),
NEIPv4Route(destinationAddress: "208.67.220.123", subnetMask: "255.255.255.0")
]
As I understand this basically sets up a split tunnel where only dns traffic is sent to the tunnel, everything else is excluded. I can also see the vpn server is essentially only handling dns queries. I am using openVPN client code integrated into the app connecting to SoftEther VPN.
The problem occurs when the iOS device is connected only with cellular carrier data which is an IPv6 network. Any advice on how to configure the settings to have the same behaviour in IPv6.
When I set the tunnel up with full tunnel on cellular, I can see all traffic routed to the VPN server. It also looks like a DNS request are routed to the VPN server and handled as IPv4 dns request.
Alternatively is there a way to force tunnel to only use ip4 dns.
Any help in me understanding this will be very helpful. Thank you.