Назад | Перейти на главную страницу

Конфигурация Strongswan для клиентов windows и android

Кто-нибудь знает, как создать файл ipsec.config по следующему сценарию?

мой публичный ddns в качестве примера - foobar.com

мой адрес шлюза и DHCP-сервер - 192.168.1.254

ikev2 vpn server и dns server - 192.168.1.253

подсеть - 192.168.1.0/24

Я хочу, чтобы мои устройства получали свой IP-адрес от DHCP-сервера и использовали указанный DNS-сервер.

/etc/ipsec.conf:

config setup
    charondebug="ike 1, knl 1, cfg 0"
    uniqueids=never

conn ikev2-vpn
    auto=add
    compress=no
    type=tunnel
    keyexchange=ikev2
    fragmentation=yes
    forceencaps=yes
    dpdaction=clear
    dpddelay=300s
    rekey=no
    
    left=192.168.1.254
    leftid=@foobar.com
    leftcert=server-cert.pem
    leftsendcert=always
    leftsubnet=192.168.1.0/24
    
    right=%any
    rightid=%any
    rightauth=eap-mschapv2
    rightsubnet=192.168.1.0/24
    rightsourceip=192.168.1.0/24
    rightdns=192.168.1.253
    rightsendcert=never
    eap_identity=%identity
    
    ike=aes128-sha256-modp3072,aes128gcm16-prfsha256-ecp256,aes256-sha1-modp1024!
    esp=aes128-sha256,aes128gcm16-ecp256,aes256-sha1!

/etc/strongswan.d/charon/dhcp.conf

dhcp {

    # Always use the configured server address.
    force_server_address = yes

    # Derive user-defined MAC address from hash of IKE identity and send client
    # identity DHCP option.
    identity_lease = yes

    # Interface name the plugin uses for address allocation.
    # interface =

    # Whether to load the plugin. Can also be an integer to increase the
    # priority of this plugin.
    load = yes

    # DHCP server unicast or broadcast IP address.
    server = 192.168.1.255

    # Use the DHCP server port (67) as source port when a unicast server address
    # is configured.
    # use_server_port = no

}

мои устройства не могут подключиться к Интернету с помощью этой конфигурации :(