OPNsense Forum

International Forums => German - Deutsch => Topic started by: rainerle on February 28, 2019, 05:09:11 pm

Title: [SOLVED ] VPN IPSec Mobile Clients: IKEv2: DNS Default Domain und Split DNS
Post by: rainerle on February 28, 2019, 05:09:11 pm
Hallo zusammen!

Bin gerade dabei das VPN einzurichten. Dabei ist mir aufgefallen, das die DNS Default Domain und Split DNS Domains nicht an die Clients übertragen werden.

Mein Gedanke bei "Split DNS" ist, das es sich hierbei um eine domain search list für die Clients handelt. Ist das richtig?

Ich habe beide Felder gesetzt, allerdings kommt nur das hier auf dem Client an
Code: [Select]
Feb 28 16:10:47 vpnclient charon-nm[1907]: 08[CFG] handling INTERNAL_IP4_SUBNET attribute failed
Feb 28 16:10:47 vpnclient charon-nm[1907]: 08[CFG] handling UNITY_DEF_DOMAIN attribute failed
Feb 28 16:10:47 vpnclient NetworkManager[597]: <info>  [1551366647.1438] vpn-connection[0x55a6b16584a0,7d3dc8e4-a748-46ff-8029-18b525304335,"VPN-ACCESS",0]: VPN connection: (IP4 Config Get) reply received from old-style plugin
Feb 28 16:10:47 vpnclient charon-nm[1907]: 08[CFG] handling UNITY_SPLITDNS_NAME attribute failed
Feb 28 16:10:47 vpnclient NetworkManager[597]: <info>  [1551366647.1443] vpn-connection[0x55a6b16584a0,7d3dc8e4-a748-46ff-8029-18b525304335,"VPN-ACCESS",0]: Data: VPN Gateway: XXX.XXX.XXX.XXX
Feb 28 16:10:47 vpnclient charon-nm[1907]: 08[CFG] handling UNITY_SPLITDNS_NAME attribute failed
Feb 28 16:10:47 vpnclient NetworkManager[597]: <info>  [1551366647.1443] vpn-connection[0x55a6b16584a0,7d3dc8e4-a748-46ff-8029-18b525304335,"VPN-ACCESS",0]: Data: Tunnel Device: (null)
Feb 28 16:10:47 vpnclient charon-nm[1907]: 08[CFG] handling UNITY_SPLITDNS_NAME attribute failed
Feb 28 16:10:47 vpnclient NetworkManager[597]: <info>  [1551366647.1444] vpn-connection[0x55a6b16584a0,7d3dc8e4-a748-46ff-8029-18b525304335,"VPN-ACCESS",0]: Data: IPv4 configuration:
Feb 28 16:10:47 vpnclient charon-nm[1907]: 08[CFG] handling UNITY_SPLITDNS_NAME attribute failed
Feb 28 16:10:47 vpnclient NetworkManager[597]: <info>  [1551366647.1444] vpn-connection[0x55a6b16584a0,7d3dc8e4-a748-46ff-8029-18b525304335,"VPN-ACCESS",0]: Data:   Internal Address: 10.20.35.1
Feb 28 16:10:47 vpnclient charon-nm[1907]: 08[CFG] handling UNITY_SPLITDNS_NAME attribute failed
Feb 28 16:10:47 vpnclient NetworkManager[597]: <info>  [1551366647.1444] vpn-connection[0x55a6b16584a0,7d3dc8e4-a748-46ff-8029-18b525304335,"VPN-ACCESS",0]: Data:   Internal Prefix: 32
Feb 28 16:10:47 vpnclient charon-nm[1907]: 08[CFG] handling UNITY_SPLITDNS_NAME attribute failed
Feb 28 16:10:47 vpnclient NetworkManager[597]: <info>  [1551366647.1444] vpn-connection[0x55a6b16584a0,7d3dc8e4-a748-46ff-8029-18b525304335,"VPN-ACCESS",0]: Data:   Internal Point-to-Point Address: 10.20.35.1
Feb 28 16:10:47 vpnclient charon-nm[1907]: 08[CFG] handling UNITY_SPLITDNS_NAME attribute failed
Feb 28 16:10:47 vpnclient NetworkManager[597]: <info>  [1551366647.1444] vpn-connection[0x55a6b16584a0,7d3dc8e4-a748-46ff-8029-18b525304335,"VPN-ACCESS",0]: Data:   Maximum Segment Size (MSS): 0
Feb 28 16:10:47 vpnclient charon-nm[1907]: 08[CFG] handling UNITY_SPLITDNS_NAME attribute failed
Feb 28 16:10:47 vpnclient NetworkManager[597]: <info>  [1551366647.1444] vpn-connection[0x55a6b16584a0,7d3dc8e4-a748-46ff-8029-18b525304335,"VPN-ACCESS",0]: Data:   Forbid Default Route: yes
Feb 28 16:10:47 vpnclient charon-nm[1907]: 08[CFG] handling UNITY_PFS attribute failed
Feb 28 16:10:47 vpnclient NetworkManager[597]: <info>  [1551366647.1444] vpn-connection[0x55a6b16584a0,7d3dc8e4-a748-46ff-8029-18b525304335,"VPN-ACCESS",0]: Data:   Internal DNS: 10.20.30.254
Feb 28 16:10:47 vpnclient charon-nm[1907]: 08[IKE] installing new virtual IP 10.20.35.1
Feb 28 16:10:47 vpnclient NetworkManager[597]: <info>  [1551366647.1444] vpn-connection[0x55a6b16584a0,7d3dc8e4-a748-46ff-8029-18b525304335,"VPN-ACCESS",0]: Data:   DNS Domain: '(none)'
Feb 28 16:10:47 vpnclient charon-nm[1907]: 08[IKE] received ESP_TFC_PADDING_NOT_SUPPORTED, not using ESPv3 TFC padding
Feb 28 16:10:47 vpnclient NetworkManager[597]: <info>  [1551366647.1444] vpn-connection[0x55a6b16584a0,7d3dc8e4-a748-46ff-8029-18b525304335,"VPN-ACCESS",0]: Data: No IPv6 configuration
Feb 28 16:10:47 vpnclient charon-nm[1907]: 08[IKE] CHILD_SA VPN-ACCESS{6} established with SPIs c449b628_i cd1192f2_o and TS 10.20.35.1/32 === 10.0.0.0/8
Feb 28 16:10:47 vpnclient NetworkManager[597]: <info>  [1551366647.1452] vpn-connection[0x55a6b16584a0,7d3dc8e4-a748-46ff-8029-18b525304335,"VPN-ACCESS",0]: VPN connection: (IP Config Get) complete
Feb 28 16:10:47 vpnclient charon-nm[1907]: 08[IKE] received AUTH_LIFETIME of 28033s, scheduling reauthentication in 27433s
Feb 28 16:10:47 vpnclient NetworkManager[597]: <info>  [1551366647.1452] vpn-connection[0x55a6b16584a0,7d3dc8e4-a748-46ff-8029-18b525304335,"VPN-ACCESS",0]: VPN plugin: state changed: started (4)
Feb 28 16:10:47 vpnclient charon-nm[1907]: 08[IKE] peer supports MOBIKE

