Archive for the 'Cisco Routers' Category
Basically Cisco Easy VPN is usually used for Cisco easy VPN Client termination. In this post however, let’s consider the configuration of Cisco Easy VPN between two Cisco routers. Just keep in mind that an EasyVPN scenario involves an EasyVPN Server and EasyVPN Remote Clients. The basic configuration is performed on the Cisco Easy VPN Server and the configuration done on Cisco Easy VPN Remote is almost similar to the configuration done on Cisco easy VPN client.
Let’s consider an example as shown on diagram below: configure R1 as an easy VPN Remote and configure R2 as an easy VPN Server and force the traffic to flow via the VPN Tunnel between the Loopback interfaces.

Before starting the Easy VPN configuration, check the connectivity between the Loopback interfaces. For simplicity I configured default route on both routers to each other.
Now let’s start configuration. First of all configure R2 as Easy VPN Server.
R2 Configuration
!enable AAA new-model
aaa new-model
! enable local authentication method list with name userauthen for X-AUTH
aaa authentication login userauthen local
! enable local authorization method list with name groupauthor for X-AUTH
aaa authorization network groupauthor local
!create username, by which authorization of Easy VPN Remote will occur later.
username cisco password 0 cisco123
!create ISAKMP PHASE #1 Negotiation
crypto isakmp policy 3
encr 3des
authentication pre-share
group 2
!Create group with pre-shared key for IKE authentication. Save-password Feature allows Remote to save password.
crypto isakmp client configuration group vpngrp
key cisco123
save-password
!create IPSEC Transform-set for DATA Encryption
crypto ipsec transform-set TS esp-3des esp-sha-hmac
!Create Dynamic-map , which will be used to crypto-map later.
crypto dynamic-map dynmap 10
set transform-set myset
! Create crypto map, which will be used to AAA authentication, authorization lists and also in dynamic-crypto map.
crypto map clientmap client authentication list userauthen
crypto map clientmap isakmp authorization list groupauthor
crypto map clientmap 10 ipsec-isakmp dynamic dynmap
!Now attach the crypto-map to outside interface.
interface FastEthernet0/0crypto map clientmap
By this, easy vpn server configuration is completed. Now let’s start Remote configuration. Configuration is almost similar to the Cisco Easy VPN Client configuration.
R1 Configuration
! Create VPN Profile.
crypto ipsec client ezvpn ez
! Connect automatically to Easy VPN Server. If we don’t do this, then we’ll have to connect manually to Easy VPN server every time the network is down.
connect auto
! Easy VPN group username and password, which are created on server.
group vpngrp key cisco123
!Indicate Mode as network-extension.
mode network-extension
!Indicate the IP address of Easy VPN Server.
peer 192.168.2.2
! Use Username and password saved in profile for connecting to Easy VPN Server.
xauth userid mode local
! Save user and password in Profile.
username cisco password cisco123
! Determine Inside interface. Inside and outside interfaces must be determined on Easy VPN Remote.
interface Loopback0
ip address 10.12.130.1 255.255.255.255
crypto ipsec client ezvpn ez inside
!
interface FastEthernet0/0
ip address 192.168.2.1 255.255.255.0
crypto ipsec client ezvpn ez outside
Both sites are completed now, so let’s do some testing:
R2#show crypto isakmp sa
IPv4 Crypto ISAKMP SA
dst src state conn-id slot status
192.168.2.1 192.168.2.2 QM_IDLE 1008 0 ACTIVE
R2#show crypto ipsec sa
interface: Fastethernet 0/0
Crypto map tag: clientmap, local addr 192.168.2.2
protected vrf: (none)
local ident (addr/mask/prot/port): (0.0.0.0/0.0.0.0/0/0)
remote ident (addr/mask/prot/port): (10.12.130.1/255.255.255.255/0/0)
current_peer 192.168.2.1 port 500
PERMIT, flags={}
#pkts encaps: 5, #pkts encrypt: 5, #pkts digest: 5
#pkts decaps: 5, #pkts decrypt: 5, #pkts verify: 5
#pkts compressed: 0, #pkts decompressed: 0
#pkts not compressed: 0, #pkts compr. failed: 0
#pkts not decompressed: 0, #pkts decompress failed: 0
#send errors 0, #recv errors 0
A few days ago I have written a post about Booting a Cisco Router from USB Flash. Related to that post and since I got some questions about the subject, it seems appropriate to add some more information about how USB Drives can be managed and used in Cisco IOS routers.
Some things to consider:
- USB interfaces are supported from IOS release 12.3 (14) T IP Base and later.
- All ISR and ISR G2 routers support USB flash drives.
- Devices that have 2 USB ports, can use both USB memory sticks simultaneously.
- You can use a USB extension cable; however USB hubs are not supported.
- The IOS version supported on the router is independent of the type of USB (i.e doesn’t matter if USB is version 1.1 or 2). The older ISRs use USB type 1.1 while the newest ISR machines use USB 2.0 types.
- After inserting the USB flash memory into the corresponding port, the IOS software automatically recognizes it and generates a message on the console as shown below:
Mar 10 09:10:20.251: %USBFLASH-5-CHANGE: usbflash1 has-been inserted!
- These routers also support the use of eTokens from Aladdin (security USB tokens).
- The USB can be used to store and read both IOS images and configuration files.
- The files stored on USB sticks are not encrypted.
- Officially, Cisco routers support only USB devices from Cisco. However, it is possible to use any USB memory stick which does not require installation of specific drivers.
- The only format supported by IOS is FAT16. NTFS file format on the USB drive is not supported yet.
- USB flash drives can be formatted from IOS before being used.
How to format a USB drive from IOS
The formatting process is relatively simple using IOS:
Router # format ?
flash: Filesystem to be formatted
usbflash1: Filesystem to be formatted
Router # format usbflash1:
Format operation may take a while. Continue? [confirm]
Format operation will destroy all data in “usbflash1:”. Continue? [confirm]
Format: Drive communication & 1st Sector Write OK…
Format: All system sectors written. OK…
Format: Total data sectors in formatted partition: 8191435
Format: Total data bytes in formatted partition: -100952576
Format: Operation completed successfully.
Format of usbflash1 complete
From this point the USB flash drive can be used with all file system commands in the Cisco IOS.
Cisco routers typically store a copy of the device’s operating system (Cisco IOS) in their flash memory, and load this operating system image into RAM during the boot-up process. The flash memory of Cisco routers is usually internal or can be a removable flash card on higher end routers.
However, it may happen that for various reasons the operating system image may not be available, maybe due to file corruption, flash memory corruption, accidental deletion, etc. In this case the device does not have a valid image to load and therefore the router boots into ROM monitor mode (rommon). This mode gives a reduced set of commands that essentially allow the administrator to manually run the boot sequence.
For such cases, and using commands in the ROMMON mode, the Cisco ISR routers have 1 or 2 USB ports that can be used to load the IOS image from a USB flash drive.
How to Boot from USB
The obvious prerequisite of this procedure is to have a valid IOS image, which is suitable for the device you want to put into operation, stored on a USB flash drive. Once we have this resource, we must enter into ROM Monitor mode (rommon). If the device did not have a valid IOS image in the internal flash memory, it will go directly in that mode. If not, we can force entry into rommon mode by interrupting the boot sequence using “Ctrl + Break”.
From this point, we can see the rommon mode prompt:
rommon 1>
In this mode we can see the list of available commands using the question mark or help command:
rommon 1>?
or
rommon 1> help
Then we can check our image stored on USB flash drive:
rommon 2> dir usbflash0:
program load complete, entry point: 0x8000f000, size: 0x3d240
Directory of usbflash0:
2 …… 14871760-… ..- rw-ipbase c2800nm-mz.124-3.bin
Note: The command is dir usbflashx: where x assumes a value of 0 or 1 depending on which USB port of the router you are using.
Then run the command that orders the router to boot from the image stored on USB flash:
rommon 3> boot usbflash0: c2800nm-ipbase-mz.124-3.bin
program load complete, entry point: 0x8000f000, size: 0x3d240
program load complete, entry point: 0x8000f000, size: 0xe2eb30
Self decompressing the image:
################################################## ########################################
################################################## ############# [OK]
Once the router has booted up, you can now work with the normal IOS command line interface. You can copy the image we have in our USB flash into the internal router’s flash memory:
Router> enable
Router # copy usbflash0: c2800nm-ipbase-mz.124-3.bin flash: c2800nm-ipbase-mz.124-3.bin
From now on, the router will be booting up from the internal flash memory.
Cisco IOS Routers support both static and dynamic routes. In small networks (2 to 5 routers) I would suggest to configure only static routes, especially if the network is not going to change much over time. Of course dynamic routing (using dynamic routing protocols such as RIP, OSPF, EIGRP) is much more flexible and scalable (for larger networks) but gets a little bit tricky to troubleshoot in case of problems. There is also the option to mix static and dynamic routing if needed, but you need to take into consideration issues such as route redistribution (you will usually need to redistribute static routes into the dynamic protocol).
In this post I will try to illustrate static routing using a small network scenario (see picture below) and explain also some other issues related with ICMP Redirects and Cisco ASA firewall.

