Cisco router can be used as VPN server, using L2TP and IPSec, for client from internet accesing private network.
Below are steps for configuring L2TP IPSec on Cisco router,
1. Enable aaa authentication and create user,
aaa new-model
aaa authentication login default local
aaa authentication ppp default local
aaa authorization exec default local
user cisco password cisco2. Enable VPDN and configure VPDN group
vpdn enable3. Configure authentication methode. Using pre-shared key is the best and simple methode.
!
vpdn-group L2TP
! Default L2TP VPDN group
accept-dialin
protocol l2tp
virtual-template 1
no l2tp tunnel authentication
crypto isakmp policy 104. Configure IPSec
encr 3des
authentication pre-share
group 2
lifetime 3600
crypto isakmp key cisco address 0.0.0.0 0.0.0.0 no-xauth
crypto isakmp keepalive 3600
crypto ipsec transform-set ipnetconfig esp-3des esp-sha-hmac
mode transport
!
crypto dynamic-map ipnetconfig-map 10
set nat demux
set transform-set ipnetconfig
!
!
crypto map cisco 10 ipsec-isakmp dynamic ipnetconfig-map
interface FastEthernet0/05. Create Vitrual_Template
ip address 192.168.1.254 255.255.255.0
duplex auto
speed auto
crypto map cisco
interface Virtual-Template16. Create IP Pool for user
ip unnumbered FastEthernet0/0
peer default ip address pool poolipnetconfig
ppp encrypt mppe 40
ppp authentication ms-chap-v2
ip local pool poolipnetconfig 172.31.1.1 172.31.1.67. Test your configuration
Complete configuration on Cisco router:
L2TP-Server#sh runFor configuring L2TP IPSec on Windows 7, see my other post on this blog.
Building configuration...
Current configuration : 5669 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname L2TP-Server
!
boot-start-marker
boot-end-marker
!
enable secret 5 $1$WMq0$BZpIxsWnzmEI0fCvWADGd0
!
aaa new-model
!
!
aaa authentication login default local
aaa authentication ppp default local
aaa authorization exec default local
!
aaa session-id common
!
resource policy
!
ip cef
!
!
!
!
ip domain name ipnetconfigs.com
ip name-server 192.168.0.1
ip ssh version 2
vpdn enable
!
vpdn-group L2TP
! Default L2TP VPDN group
accept-dialin
protocol l2tp
virtual-template 1
no l2tp tunnel authentication
!
!
!
!
crypto pki trustpoint TP-self-signed-417945430
enrollment selfsigned
subject-name cn=IOS-Self-Signed-Certificate-417945430
revocation-check none
rsakeypair TP-self-signed-417945430
!
!
crypto pki certificate chain TP-self-signed-417945430
certificate self-signed 01
30820257 308201C0 A0030201 02020101 300D0609 2A864886 F70D0101 04050030
30312E30 2C060355 04031325 494F532D 53656C66 2D536967 6E65642D 43657274
69666963 6174652D 34313739 34353433 30301E17 0D313030 33313331 30303434
375A170D 32303031 30313030 30303030 5A303031 2E302C06 03550403 1325494F
532D5365 6C662D53 69676E65 642D4365 72746966 69636174 652D3431 37393435
34333030 819F300D 06092A86 4886F70D 01010105 0003818D 00308189 02818100
CBB11B58 6E347C78 1FB62626 0FD03CCB 5AA26CC3 A0E17634 B905978F DF0FCA60
2A8CD0EE 1BF4428A 53F23038 7BF8C209 B0FEF57B 08233D2C F49826BB 938113DE
C6D25DD0 E8AA51B0 F4BAE931 0C4C19A6 7657EB6F 4A0CF980 92C54B48 F927BF00
1E3F25E1 A28EA8F6 B941BC0A E6F2FA20 6A73F969 A8B523F0 0B25C927 85C649BD
02030100 01A38180 307E300F 0603551D 130101FF 04053003 0101FF30 2B060355
1D110424 30228220 50504A2D 47572E6C 61646F6D 61696E2E 6C696E74 61736172
74612E63 6F2E6964 301F0603 551D2304 18301680 14167006 97518BA4 E4F9BA7A
82A17511 CE1A4870 8B301D06 03551D0E 04160414 16700697 518BA4E4 F9BA7A82
A17511CE 1A48708B 300D0609 2A864886 F70D0101 04050003 8181006B D63609D0
F61D11FF FB4CC38C 231FA679 B6A3AD68 DF7BEDC3 CCE85778 5D7E4FE7 ADFA6A8B
4BBDED0F 20137B37 C445F0D9 14E55313 2553284B DCB49472 3E56BF3D 140F3E58
047833BD 4F6D0719 29233D33 8F681B69 613FF4A5 B527E059 06B655E3 06BBFA37
B3F43E6B 67DF84DF 5D3B0FC9 ECFB16E3 9AB4E1F1 D61D0523 A95A44
quit
username root privilege 15 secret 5 $1$E1t3$.GKaPz1xFuph9r/fRqxTO.
!
!
!
crypto isakmp policy 10
encr 3des
authentication pre-share
group 2
lifetime 3600
crypto isakmp key cisco address 0.0.0.0 0.0.0.0 no-xauth
crypto isakmp keepalive 3600
!
!
crypto ipsec transform-set ipnetconfig esp-3des esp-sha-hmac
mode transport
!
crypto dynamic-map ipnetconfig-map 10
set nat demux
set transform-set ipnetconfig
!
!
crypto map cisco 10 ipsec-isakmp dynamic ipnetconfig-map
!
!
!
!
!
interface FastEthernet0/0
ip address 192.168.1.254 255.255.255.0
duplex auto
speed auto
crypto map cisco
!
interface FastEthernet0/1
no ip address
duplex auto
speed auto
!
!
interface Virtual-Template1
ip unnumbered FastEthernet0/0
peer default ip address pool poolipnetconfig
ppp encrypt mppe 40
ppp authentication ms-chap-v2
!
!
ip local pool poolipnetconfig 172.31.1.1 172.31.1.6
ip route 0.0.0.0 0.0.0.0 192.168.1.1
!
!
ip http server
ip http secure-server
!
!
!
!
control-plane
!
!
line con 0
line aux 0
line vty 0 4
!
scheduler allocate 20000 1000
end
L2TP-Server#
26 comments
Great example. Almost my setup exactly. I am having an issue where users connect but after a few seconds are disconnected. I can't find that this is a configuration issue.
Hi, Brad, on Connection properties, Security, Data Encryption, use Optional Encryption
Great guide on setting up a VPN sever for a Cisco router it worked perfectly. Thanks
US VPN
This is definitely a great guide. Thanks for sharing your time to post this tutorial. I've just bookmarked it for future use.
data center
Hi, I would like to know which cisco router model you have configured for the L2TP VPN. Is the cisco router behind the other DSL router?
I have a Cisco UC520 router and I try to follow as above steps but I cannot log into to it from my computer (Windows 7).
Thanks for your helpings.
I am running a c1760 12.4(8) advipservicesk9-mz
aaa authorization exec default local <= Is not a valid command.
FA0/0 is my public interface connected to a cable modem.
VLan1 is my private interface.
With that your configuration doesnt work at all.
Great post. Thanks for sharing.
Hi, This is a great post. It even works with native Android VPN.
But I find out that clients can connect with L2TP only (without IPSec) if they want to.
Any suggestions how it is possible to limit the connections to L2TPwithIPSec only?
For Windows to connect you need aaa authorization for network.
ex.:
aaa authorization network default local if-authenticated
Excellent, it's working fine
Very nice post and tutorial. But i'm getting error 789 on Windows 7 Client ... already turn off windows firewall ... but same error occurs. Any idea ? Thank you so much in advance
Thank you Anon September 11 ... without aaa authorization network default local if-authenticated windows 7 clients can't connect ;)
But i only got it work if i connect from local network
Everything is ok on the firewall, i have one external ip address that is mapped into the local ip of the router. No blocks on firewall, i can ping the external ip from external network, but only gave me the 809 error in windows 7. Any idea ?
use waselpro vpn service on your mobile device with l2tp , its very fast and secured and very easy to use
http://www.openvpnandroid.com/l2tp-method-for-android-vpn/
Thanks for configuration.Good blog about configs.
top10-bestvpn.com
Thanks a lot for your job.Good manual for VPN.
This configuration works good.
http://10webhostingservice.com/
really informative thanx
Thanks!!!good manual! This realy works
very nice...thnks dear
Thank you very much
It was very helpful for me.
I Did the configuration and i can successfully connect with VPN and get an ip as well but i cant ping any machines on the network.
Great Guide, Works perfectly. Thanks
How do I do this with Xauth using local user database?
Hey Guys,
Could you please advise how can i reach my internal network once I'm connected?
hanks!!!good manual! This realy works SLM2008PT-NA
There are too many environments and moments where you need a VPN, but to make some understanding of VPN usage, I will explain the most common reasons where many people are using it daily.
Reason Where You Need a VPN
Wow what a Great Information about Config L2TP VPN its very nice informative post. thanks for the post.
FREE INTERNET CONFIG FOR ANDROID AND PC
hi, i didnt input any username and password. i also tried the default cisco cisco but authentication failed. can i get help?
Post a Comment