Mac OSX VPN und DNS Abfragen

Wenn ich unterwegs bin, nutze ich in fremden Netzen natürlich eine VPN-Verbindung zu meinem Server mittels L2TP/IPSEC. Die Verbindung zum VPN-Server funktioniert tadellos. Allerdings habe ich einige Probleme mit dem DNS. Bei bestehender VPN-Verbindung gehen die Anfragen am VPN vorbei und mit der öffentlichen IP des UMTS-Providers zum Beispiel raus. Bei meinem Nameserver werden solche Anfragen abgelehnt (allow-recursion { ournets;} ;).

Hier mal ein bißchen Config im Überblick: 

OSX ifconfig ppp0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1500
    inet 10.148.224.25 –> 10.64.64.64 netmask 0xff000000
ppp1: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1280
    inet 178.63.123.171 –> 178.63.83.104 netmask 0xffff0000
 
OSX netstat -rn Internet:
Destination        Gateway            Flags        Refs      Use   Netif Expire
default            178.63.83.104      UGSc           18       10    ppp1
default            10.64.64.64        UGScI           3        0    ppp0
10                 ppp0               USc             1        0    ppp0
10.64.64.64        10.148.224.25      UH              5       12    ppp0
127                127.0.0.1          UCS             0        0     lo0
127.0.0.1          127.0.0.1          UH              1     5330     lo0
178.63             ppp1               USc             1        0    ppp1
178.63.83.104      10.64.64.64        UGHS           31     2741    ppp0
 
OSX /etc/resolv.conf nameserver 178.63.83.104
nameserver 192.168.0.1
VPN Server syslog named[27551]: client 89.204.153.153#12738: query (cache) ‘heise.de/A/IN’ denied

Per UMTS bekomme ich eine RC1918 IP (10.148.224.25 auf ppp0) und per VPN weise ich mir eine öffentliche IP zu (178.63.123.171 auf ppp1). Bei den VPN-Einstellungen in OSX ist konfiguriert, daß der gesamte Verkehr über die VPN-Verbindung gehen soll. Wie man aber am syslog Auszug vom VPN-Server sehen kann, werden die Anfragen zwar an den richtigen Nameserver gestellt, allerdings von der öffentlichen IP des UMTS-Providers aus. Diese steht natürlich nicht in der Nameserver-Konfiguration in ACL für ournets drin, also der berechtigten Hosts, die auch für rekursive Abfragen Anfragen stellen dürfen.

Die Frage ist also, wie man es OSX beibringt, auch DNS Anfragen über den VPN-Tunnel zu routen? Hat da jemand eine Idee oder Lösung? Als ich selber RFC 1918 IPs benutzt und diese genattet habe, hat alles funktioniert. Seit ich die öffentliche IP benutze, funktioniert es nicht mehr. Strange.

Uncategorized

2 thoughts on “Mac OSX VPN und DNS Abfragen

  1. Hatte mal das gleiche Problem
    Hatte mal das gleiche Problem und hatte folgende Lösung gefunden:

    I had the same issue a long time, but now I had time to find a solution that works for me. I didn’t changed the order of the DNS server, but i’m using the dns server behind the VPN permanently.

    I connected via dial-up

    I connected the VPN connection and copy the DNS server IPs and the search domain from VPN Connection > Advanced > DNS

    Disconnect the VPN connection

    ping or name your VPN server address and write down the ip

    Disconnect the dial-up connection

    Duplicate the dial-up connection (e.g. name it “3G for VPN”)

    Enter the IPs and the search domain into the DNS tab of the dial-up connection. They will be stored and used permanent

    Connect via the new dial-up connection

    Now you have no access to the nameservers (because they are secured by the VPN), you have to edit the server address of the VPN connection. Replace the host by the ip.

    Connect via VPN connection and you should be able to use it

    Note: In general hostnames does not change, but IPs can. So if it’s not working someday, do the steps again…

    Hope that will work for others, too… Good luck 🙂

    URL: http://apple.stackexchange.com/questions/73076/mac-os-x-mountain-lion-dns-resolving-uses-wrong-order-on-vpn-via-dial-up-conne

Comments are closed.