Network Description
From the example network above, we have a Cisco ASA firewall (ASA1) protecting our internal networks from the Internet. LAN1 is a Class C network subnet (10.1.1.0/24) which has user computers connected (this might be the headquarters LAN of the Enterprise). There is also a Router (R1) serving as a WAN router to connect a distant remote office over a WAN link.
At the other side of the WAN link we have R2 which serves as the Hub router having two spokes (R3, R4). There are also two more LAN networks with user computers (LAN2 connected to R3 and LAN3 connected to R4).
The IP addresses assigned to the network are as following:
ASA1 Internal IP: 10.1.1.254
R1 IP on LAN1 network: 10.1.1.253
R1 IP on the WAN link: 192.168.1.1
R2 IP on the WAN link: 192.168.1.2
R2 IP connected with R3: 192.168.2.2
R2 IP connected with R4: 192.168.3.2
R3 IP connected with R2: 192.168.2.1
R3 IP on LAN2 network: 10.2.1.254
R4 IP connected with R2: 192.168.3.1
R4 IP on LAN3 network: 10.2.2.254
LAN1 network: 10.1.1.0/24
LAN2 network: 10.2.1.0/24
LAN3 network: 10.2.2.0/24
Traffic Flow Requirements
We need to have the following communication between networks:
- LAN1 computers need to access the Internet through the ASA and also must be able to communicate with users and servers on LAN2 and LAN3.
- LAN1 users should be able to communicate also with “transit subnets” for troubleshooting and management purposes (“transit subnets” are the point-to-point networks connecting routers between them). These “transit subnets” are 192.168.1.0/30, 192.168.2.0/30, 192.168.3.0/30.
- LAN2 and LAN3 computers need to access the Internet through the ASA and also must be able to communicate with LAN1 network.
Configuration of Static Routing
The intention of this article is to explain static routing only, so I will not get into the full configuration details of all devices in the network. I will just show snippets of commands for static routes.
The general format of a static route command on a Cisco router is:
Router(config)# ip route [destination network] [mask] [gateway address]
The command above tells the router the following information: “if you want to send a packet to the following “destination network”, then send it to this “gateway address”.
The format of a static route command on a Cisco ASA firewall is:
ASA(config)# route [interface name] [destination network] [mask] [gateway]
Now let’s see the commands needed for each router. It’s more convenient to start from the bottom up:
Router R3:
R3(config)# ip route 0.0.0.0 0.0.0.0 192.168.2.2
We just need a default route on this router to send ALL traffic towards R2 gateway address (192.168.2.2).
Router R4:
R4(config)# ip route 0.0.0.0 0.0.0.0 192.168.3.2
Similar with R3, we just need a default route on this router to send ALL traffic towards R2 gateway address (192.168.3.2).
Router R2:
! Default route
R2(config)# ip route 0.0.0.0 0.0.0.0 192.168.1.1
! Static routes to reach LAN2 and LAN3
R2(config)# ip route 10.2.1.0 255.255.255.0 192.168.2.1
R2(config)# ip route 10.2.2.0 255.255.255.0 192.168.3.1
This is a little tricky. We need both a default route (to send all upwards traffic, including traffic to the Internet, towards R1) and also we need two specific static routes to reach LAN2 and LAN3 network. The two specific static routes (two last lines) are needed for the reply packets from LAN2 and LAN3 and also for LAN1 to be able to reach LAN2/LAN3.
Router R1:
! Default Route towards ASA for Internet Traffic
R1(config)# ip route 0.0.0.0 0.0.0.0 10.1.1.254
! Static routes to reach LAN2 and LAN3
R1(config)# ip route 10.2.1.0 255.255.255.0 192.168.1.2
R1(config)# ip route 10.2.2.0 255.255.255.0 192.168.1.2
! Static routes to reach transit point-to-point networks
R1(config)# ip route 192.168.2.0 255.255.255.252 192.168.1.2
R1(config)# ip route 192.168.3.0 255.255.255.252 192.168.1.2
Firewall ASA1:
ASA1(config)# route outside 0.0.0.0 0.0.0.0 [asa gateway IP]
! Static routes to reach LAN2 and LAN3
ASA1(config)# route inside 10.2.1.0 255.255.255.0 10.1.1.253
ASA1(config)# route inside 10.2.2.0 255.255.255.0 10.1.1.253
The ASA will need a default route towards its default gateway IP (assigned by the ISP), and also two static routes to reach the distant LAN2 and LAN3 networks. You DO NOT need a static route for LAN1 network because it is directly connected to the ASA.
Default Gateway for LAN1 computers
As we said before, one of the traffic flow requirements was to access LAN2 and LAN3 networks from LAN1 computers. If I ask you what should be the default gateway address configured on LAN1 computers, most of you would answer “The ASA internal address 10.1.1.254”. However, this is WRONG. Let me explain why.
Assume you configure the default gateway address for LAN1 hosts to be the ASA address 10.1.1.254. If HostA on LAN1 wants to send traffic to the Internet, then it will send it to its default gateway address (ASA firewall) which will forward the packet to the Internet. So far so good.
However, if HostA wants to send traffic to LAN2 or LAN3 hosts, it will again send the traffic to the ASA which is supposed to send an ICMP Redirect to HostA and tell him “hey, you should really be using 10.1.1.253 to get to LAN2 or LAN3”. However, the Cisco ASA is NOT ABLE to send an ICMP Redirect like it should. Therefore, HostA will never be able to communicate with LAN2/LAN3. If the ASA was a router instead, everything would work fine because routers actually are able to send ICMP Redirects.
So, the correct answer is to configure all hosts on LAN1 network to have Default Gateway address the IP of R1 (10.1.1.253). This way, they will be able to access both the Internet and the other internal LAN networks (LAN2/LAN3).
For any questions or comments please fill out the comment form below.



