Cisco IOS – How to configure remote access vpn on a router
Posted by Josh on Sat 4 Sep 2010Categories: Cisco , Cisco Routers , VPN - [15] Comments

The first part covers the basic remote access vpn configuration. All traffic from your PC will be encrypted and only traffic from the PC to the home network (10.10.10.x). The PC will not have internet access. This initial configuration also assumes the router being configured is currently a basic internet router with NAT and a firewall already configured.
- Configure a username and AAA
- Configure encryption parameters
- Configured policy based NAT to disable NAT for VPN traffic
- Configure firewall ACL to permit encryption protocols
—–
username josh password blindhog1@
description *** Outside ***

Providing internet access through the VPN requires a little trick. The traffic is policy routed on the outside interface … around the loopback interface, through a NAT and back out to the internet.
If the traffic is from a VPN client ip address and destined for a LAN address, the traffic will go unaltered.
If the traffic is from a VPN client ip address and destined for an IP address not on the local area network, it is policy routed to an IP address in the same subnet as the loopback interface, through the loopback interface and to the internet. It is important that the ‘ip next-hop’ command in the route-map not be the loopback interface. It must be a different IP address on the same subnet as the loopback interface.
An entry must also be added to the policy nat access list to NAT traffic from the VPN client.
—–
On my personal internet router, I have two vpn groups. One for routing all traffic through my router and then to the internet and another for split tunneling. If you are not familiar with split tunneling … it only encrypts traffic destined for the LAN behind the VPN router. All other traffic is sent directly to the internet without encryption. I also create two different VPN entries in my Cisco VPN client for each group so I can choose how I would like to connect easily.
I think it is best to use different subnets for each VPN group … one for the VPN group encrypting all traffic and another for split tunneling. The commands below add an entry to the policy-based NAT access-list to prevent NAT for traffic between the LAN and the VPN clients.
The ‘SPLIT-TUNNEL’ access-list defines what traffic should be encrypted. Only traffic between the VPN client ip addresses and the LAN ip addresses. The ‘ip local pool’ and client group configurations are identical to the VPN group above with the exception of the ‘acl’ command that is used to reference the ‘SPLIT-TUNNEL’ access-list.
—–
Having a home vpn router is cheap enough. 1711 vpn routers sell for as little $50. Go on ebay or contact a used cisco dealer. I use Douglas King (Myriad Supply) or Matt Freeman (Express Computer Systems).
Disclaimer: I was not paid to endorse Douglas or Matt. They have just been very good to work with in the past.
September 4th, 2010 at 2:03 am
Much more easier is to use ipsec tunnel protection with virtual-template (no route-map, no crazy loopback combinatin needed)
September 4th, 2010 at 7:39 am
Thanks Micron!
I will definately check that out.
Josh
September 5th, 2010 at 5:10 am
Hi Josh, Thanks for posting your remote access vpn config. Being newb to VPN setup, is it possible that you could provide the network topology to reflect your config. Thanks.
September 5th, 2010 at 9:40 pm
James,
Done. Sorry about that.
Josh
September 5th, 2010 at 9:48 pm
[...] If this is not what you are looking for, here are a few other VPN tutorials I have: How to configure remote access vpn on a router [...]
September 19th, 2010 at 9:21 am
Thanks. Your diagram is a great help
October 23rd, 2010 at 1:18 pm
Hi,
Great config..however.. when i remove my old ip nat inside source list 100 interface (outside) overload command,i cannot access the internet anymore from my local machines..
When i put this line together with the ip nat inside source route-map RM-POLICY-NAT interface (outside) i cannot access my local machines from the vpn..
Is there a solutions for this?
Thanks
October 24th, 2010 at 10:35 pm
Ken,
Can you post your config?
Josh
October 25th, 2010 at 11:25 am
Hi Josh,
Thanks for you’re reply..
Off course can i post my config..
Here it is..
Thanks
hostname 878
!
boot-start-marker
boot system tftp c870-advipservicesk9-mz.124-15.T5.bin 172.16.250.24
boot-end-marker
!
no logging buffered
enable secret 5 *************
!
aaa new-model
!
!
aaa authentication login AAA-VPN local
aaa authorization network AAA-VPN local
!
!
aaa session-id common
clock timezone Berlin 1
clock summer-time Berlin date Mar 30 2003 2:00 Oct 26 2003 3:00
!
!
dot11 syslog
ip cef
!
!
!
!
no ip domain lookup
ip auth-proxy max-nodata-conns 3
ip admission max-nodata-conns 3
!
multilink bundle-name authenticated
!
!
username blomk privilege 15 password 7 *********
!
!
crypto isakmp policy 1
encr 3des
authentication pre-share
group 2
!
crypto isakmp client configuration group vpnall
key ******
dns 62.58.50.5
pool VPNALLPOOL
!
!
crypto ipsec transform-set 3des-sha esp-3des esp-sha-hmac
!
crypto dynamic-map dynmap 10
set transform-set 3des-sha
!
!
crypto map vpn client authentication list AAA-VPN
crypto map vpn isakmp authorization list AAA-VPN
crypto map vpn client configuration address respond
crypto map vpn 10 ipsec-isakmp dynamic dynmap
!
archive
log config
hidekeys
!
!
controller DSL 0
line-term cpe
!
!
!
!
interface Loopback0
ip address 10.11.0.1 255.255.255.0
ip nat inside
no ip virtual-reassembly
!
interface BRI0
no ip address
encapsulation hdlc
shutdown
!
interface FastEthernet0
description *** Port Outside ***
switchport access vlan 10
!
interface FastEthernet1
description *** Inside ***
switchport access vlan 11
!
interface FastEthernet2
description *** Inside ***
switchport access vlan 11
!
interface FastEthernet3
description *** Inside ***
switchport access vlan 11
!
interface Vlan1
no ip address
!
interface Vlan11
description *** Inside ***
ip address 172.16.250.253 255.255.255.0
ip directed-broadcast 101
ip nat inside
no ip virtual-reassembly
!
interface Vlan10
description *** Outside ***
ip address 192.168.1.2 255.255.255.0
ip nat outside
no ip virtual-reassembly
ip policy route-map rm-outside-pbr
crypto map vpn
!
interface Vlan100
no ip address
!
ip local pool VPNALLPOOL 172.16.252.40 172.16.252.41
ip forward-protocol nd
ip forward-protocol udp echo
ip route 0.0.0.0 0.0.0.0 192.168.1.1
!
!
ip http server
ip http authentication local
ip http secure-server
ip dns server
ip nat inside source static udp 172.16.250.255 7 interface Vlan11 7
ip nat inside source static tcp 172.16.250.24 3389 interface Vlan10 3389
ip nat inside source static udp 172.16.250.24 7 interface Vlan10 7
ip nat inside source static tcp 172.16.252.1 443 interface Vlan10 443
ip nat inside source static tcp 172.16.250.253 161 interface Vlan10 161
ip nat inside source static tcp 172.16.250.253 23 interface Vlan10 23
ip nat inside source static udp 172.16.250.231 161 interface Vlan10 161
ip nat inside source static tcp 172.16.250.231 7 interface Vlan10 7
ip nat inside source route-map RM-POLICY-NAT interface Vlan10 overload
!
ip access-list extended acl-outside-pbr
permit ip 172.16.252.0 0.0.0.255 any
deny ip 172.16.252.0 0.0.0.255 172.16.250.0 0.0.0.255
ip access-list extended acl-policy-nat
permit ip 172.16.252.0 0.0.0.255 any
!
ip access-list extended acl_firewall
permit esp any any
permit udp any any eq non500-isakmp
permit udp any any eq isakmp
!
no logging trap
access-list 100 permit ip any any
!
!
!
route-map rm-outside-pbr permit 10
match ip address acl-outside-pbr
set ip next-hop 10.11.0.2
!
route-map RM-POLICY-NAT permit 10
match ip address acl-policy-nat
!
!
control-plane
!
!
line con 0
no modem enable
line aux 0
line vty 0 4
privilege level 15
transport input telnet ssh
!
scheduler max-task-time 5000
end
November 3rd, 2010 at 4:29 am
Thanks!. Work perfectly!:)
February 3rd, 2011 at 1:45 pm
Thanks for sharing
Reading this tutorial makes me want to try again
I have used SDM to configure remote access vpn but for some reason it did not work
July 15th, 2011 at 11:17 am
Hi ! thanks for your article. Can you post the config using the Virtual-Template to allow internet access through the vpn.
August 22nd, 2011 at 9:06 pm
Hi, great article. I’d be keen to see the Virtual Template option as well.
September 13th, 2011 at 11:31 pm
Hi Josh
I have become a fan of yours. I always learnt very special things on your site.
Keep it up.!
Stay blessed.
March 2nd, 2012 at 8:53 pm
Hi, great article. I’d be keen to see the Virtual Template option as well.and very attractive and stopping point is most impordent role and as well as brief summary