Fortinet black logo

Handbook

Configuration overview

6.0.0
Copy Link
Copy Doc ID 4afb0436-a998-11e9-81a4-00505692583a:299180
Download PDF

Configuration overview

The following section consists of configuring the FortiGate unit and configuring the Windows PC.

Configuring the FortiGate unit

To configure the FortiGate unit, you must:

  • Configure LT2P users and firewall user group.
  • Configure the L2TP VPN, including the IP address range it assigns to clients.
  • Configure an IPsec VPN with encryption and authentication settings that match the Microsoft VPN client.
  • Configure security policies.

Configuring LT2P users and firewall user group

Remote users must be authenticated before they can request services and/or access network resources through the VPN. The authentication process can use a password defined on the FortiGate unit or an established external authentication mechanism such as RADIUS or LDAP.

Creating user accounts

You need to create user accounts and then add these users to a firewall user group to be used for L2TP authentication. The Microsoft VPN client can automatically send the user’s Window network logon credentials. You might want to use these for their L2TP user name and password.

Creating a user account - GUI
  1. Go to User & Device > User Definitionand select Create New.
  2. Enter the User Name.
  3. Do one of the following:
    • Select Password and enter the user’s assigned password.
    • Select Match user on LDAP server, Match user on RADIUS server, or Match user onTACACS+ server and select the authentication server from the list. The authentication server must be already configured on the FortiGate unit.
  4. Select OK.
Creating a user account - CLI

To create a user account called user1 with the password 123_user, enter:

config user local

edit user1

set type password

set passwd "123_user"

set status enable

end

Creating a user group

When clients connect using the L2TP-over-IPsec VPN, the FortiGate unit checks their credentials against the user group you specify for L2TP authentication. You need to create a firewall user group to use for this purpose.

Creating a user group - GUI
  1. Go to User & Device > User Groups, select Create New, and enter the following:
  2. Name

    Type or edit the user group name (for example, L2TP_group).

    Type

    Select Firewall.

    Available Users/Groups

    The list of Local users, RADIUS servers, LDAP servers, TACACS+ servers, or PKI users that can be added to the user group. To add a member to this list, select the name and then select the right arrow button.

    Members

    The list of Local users, RADIUS servers, LDAP servers, TACACS+ servers, or PKI users that belong to the user group. To remove a member, select the name and then select the left arrow button.

  3. Select OK.
Creating a user group - CLI

To create the user group L2TP_group and add members User_1, User_2, and User_3, enter:

config user group

edit L2TP_group

set group-type firewall

set member User_1 User_2 User_3

end

Configuring L2TP

You can only configure L2TP settings in the CLI. As well as enabling L2TP, you set the range of IP address values that are assigned to L2TP clients and specify the user group that can access the VPN. For example, to allow access to users in the L2TP_group and assign them addresses in the range 192.168.0.50 to 192.168.0.59, enter:

config vpn l2tp

set sip 192.168.0.50

set eip 192.168.0.59

set status enable

set usrgrp "L2TP_group"

end

One of the security policies for the L2TP over IPsec VPN uses the client address range, so you need also need to create a firewall address for that range. For example,

config firewall address

edit L2TPclients

set type iprange

set start-ip 192.168.0.50

set end-ip 192.168.0.59

end

Alternatively, you could define this range in the GUI.

Configuring IPsec

The Microsoft VPN client uses IPsec for encryption. The configuration needed on the FortiGate unit is the same as for any other IPsec VPN with the following exceptions.

  • Transport mode is used instead of tunnel mode.
  • The encryption and authentication proposals must be compatible with the Microsoft client.

note icon

