On 11/24/14 12:57, cprise wrote:
>
> It seems that 'persist-tun' causes the link to hang up when it is auto
> restarted (from SIGUSR1 due to a timeout after a physical disconnect,
> for example). I recommend commenting that option out so the config
> looks like this:
>
> client
> dev tun
> proto udp
> remote
us-east.privateinternetaccess.com 1194
> resolv-retry infinite
> nobind
> persist-key
> #persist-tun
> ca ca.crt
> tls-client
> remote-cert-tls server
> auth-user-pass userpass.txt
> comp-lzo
> verb 1
> reneg-sec 0
> crl-verify crl.pem
>
I found this configuration within a proxyVM doesn't route all traffic
over the VPN tunnel. DNS packets are leaking via the original route
outside of the VPN, and I believe the firewall settings created by
'qubes-setup-dnat-to-ns.sh' is causing this behavior. It can also help
undo the problem if I change /etc/resolv.conf to use the VPN provider's
DNS addresses and then run the script, the following change in iptables
occurs:
(before)
Chain PR-QBS (1 references)
target prot opt source destination
DNAT udp -- anywhere 10.137.2.1 udp
dpt:domain to:10.137.1.1
DNAT udp -- anywhere 10.137.2.254 udp
dpt:domain to:10.137.1.254
(after)
Chain PR-QBS (1 references)
target prot opt source destination
DNAT udp -- anywhere 10.137.2.1 udp dpt:domain
to:209.222.18.222
DNAT udp -- anywhere 10.137.2.254 udp
dpt:domain to:209.222.18.218
I'm not sure why this works, actually. Wireshark in the upstream
firewallvm shows only OpenVPN packets after the change, and the client
VMs can still do name lookups. However, I don't understand the
significance of those destination addresses on subnet 2.x other than
they are defined as nameservers in /var/run/qubes/qubes-ns.
My inclination is to have a single rule in PR-QBS that takes any packet
heading to 'domain' (port 53) at any address and send it to the VPN's
gateway address. But the existing iptables and routing environment in
the proxyVM is complex and I'm not sure if this is correct/secure...