l2tp over IPSec scenario
by tnk on May.10, 2009, under Huawei, Networking, Security Links, windows
So this is the long promised scenario that can be used with windows XP (even though it is not really user friendly).
If you need a “PC-client – VPN-concentrator” scenario. Huawei does offer only one-way ticket for you and it is l2tp over IPSec. Unless you want to use some MPLS over IPSec which is in theory also a possibility but I guess it is supported only on high-end boxes. One can say why to use such a thing like l2tp when the IPsec provides almost everything by itself. Well there are some obvious reasons and some not-so-obvious ones. Lets go through them one-by-one.
- Huawei does not provide a software VPN client for the windows XP box (or any other) so guys with cisco experience can surely forget about the easy config on the client side (that is especially valid for Stefano ;) ) the only solution is using the “dialled connection wizard” from windows and some minor change in windows registry
- As for IPSec – this is L3 tunneling protocol so no services relying on broadcast will work without some help of another encapsulated protocol. If you think that this is no issue try to remember there is DHCP (which you definitely want to use if the use is more in larger scale) which is not relayed by client as there is no client. But this is only one that can be easily overcome by static IPs. But in common network is much more than DHCP, the most common service that needs L2 is the Microsoft sharing services (actually only the name-resolving but that is enough). And many others…
- There is also one serious limitation in standard windows XP as for the dialed client is impossible to use tunnel mode for IPSec so only possibility is to use transport mode which is again not so good as the payload is still unencrypted. I am not sure if this had changed somehow in Vista but my guess would be that it remained the same.
This being said the prospect seems to be a bit grim. But hey you can still be sure the tunnel is secure against man-in-the-middle attacks and also that no fiddling with your traffic occurred. If you request encryption of the data itself you really should use some upper layer encrypted protocol like SSH, maybe even use it for tunneling etc. I guess you got the point now.
So that’s for limitations and basics. Now straight to the code.
Important notice this was done on VRP 3.40 but it should work without problem on VRP 5.X as well.
Step one - creation of IPSec service (the details of this config are in other articles so without explanation this time).
#
ike peer 1
pre-shared-key test
remote-address 10.0.0.1
#
ipsec proposal 1
encapsulation-mode transport
#
ipsec policy-template tunnet-1 10
ike-peer 1
proposal 1
#
ipsec policy p 10 isakmp template tunnel-1
#
interface Ethernet2/0
description to PC 1
ip address 10.0.0.2 255.255.255.0
ipsec policy tunnel-1
#
So that’s the IPsec tunnel prepared. Now follows an optional but recommended step of creating an DHCP ip-pool for the connecting clients. Ideally you can re-use the pool which is already set for your LAN. But you may also want to have your remote connections in different network so it is up to you really. I just re-used the pool I had.
#
domain system
ip pool swimming-pool-1 20.0.0.1 20.0.0.100
#
Now it is time for the second step – preparation of l2tp
At first it is important to create user with a password and service-type ppp as we will use authentication
#
local-user test
password simple test
service-type ppp#
So Now when we have a user that can be authenticated let’s create thel2tp service itself
We have to define a virtual-template interface where is set what kind of ppp authentication, what IP and what DHCP pool will be used for the remote clients (if any).
#
interface Virtual-Template 0
ppp authentication-mode chap
ip address 20.o.0.1 255.255.255.0
remote address pool swimming-pool-1
#
Now with our virtual-template interface in place we can finally define l2tp. It is done through binding of the virtual-template into a l2tp group.
#
l2tp-group 1
allow l2tp virtual-template 0
#
That’s it if you have done this you will be able to start a ppp session over the tunnel made of IPSec and then get authenticated against local user database.
This is for the router side as for the windows (XP) you need to make some adjustments. First important thing is to change (or checks if you have) a registry key on this location.
HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesRasManParameters
here change or create key named ProhibitIpSec and it should be reg_dword type and value set to 1
This has to be done as windows have the IPSec disabled by default. So if you have done that you definitely have to reboot so the windows system can reload the network settings. After this tweak you just need to create and configure the virtual connection from the station. To do so go to following location start/run/networking connections/New Connection Wizard.
After you enter the wizard select these options
- Connect to the network at my workplace
- Virtual Private Network Connection
- Company Name
- Don’t dial the initial connection
- VPN Server Selection(ip address 10.0.0.2)
When you finish this basic setup it is time to adjust it for the settings of our server . In Connect Virtual Private Network Properties change values as seen on pictures below.

After this change the password in security tab as shown below.

And then select the chap for ppp authentication with options set like this

Now just check if the tunnel is going up on the router side with the notorious display ike sa and display ipsec sa commands and if you are getting the right IP address on client side are done.
I realize that this is now very nice solution especially in comparison with cisco but as far as I know this is the only way on low and mid-end boxes.

January 29th, 2010 on 17:06
Hi, this configuration dosn’t encrypt anything !!!
Tunel work without IPSec, You some switchoff this protocol on Windows ;) by set reg Prohibit Ip Sec = 1 !!!!
January 29th, 2010 on 17:18
Well I think you might be right about that value. It seems more logical for it to be set to 0. I dug this from some very old script of mine and probably mixed the desired and default value :) Thanks for pointing that out I’ll verify it and update the article.
January 29th, 2010 on 17:24
OK so I checked with Microsoft knowledge-base and the thing is like this:
“When the ProhibitIpSec registry value is set to 1, your Windows 2000-based computer does not create the automatic filter that uses CA authentication. Instead, it checks for a local or Active Directory IPSec policy.”
which is actually what we need right ?
March 22nd, 2010 on 01:37
If it is very nice now, what was nice before? It is absurd as it gives no way of connecting clients to real network, so it requires routing which in fact disables usage for access of specific devices on a single subnet but nothing else.
In short – useless for anything else but default gateway vpn. Or am I missing anything?
March 23rd, 2010 on 15:27
Well this article has been written as a response to the people complaining that they cannot use Huawei routers as an VPN concentrator and that Huawei does not have any VPN client etc. I just used tools native to both Huawei and Windows to prove that such a configuration is possible. I believe that there is much more options of configuring and tweaking up both sides of the VPN.
As to your question – I don’t fully understand what are you talking about but the thing is that you will create new interface on the host OS so it should be possible to adjust your routing table to allow certain prefixes go through the VPN and certain through the unencrypted connection.
But as I am no windows expert (and I have no intentions being one) I cannot tell for sure – it is just common sense that as the host OS decides what will go where so adjusting it should work. Anyway if you want to build an VPN concentrator you should buy a dedicated machine that was build for that purpose (Checkpoint’s firewall with it’s own client is one example or the Juniper’s SSL solution which is great and widely used and there are others like FortiNet or even OpenVPN etc.)
December 22nd, 2010 on 09:18
Hi,
with this registry it sure will not use IPSEC for L2TP client. You can check with wireshark (it will not even start IKE – udp 500, instead it will use udp 1701).
December 22nd, 2010 on 10:34
Hi Maksim,
it has been long time since I wrote this article and I am fairly sure it has been working then. I think the system was win XP (SP1 or maybe SP2?). But it is entirely possible that this does not work anymore on SP3/vista/win7. As I have no longer access to the equipment to test it I have no way of updating this article if it indeed does not work… If you have any more information I would appreciate that.
TNK