Whether Transport mode is required depends on the configuration of the peer device (typically an old Windows device, since newer versions of Windows don't require IPsec and L2TP—they can run IPsec natively).

caution icon

When configuring L2TP, do not name the VPN "L2TP" as that will result in a conflict.

L2TP over IPsec is supported on the FortiGate unit for both policy-based and route-based configurations, but the following example is policy-based.

Configuring Phase 1 - GUI
  1. Go to VPN > IPsec Tunnels and create the new custom tunnel or edit an existing tunnel.
  2. Edit the Phase 1 Proposal (if it is not available, you may need to click the Convert to Custom Tunnel button).
  3. Name

    Enter a name for this VPN, dialup_p1 for example.

    Remote Gateway

    Dialup User

    Local Interface

    Select the network interface that connects to the Internet. For example, port1.

    Mode

    Main (ID protection)

    Authentication Method

    Preshared Key

    Pre-shared Key

    Enter the preshared key. This key must also be entered in the Microsoft VPN client.

    Advanced

    Select Advanced to enter the following information.

    Phase 1 Proposal

    Enter the following Encryption/Authentication pairs:

    AES256-MD5, 3DES-SHA1, AES192-SHA1

    Diffie-Hellman Group

    2

    NAT Traversal

    Enable

    Dead Peer Detection

    Enable

Configuring Phase 1 - CLI

To create a Phase 1 configuration called dialup_p1 on a FortiGate unit that has port1 connected to the Internet, you would enter:

config vpn ipsec phase1

edit dialup_p1

set type dynamic

set interface port1

set mode main

set psksecret ********

set proposal aes256-md5 3des-sha1 aes192-sha1

set dhgrp 2

set nattraversal enable

set dpd [disable | on-idle | on-demand]

end

note icon

It is worth noting here that the command config vpn ipsec phase1 is used rather than config vpn ipsec phase1-interface because this configuration is policy-based and not route-based.

Configuring Phase 2 - GUI
  1. Open the Phase 2 Selectors panel.
  2. Enter the following information and then select OK.
  3. Phase 2 Proposal

    Enter the following Encryption/Authentication pairs:

    AES256-MD5, 3DES-SHA1, AES192-SHA1

    Enable replay detection

    Enable

    Enable perfect forward secrecy (PFS)

    Disable

    Keylife

    3600 seconds

  4. Make this a transport-mode VPN. You must use the CLI to do this. If your Phase 2 name is dialup_p2, you would enter:

config vpn ipsec phase2

edit dialup_p2

set encapsulation transport-mode

end

Configuring Phase 2 - CLI

To configure a Phase 2 to work with your phase_1 configuration, you would enter:

config vpn ipsec phase2

edit dialup_p2

set phase1name dialup_p1

set proposal aes256-md5 3des-sha1 aes192-sha1

set replay enable

set pfs disable

set keylifeseconds 3600

set encapsulation transport-mode

end

note icon

Once again, note here that the command config vpn ipsec phase2 is used rather than config vpn ipsec phase2-interface because this configuration is policy-based and not route-based.

Configuring security policies

The security policies required for L2TP over IPsec VPN are:

  • An IPsec policy, as you would create for any policy-based IPsec VPN
  • A regular ACCEPT policy to allow traffic from the L2TP clients to access the protected network
Configuring the IPsec security policy - GUI
  1. Go to System > Feature Visibility and enable Policy-based IPsec VPN.
  2. Go to Policy & Objects > IPv4 Policy and select Create New.
  3. Set the Action to IPsec and enter the following information:
  4. Incoming Interface

    Select the interface that connects to the private network behind this FortiGate unit.

    Source Address

    All

    Outgoing Interface

    Select the FortiGate unit’s public interface.

    Destination Address

    All

    VPN Tunnel

    Select Use Existing and select the name of the Phase 1 configuration that you created. For example, dialup_p1. See Configuring IPsec.

    Allow traffic to be initiated from the remote site

    enable

  5. Select OK.
Configuring the IPsec security policy - CLI

If your VPN tunnel (Phase 1) is called dialup_p1, your protected network is on port2, and your public interface is port1, you would enter:

config firewall policy

edit 0

set srcintf port2

set dstintf port1

set srcaddr all

set dstaddr all

set action ipsec

set schedule always

set service ALL

set inbound enable

set vpntunnel dialup_p1

end

Configuring the ACCEPT security policy - GUI
  1. Go to Policy & Objects > IPv4 Policy and select Create New.
  2. Leave the Policy Type as Firewall and leave the Policy Subtype as Address.
  3. Enter the following information and select OK:
  4. Incoming Interface

    Select the FortiGate unit’s public interface.

    Source Address

    Select the firewall address that you defined for the L2TP clients.

    Outgoing Interface

    Select the interface that connects to the private network behind this FortiGate unit.

    Destination Address

    All

    Action

    ACCEPT

Configuring the ACCEPT security policy - CLI

If your public interface is port1, your protected network is on port2, and L2TPclients is the address range that L2TP clients use, you would enter:

config firewall policy

edit 1

set srcintf port1

set dstintf port2

set srcaddr L2TPclients

set dstaddr all

set action accept

set schedule always

set service ALL

end

Configuring the Windows PC

Configuration of the Windows PC for a VPN connection to the FortiGate unit consists of the following:

  1. In Network Connections, configure a Virtual Private Network connection to the FortiGate unit.
  2. Ensure that the IPSEC service is running.
  3. Ensure that IPsec has not been disabled for the VPN client. It may have been disabled to make the Microsoft VPN compatible with an earlier version of FortiOS.

The instructions in this section are based on Windows XP. Other versions of Windows may vary slightly.

Configuring the network connection
  1. Open Network Connections.
    This is available through the Control Panel.
  2. Double-click New Connection Wizard and Select Next.
  3. Select Connect to the network at my workplace.
  4. Select Next.
  5. Select Virtual Private Network connection and select Next.
  6. In the Company Name field, enter a name for the connection and select Next.
  7. Select Do not dial the initial connection and then select Next.
  8. Enter the public IP address or FQDN of the FortiGate unit and select Next.
  9. Optionally, select Add a shortcut to this connection to my desktop.
  10. Select Finish.
    The Connect dialog opens on the desktop.
  11. Select Properties and then select the Security tab.
  12. Select IPsec Settings.
  13. Select Use pre-shared key for authentication, enter the preshared key that you configured for your VPN, and select OK.
  14. Select OK.
Checking that the IPsec service is running
  1. Open Administrative Tools through the Control Panel.
  2. Double-click Services.
  3. Look for IPSEC Services. Confirm that the Startup Type is Automatic and Status is set to Started. If needed, double-click IPsec Services to change these settings.
Checking that IPsec has not been disabled
  1. Select Start > Run.
  2. Enter regedit and select OK.
  3. Find the Registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\RasMan\Parameters
  4. If there is a ProhibitIPsec value, it must be set to 0.

Enforcing IPsec in L2TP configuration

An enforce-ipsec option is available in L2TP configuration to force the FortiGate L2TP server to accept only IPsec encrypted connections.

Syntax

config vpn l2tp

set eip 50.0.0.100

set sip 50.0.0.1

set status enable

set enforce-ipsec-interface {disable | enable} Default is disable.

set usrgrp <group_name>

end

Configuration overview

The following section consists of configuring the FortiGate unit and configuring the Windows PC.

Configuring the FortiGate unit

To configure the FortiGate unit, you must:

  • Configure LT2P users and firewall user group.
  • Configure the L2TP VPN, including the IP address range it assigns to clients.
  • Configure an IPsec VPN with encryption and authentication settings that match the Microsoft VPN client.
  • Configure security policies.

Configuring LT2P users and firewall user group

Remote users must be authenticated before they can request services and/or access network resources through the VPN. The authentication process can use a password defined on the FortiGate unit or an established external authentication mechanism such as RADIUS or LDAP.

Creating user accounts

You need to create user accounts and then add these users to a firewall user group to be used for L2TP authentication. The Microsoft VPN client can automatically send the user’s Window network logon credentials. You might want to use these for their L2TP user name and password.

Creating a user account - GUI
  1. Go to User & Device > User Definitionand select Create New.
  2. Enter the User Name.
  3. Do one of the following:
    • Select Password and enter the user’s assigned password.
    • Select Match user on LDAP server, Match user on RADIUS server, or Match user onTACACS+ server and select the authentication server from the list. The authentication server must be already configured on the FortiGate unit.
  4. Select OK.
Creating a user account - CLI

To create a user account called user1 with the password 123_user, enter:

config user local

edit user1

set type password

set passwd "123_user"

set status enable

end

Creating a user group

When clients connect using the L2TP-over-IPsec VPN, the FortiGate unit checks their credentials against the user group you specify for L2TP authentication. You need to create a firewall user group to use for this purpose.

Creating a user group - GUI
  1. Go to User & Device > User Groups, select Create New, and enter the following:
  2. Name

    Type or edit the user group name (for example, L2TP_group).

    Type

    Select Firewall.

    Available Users/Groups

    The list of Local users, RADIUS servers, LDAP servers, TACACS+ servers, or PKI users that can be added to the user group. To add a member to this list, select the name and then select the right arrow button.

    Members

    The list of Local users, RADIUS servers, LDAP servers, TACACS+ servers, or PKI users that belong to the user group. To remove a member, select the name and then select the left arrow button.

  3. Select OK.
Creating a user group - CLI

To create the user group L2TP_group and add members User_1, User_2, and User_3, enter:

config user group

edit L2TP_group

set group-type firewall

set member User_1 User_2 User_3

end

Configuring L2TP

You can only configure L2TP settings in the CLI. As well as enabling L2TP, you set the range of IP address values that are assigned to L2TP clients and specify the user group that can access the VPN. For example, to allow access to users in the L2TP_group and assign them addresses in the range 192.168.0.50 to 192.168.0.59, enter:

config vpn l2tp

set sip 192.168.0.50

set eip 192.168.0.59

set status enable

set usrgrp "L2TP_group"

end

One of the security policies for the L2TP over IPsec VPN uses the client address range, so you need also need to create a firewall address for that range. For example,

config firewall address

edit L2TPclients

set type iprange

set start-ip 192.168.0.50

set end-ip 192.168.0.59

end

Alternatively, you could define this range in the GUI.

Configuring IPsec

The Microsoft VPN client uses IPsec for encryption. The configuration needed on the FortiGate unit is the same as for any other IPsec VPN with the following exceptions.

  • Transport mode is used instead of tunnel mode.
  • The encryption and authentication proposals must be compatible with the Microsoft client.

note icon

Whether Transport mode is required depends on the configuration of the peer device (typically an old Windows device, since newer versions of Windows don't require IPsec and L2TP—they can run IPsec natively).

caution icon

When configuring L2TP, do not name the VPN "L2TP" as that will result in a conflict.

L2TP over IPsec is supported on the FortiGate unit for both policy-based and route-based configurations, but the following example is policy-based.

Configuring Phase 1 - GUI
  1. Go to VPN > IPsec Tunnels and create the new custom tunnel or edit an existing tunnel.
  2. Edit the Phase 1 Proposal (if it is not available, you may need to click the Convert to Custom Tunnel button).
  3. Name

    Enter a name for this VPN, dialup_p1 for example.

    Remote Gateway

    Dialup User

    Local Interface

    Select the network interface that connects to the Internet. For example, port1.

    Mode

    Main (ID protection)

    Authentication Method

    Preshared Key

    Pre-shared Key

    Enter the preshared key. This key must also be entered in the Microsoft VPN client.

    Advanced

    Select Advanced to enter the following information.

    Phase 1 Proposal

    Enter the following Encryption/Authentication pairs:

    AES256-MD5, 3DES-SHA1, AES192-SHA1

    Diffie-Hellman Group

    2

    NAT Traversal

    Enable

    Dead Peer Detection

    Enable

Configuring Phase 1 - CLI

To create a Phase 1 configuration called dialup_p1 on a FortiGate unit that has port1 connected to the Internet, you would enter:

config vpn ipsec phase1

edit dialup_p1

set type dynamic

set interface port1

set mode main

set psksecret ********

set proposal aes256-md5 3des-sha1 aes192-sha1

set dhgrp 2

set nattraversal enable

set dpd [disable | on-idle | on-demand]

end

note icon

It is worth noting here that the command config vpn ipsec phase1 is used rather than config vpn ipsec phase1-interface because this configuration is policy-based and not route-based.

Configuring Phase 2 - GUI
  1. Open the Phase 2 Selectors panel.
  2. Enter the following information and then select OK.
  3. Phase 2 Proposal

    Enter the following Encryption/Authentication pairs:

    AES256-MD5, 3DES-SHA1, AES192-SHA1

    Enable replay detection

    Enable

    Enable perfect forward secrecy (PFS)

    Disable

    Keylife

    3600 seconds

  4. Make this a transport-mode VPN. You must use the CLI to do this. If your Phase 2 name is dialup_p2, you would enter:

config vpn ipsec phase2

edit dialup_p2

set encapsulation transport-mode

end

Configuring Phase 2 - CLI

To configure a Phase 2 to work with your phase_1 configuration, you would enter:

config vpn ipsec phase2

edit dialup_p2

set phase1name dialup_p1

set proposal aes256-md5 3des-sha1 aes192-sha1

set replay enable

set pfs disable

set keylifeseconds 3600

set encapsulation transport-mode

end

note icon

Once again, note here that the command config vpn ipsec phase2 is used rather than config vpn ipsec phase2-interface because this configuration is policy-based and not route-based.

Configuring security policies

The security policies required for L2TP over IPsec VPN are:

  • An IPsec policy, as you would create for any policy-based IPsec VPN
  • A regular ACCEPT policy to allow traffic from the L2TP clients to access the protected network
Configuring the IPsec security policy - GUI
  1. Go to System > Feature Visibility and enable Policy-based IPsec VPN.
  2. Go to Policy & Objects > IPv4 Policy and select Create New.
  3. Set the Action to IPsec and enter the following information:
  4. Incoming Interface

    Select the interface that connects to the private network behind this FortiGate unit.

    Source Address

    All

    Outgoing Interface

    Select the FortiGate unit’s public interface.

    Destination Address

    All

    VPN Tunnel

    Select Use Existing and select the name of the Phase 1 configuration that you created. For example, dialup_p1. See Configuring IPsec.

    Allow traffic to be initiated from the remote site

    enable

  5. Select OK.
Configuring the IPsec security policy - CLI

If your VPN tunnel (Phase 1) is called dialup_p1, your protected network is on port2, and your public interface is port1, you would enter:

config firewall policy

edit 0

set srcintf port2

set dstintf port1

set srcaddr all

set dstaddr all

set action ipsec

set schedule always

set service ALL

set inbound enable

set vpntunnel dialup_p1

end

Configuring the ACCEPT security policy - GUI
  1. Go to Policy & Objects > IPv4 Policy and select Create New.
  2. Leave the Policy Type as Firewall and leave the Policy Subtype as Address.
  3. Enter the following information and select OK:
  4. Incoming Interface

    Select the FortiGate unit’s public interface.

    Source Address

    Select the firewall address that you defined for the L2TP clients.

    Outgoing Interface

    Select the interface that connects to the private network behind this FortiGate unit.

    Destination Address

    All

    Action

    ACCEPT

Configuring the ACCEPT security policy - CLI

If your public interface is port1, your protected network is on port2, and L2TPclients is the address range that L2TP clients use, you would enter:

config firewall policy

edit 1

set srcintf port1

set dstintf port2

set srcaddr L2TPclients

set dstaddr all

set action accept

set schedule always

set service ALL

end

Configuring the Windows PC

Configuration of the Windows PC for a VPN connection to the FortiGate unit consists of the following:

  1. In Network Connections, configure a Virtual Private Network connection to the FortiGate unit.
  2. Ensure that the IPSEC service is running.
  3. Ensure that IPsec has not been disabled for the VPN client. It may have been disabled to make the Microsoft VPN compatible with an earlier version of FortiOS.

The instructions in this section are based on Windows XP. Other versions of Windows may vary slightly.

Configuring the network connection
  1. Open Network Connections.
    This is available through the Control Panel.
  2. Double-click New Connection Wizard and Select Next.
  3. Select Connect to the network at my workplace.
  4. Select Next.
  5. Select Virtual Private Network connection and select Next.
  6. In the Company Name field, enter a name for the connection and select Next.
  7. Select Do not dial the initial connection and then select Next.
  8. Enter the public IP address or FQDN of the FortiGate unit and select Next.
  9. Optionally, select Add a shortcut to this connection to my desktop.
  10. Select Finish.
    The Connect dialog opens on the desktop.
  11. Select Properties and then select the Security tab.
  12. Select IPsec Settings.
  13. Select Use pre-shared key for authentication, enter the preshared key that you configured for your VPN, and select OK.
  14. Select OK.
Checking that the IPsec service is running
  1. Open Administrative Tools through the Control Panel.
  2. Double-click Services.
  3. Look for IPSEC Services. Confirm that the Startup Type is Automatic and Status is set to Started. If needed, double-click IPsec Services to change these settings.
Checking that IPsec has not been disabled
  1. Select Start > Run.
  2. Enter regedit and select OK.
  3. Find the Registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\RasMan\Parameters
  4. If there is a ProhibitIPsec value, it must be set to 0.

Enforcing IPsec in L2TP configuration

An enforce-ipsec option is available in L2TP configuration to force the FortiGate L2TP server to accept only IPsec encrypted connections.

Syntax

config vpn l2tp

set eip 50.0.0.100

set sip 50.0.0.1

set status enable

set enforce-ipsec-interface {disable | enable} Default is disable.

set usrgrp <group_name>

end