L2TP over IPsec PC: Difference between revisions
Appearance
No edit summary |
|||
| (6 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
<p style="color:red">The information in this page is updated in accordance with firmware version '''[https://wiki.teltonika-networks.com/view/FW_%26_SDK_Downloads 00.07.17.4]''' | |||
==Introduction== | ==Introduction== | ||
| Line 24: | Line 26: | ||
==Router configuration== | ==Router configuration== | ||
If you have familiarized yourself with the configuration scheme and have all of the devices in order, we can start configuring the router using instructions provided in this section. To summarize, we'll be configuring an L2TP server and an IPsec Transport instance (server) on ''RUT''; an L2TP/IPsec client on ''PC''. | If you have familiarized yourself with the configuration scheme and have all of the devices in order, we can start configuring the router using instructions provided in this section. To summarize, we'll be configuring an L2TP server and an IPsec Transport instance (server) on ''RUT''; an L2TP/IPsec client on ''PC''. | ||
As mentioned in the prerequisites section, the router that acts as the server must have a Public Static or Public Dynamic IP address (more information on the subject can be found here). If that is in order, we should start configuring the server. | |||
===L2TP=== | |||
For more in-depth explanations about these parameters, you can visit the following wiki pages: '''[[VPN#IPsec|VPN manual page, IPsec section]]'''. | |||
<table class="nd-othertables_2"> | |||
<tr> | |||
<th width=355; style="border-bottom: 1px solid white;></th> | |||
<th width=790; style="border-bottom: 1px solid white;" rowspan=2> [[File:RutOS_L2TP_IPsec_VPN_7,8_add_L2TP_Server.png|770px|right]]</th> | |||
</tr> | |||
<tr> | |||
<td style="border-bottom: 1px solid white;> | |||
Login to the router's WebUI and navigate to the '''Services → VPN → L2TP''' page and do the following: | |||
<ol> | |||
<li>Select '''Role: Server'''.</li> | |||
<li>Enter a '''custom configuration name'''.</li> | |||
<li>Click the '''Add''' button. You will be prompted to the configuration window</li> | |||
</ol> | |||
</td> | |||
</tr> | |||
</table> | |||
---- | |||
===L2TP=== | <table class="nd-othertables_2"> | ||
<tr> | |||
<th width=355; style="border-bottom: 1px solid white;></th> | |||
<th width=790; style="border-bottom: 1px solid white;" rowspan=2>[[File:RutOS_L2TP_IPsec_VPN_7,8_add_L2TP_Server_config.png|770px|right]]</th> | |||
</tr> | |||
<tr> | |||
<td style="border-bottom: 1px solid white> | |||
<ol> | |||
<li>'''Enable''' the L2TP instance.</li> | |||
<li>Click on the '''Add''' button to add a new user</li> | |||
<li>Enter a '''User name''' and '''Password''' for authentication for the client.</li> | |||
<li>Optionally, set a fixed IP for this client (if left empty, the client will receive the first free IP from the IP range).</li> | |||
<li>Don't forget to '''Save''' the changes.</li> | |||
</ol> | |||
</td> | |||
</tr> | |||
</table> | |||
===IPsec=== | |||
---- | ---- | ||
<table class="nd-othertables_2"> | |||
<tr> | |||
<th width=355; style="border-bottom: 1px solid white;></th> | |||
<th width=790; style="border-bottom: 1px solid white;" rowspan=2>[[File:RutOS_L2TP_IPsec_VPN_7,8_add_Ipsec_Server.png|770px|right]]</th> | |||
</tr> | |||
<tr> | |||
<td style="border-bottom: 1px solid white> | |||
Go to the '''Services → VPN → IPsec''' page and do the following: | |||
<ol> | |||
<li>Enter a custom name for the IPsec instance.</li> | |||
<li>Click the '''Add''' button. You will be prompted to the configuration window</li> | |||
</ol> | |||
</td> | |||
</tr> | |||
</table> | |||
---- | ---- | ||
<table class="nd-othertables_2"> | |||
<tr> | |||
<th width=355; style="border-bottom: 1px solid white;></th> | |||
<th width=790; style="border-bottom: 1px solid white;" rowspan=2>[[File:RutOS_L2TP_IPsec_VPN_7,8_add_Ipsec_Server_config_instnace222.png|770px|right]]</th> | |||
</tr> | |||
<tr> | |||
<td style="border-bottom: 1px solid white> | |||
In the '''IPsec Configuration''' page, do the following (and leave the rest as defaults, unless your specific configuration requires otherwise): | |||
<ol> | |||
<li>'''Enable''' the instance.</li> | |||
<li>Enter your '''Pre-shared key'''.</li> | |||
</ol> | |||
</td> | |||
</tr> | |||
</table> | |||
<table class="nd-othertables_2"> | |||
<tr> | |||
<th width=355; style="border-bottom: 1px solid white;></th> | |||
<th width=790; style="border-bottom: 1px solid white;" rowspan=2>[[File:RutOS_L2TP_IPsec_PC_7.8_1.png|770px|right]]</th> | |||
</tr> | |||
<tr> | |||
<td style="border-bottom: 1px solid white> | |||
<ol> | |||
'''3.''' Select '''Type: Transport'''.<br> | |||
'''4.''' Select '''Bind to: Test(L2TP)'''. | |||
<br> | |||
</ol> | |||
</td> | |||
</tr> | |||
</table> | |||
---- | ---- | ||
'''Note:''' ''This is only an example of a secure configuration. Other algorithms or even combinations of them could be used. However, we strongly recommend refraining from using older encryption and hashing algorithms unless support for certain legacy systems is required.'' | |||
Make the following changes: | |||
<table class="nd-othertables_2"> | |||
<tr> | |||
<th width=330; style="border-bottom: 1px solid white;></th> | |||
<th width=800; style="border-bottom: 1px solid white;" rowspan=2>[[File:Networking_webui_manual_IPsec_configuration_proposal_phase1_settings_v1.png|border|class=tlt-border|671x336px|center]]</th> | |||
</tr> | |||
<tr> | |||
<td style="border-bottom: 4px solid white> | |||
# Encryption - '''''AES256;''''' | |||
# Authentication - '''''SHA512;''''' | |||
# DH group - '''''MODP4096;''''' | |||
# IKE lifetime - '''86400s'''. | |||
</td> | |||
</tr> | |||
</table> | |||
---- | |||
[[File: | <table class="nd-othertables_2"> | ||
<tr> | |||
<th width=330; style="border-bottom: 1px solid white;></th> | |||
<th width=800; style="border-bottom: 1px solid white;" rowspan=2>[[File:Networking_webui_manual_IPsec_configuration_proposal_phase2_settings_v1.png|border|class=tlt-border|644x331px|center]]</th> | |||
</tr> | |||
<tr> | |||
<td style="border-bottom: 4px solid white> | |||
# Encryption - '''''AES256;''''' | |||
# Authentication - '''''SHA512;''''' | |||
# PFS group - '''''MODP4096;''''' | |||
# Lifetime – '''''86400s;''''' | |||
</td> | |||
</tr> | |||
</table> | |||
===PC Client=== | ===PC Client=== | ||
| Line 73: | Line 172: | ||
==Testing the setup == | ==Testing the setup == | ||
If you've followed all the steps presented above, your configuration should be finished. But as with any other configuration, it is always wise to test the setup in order to make sure that it works properly. The simplest way to test an IPsec connection is using the ipsec status command. You can execute this command via a command line interface (CLI). A CLI is present in all RUTxxx routers' WebUIs. To access it, login to the routers' WebUI and navigate to ''' Services''' → ''' CLI''' . Login to CLI with the user name root and the router's admin password. Then simply the | If you've followed all the steps presented above, your configuration should be finished. But as with any other configuration, it is always wise to test the setup in order to make sure that it works properly. The simplest way to test an IPsec connection is using the ipsec status command. You can execute this command via a command line interface (CLI). A CLI is present in all RUTxxx routers' WebUIs. To access it, login to the routers' WebUI and navigate to ''' Services''' → ''' CLI''' . Login to CLI with the user name root and the router's admin password. Then simply enter the swanctl --list-sas and press the "Enter" key: | ||
[[File: | [[File:L2TPIPsecStatus_v2.png|left|Ipseccorrectlyfinal2|border|class=tlt-border|1100px]] | ||
As you can see, executing | As you can see, executing swanctl --list-sas displays the number of active/inactive IPsec connections. If the connection you just configured is the only IPsec connection that you're using, you should a 1 up indication next to Security Associations. | ||
To test an L2TP connection. You should then be able to ping the opposite instance, i.e., if you logged in to the server's CLI, you should be able to ping the client's virtual IP address, and vice versa. To use a ping command, type ''' ping <ip_address>''' and press the ''' Enter''' key on your keyboard: | To test an L2TP connection. You should then be able to ping the opposite instance, i.e., if you logged in to the server's CLI, you should be able to ping the client's virtual IP address, and vice versa. To use a ping command, type ''' ping <ip_address>''' and press the ''' Enter''' key on your keyboard: | ||
[[File: | [[File:L2oIP Ping v2.png|left|L2tpcorrectly|border|class=tlt-border|1100px]] | ||
If the ping requests are successful, congratulations, your setup works! If not, we suggest that you review all steps once more. | If the ping requests are successful, congratulations, your setup works! If not, we suggest that you review all steps once more. | ||
| Line 91: | Line 190: | ||
**[[IPsec RUTOS configuration example|IPsec configuration examples]] | **[[IPsec RUTOS configuration example|IPsec configuration examples]] | ||
**[[GRE Tunnel configuration examples RutOS|GRE Tunnel configuration examples]] | **[[GRE Tunnel configuration examples RutOS|GRE Tunnel configuration examples]] | ||
**[[OpenVPN configuration examples | **[[OpenVPN configuration examples|OpenVPN configuration examples]] | ||
**[[PPTP configuration examples RutOS|PPTP configuration examples]] | **[[PPTP configuration examples RutOS|PPTP configuration examples]] | ||
[[Category:VPN]] | |||