Example #1
0
    # In this example we make 100 addresses available (from .11 to .210) on
    # subnet  192.168.100.0/24
    vpn.set_l2tp_remote_access_client_ip_pool(start=client_ip_pool_start,
                                              end=client_ip_pool_end)

    # Set the IPsec authentication mode to 'x509'
    vpn.set_l2tp_remote_access_ipsec_auth_mode(mode=ipsec_auth_mode)

    # Specify the location of the CA certificate
    vpn.set_l2tp_remote_access_ipsec_auth_ca_cert_file(ca_cert_file)

    # Specify the location of the server certificate
    vpn.set_l2tp_remote_access_ipsec_auth_srv_cert_file(srv_crt_file)

    # Specify the location of the certificate revocation list (CRL) file
    vpn.set_l2tp_remote_access_ipsec_auth_crl_file(path=crl_file)

    # Specify the location of the server key file
    vpn.set_l2tp_remote_access_ipsec_auth_srv_key_file(srv_key_file)

    # Specify the password for the server key file
    vpn.set_l2tp_remote_access_ipsec_auth_srv_key_pswd(srv_key_pswd)

    # Set the L2TP remote access user authentication mode to 'local'
    vpn.set_l2tp_remote_access_user_auth_mode(l2tp_auth_mode)

    # Set the L2TP remote access user credentials ('username'/'password')
    vpn.set_l2tp_remote_access_user(name=uname1, pswd=upswd1)
    vpn.set_l2tp_remote_access_user(name=uname2, pswd=upswd2)
    vpn.set_l2tp_remote_access_user(name=uname3, pswd=upswd3)
Example #2
0
    # In this example we make 100 addresses available (from .11 to .210) on
    # subnet  192.168.100.0/24
    vpn.set_l2tp_remote_access_client_ip_pool(start=client_ip_pool_start,
                                              end=client_ip_pool_end)

    # Set the IPsec authentication mode to 'x509'
    vpn.set_l2tp_remote_access_ipsec_auth_mode(mode=ipsec_auth_mode)

    # Specify the location of the CA certificate
    vpn.set_l2tp_remote_access_ipsec_auth_ca_cert_file(ca_cert_file)

    # Specify the location of the server certificate
    vpn.set_l2tp_remote_access_ipsec_auth_srv_cert_file(srv_crt_file)

    # Specify the location of the certificate revocation list (CRL) file
    vpn.set_l2tp_remote_access_ipsec_auth_crl_file(path=crl_file)

    # Specify the location of the server key file
    vpn.set_l2tp_remote_access_ipsec_auth_srv_key_file(srv_key_file)

    # Specify the password for the server key file
    vpn.set_l2tp_remote_access_ipsec_auth_srv_key_pswd(srv_key_pswd)

    # Set the L2TP remote access user authentication mode to 'local'
    vpn.set_l2tp_remote_access_user_auth_mode(l2tp_auth_mode)

    # Set the L2TP remote access user credentials ('username'/'password')
    vpn.set_l2tp_remote_access_user(name=uname1, pswd=upswd1)
    vpn.set_l2tp_remote_access_user(name=uname2, pswd=upswd2)
    vpn.set_l2tp_remote_access_user(name=uname3, pswd=upswd3)