Mich wundert hier "DNS Domain: '(none)'", obwohl es bei VPN->IPsec->Mobile Clients->DNS Default Domain gesetzt und aktiviert ist...

Kennt jemand das Problem?
Wie bekomme ich eine domain search Liste zu den Clients?

Besten Gruß
Rainer
Title: Re: VPN IPSec Mobile Clients: DNS Default Domain und Split DNS
Post by: rainerle on March 01, 2019, 12:13:11 am
So, jetzt habe ich mal die Konfiguration angeschaut... auf der CLI
Code: [Select]
root@opnsense01:/usr/local/etc # cat strongswan.conf
# Automatically generated, please do not modify
starter {
    load_warning = no
}
charon {
    threads = 16
    ikesa_table_size = 32
    ikesa_table_segments = 4
    init_limit_half_open = 1000
    ignore_acquire_ts = yes
    syslog {
        identifier = charon
        daemon {
            ike_name = yes
            tnc = 4
        }
    }
    install_routes = no
    cisco_unity = yes
    plugins {
        attr {
            subnet = 10.0.0.0/8
            split-include = 10.0.0.0/8
            dns = 10.20.30.254
            # Search domain and default domain
            28674 = contoso.com
            28675 = contoso.com,example.com
            28679 = 2
        }
        eap-radius {
            servers {
                server1 {
                    address = XXX.XXX.XXX.XXX
                    secret = "<PASSWORD>"
                    auth_port = 1812
                }
            }
        }
    }
}
root@opnsense01

Da kommt eine Kommaseparierte Liste. In der Admin GUI beim Feld "Split DNS" werden Kommas verlangt ("Enter a comma-separated list."). Allerdings soll laut Dokumentation des attr Plugins hier eine Space separierte Liste rein...
https://wiki.strongswan.org/projects/strongswan/wiki/Attrplugin

Und das was hier in der Admin GUI gesetzt wird, sind Cisco IPsec Unity Extensions. Muss dann da auf der Gegenseite ein Cisco IPsec Client konfiguriert werden anstatt eines IKEv2Clients?
Title: Re: VPN IPSec Mobile Clients: DNS Default Domain und Split DNS
Post by: rainerle on March 25, 2019, 10:19:57 am
Folgendes habe ich herausgefunden:
Das hängt immer vom Client ab.

Windows 10
Nur der erste Eintrag von leftsubnet wird vom Client verarbeitet. Wenn man 0.0.0.0/0 da stehen hat, wird alles getunnelt (kein Split tunneling mehr). Wenn man mehr wie ein Network zum tunneln pushen will, muss man die zweite und folgende networks entweder per DHCP an den Client schicken oder lokal am Client per PowerShell konfigurieren ("Add-VpnConnectionRoute -ConnectionName "Contoso VPN" -DestinationPrefix 10.0.0.0/8"). Mit Set-VpnConnectionTriggerDnsConfiguration -ConnectionName "Contoso VPN" -DnsSuffixSearchList "10.0.0.0/8",... werden dann noch die split DNS domain names lokal konfiguriert.

MacOS
Split tunneling funktioniert bei MacOS und iOS out-of-the-box, auch mit mehr wie einem leftsubnet. Bei neueren MacOS Geräten wird die IKEv2 Payload Option 25 ausgewertet, somit kann man Split DNS an der OPNsense konfigurieren (Ab 19.1.5... ). Die übergebenen split DNS domain names landen auch in der DNS search domain Liste! Bei iOS nicht, hier muss man weiter mit FQDNs arbeiten.

Linux
Split tunneling funktioniert beim strongswan als IKEv2 client out-of-the-box, auch mit mehr wie einem leftsubnet. Für split DNS domain names muss man einen lokalen DNS server installieren (dnsmasq) und die umzuleitenden DNS domain namen manuell konfigurieren.

StrongSwan client auf Android
Split tunneling funktioniert beim strongswan als IKEv2 client out-of-the-box, auch mit mehr wie einem leftsubnet.
Split DNS domain names funktionieren als FQDNs.

ChromeBooks
Habe weder Split tunneling noch split DNS zum Laufen bekommen. Der ChromeOS VPN Client kann kein IKEv2 (siehe https://forum.opnsense.org/index.php?topic=12141.0 ). Mit dem Android StrongSwan Client und chrome://flags#arc-vpn hat es auch nicht funktioniert (siehe https://wiki.strongswan.org/issues/2989 ).