Archive for the 'Cisco Routers' Category
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.
One of the main elements to configure on a Cisco router is its interfaces. The router is usually equipped with Ethernet interfaces (for LAN connectivity) or Serial/ATM/T1/E1 interfaces for WAN connectivity. Below you will find three typical router interface configuration scenarios to get an idea about this important setup.
Configuring Ethernet or Fast Ethernet Interfaces
Router> enable
Router # config terminal
! enter the interface configuration submode
Router(config) # interface fastethernet 0/0
! IP configured on the interface
Router(config-if) # ip address 10.1.10.1 255.255.255.0
!bring the interface up
Router (config-if) # no shutdown
Router (config-if) # description lan (assign a name to the interface)
Router (config-if) # exit
Router (config) #
* Note that the interface naming can be different. Examples are FastEthernet, Ethernet, GigabitEthernet etc. Also, the interface numbering varies from router to router, such as 0, 1, 0/0 0/1, etc.
Configuring DTE Serial Interfaces
Note that DTE serial interfaces receive clock from the Serial WAN modem.
Router> enable
Router# config terminal
! enter the interface configuration submode
Router (config) # interface serial 0/0
Router (config-if) # ip address 172.16.1.1 255.255.255.252
Router (config-if) # no shutdown
Router (config-if) # description WAN Network (assign a name to the interface)
Router (config-if) # exit
Router (config) #
* Note that the interface numbering can be 0, 1, 0/0 0/1, etc. This varies by router.
Configuring DCE Serial Interfaces
Note that DCE serial interfaces provide clock to the connected device on the interface.
Router> enable
Router# config terminal
Router(config) # interface serial 0 / 1
Router(config-if) # ip address 10.1.1.1 255.255.255.0
!configure the clock rate that will be provided by the router
Router(config-if) # clock rate 128000
Router(config-if) # no shutdown
Router(config-if) # description WAN Network (assign a name to the interface)
Router(config-if) # exit
Router(config) #
* Note that the interface number can be 0, 1, 0/0 0/1, etc. This varies by router model.
The most common attack against Service Provider IP Networks is Denial of Service. Usually these attacks take the form of “Many-to-One Attacks” where multiple attacking sources send flooding traffic towards a single destination. These attacks are sometimes called Distributed Denial of Service. Usually the attacking hosts are “zombie” computers which are compromised by hackers and belong to a BotNet network. Usually these attacks are directed towards a critical node of the ISP network (a Border Router, a public Server etc).
If the attack contains thousands of non-legitimate connections to initiate TCP communication (SYN packets) towards a single host, the target host gets overloaded from the requested connections because the three-way TCP handshake does not get completed (because these TCP connections have unreachable return addresses, the connections cannot be established). The resulting volume of unresolved open connections eventually overwhelms the server and can cause it to deny service to valid requests. The above attack is also called SYN Attack.

TCP Intercept is a feature on routers used to prevent and mitigate TCP SYN-flooding attacks by monitoring the rate of SYN packets and intervening inside the TCP communication whenever necessary in order to reduce the number of incomplete TCP connections.
There are two modes for TCP Intercept: “Intercept Mode” and “Watch Mode”.
Intercept Mode
The most “invasive” mode is “Intercept Mode”. The router establishes a connection with the client on behalf of the destination server, and if successful, establishes the connection with the server on behalf of the client and knits the two half-connections together transparently. This means that if the connection is legitimate, it will reach the server with no problem. If the connection is from a non-legitimate client, the half-open connection will be dropped by the router. This mode consumes a lot of memory and CPU on the router.
Watch Mode
We recommend using the “Watch Mode” instead of the “Intercept Mode”. In Watch Mode, the router passively watches the connection requests flowing through the router. If a connection fails to get established in a configurable interval, the software intervenes and terminates the connection attempt.
Configuration of TCP Intercept
On router connecting the host under attack, configure the following (assume target host under attack is 1.1.1.1):
Router(config)# access-list 101 permit tcp any host 1.1.1.1
Router(config)# ip tcp intercept mode watch
Router(config)# ip tcp intercept list 101
The above configuration will watch the TCP SYN packets towards host 1.1.1.1. If the SYN packets exceed a certain default value, the router starts to close incomplete TCP connections. Specifically, if the number of incomplete connections exceed 1,100, or the number of connections arriving in the last one-minute period exceed 1,100, each new arriving connection causes the oldest partial connection (or a random connection) to be deleted. These are the default values, which can be altered.
In order for two Layer 3 devices (routers or layer 3 switches) to be able to exchange routing information, it is necessary to use the same routing protocol, such as RIP, EIGRP, OSPF, BGP, etc. Different routing protocols, or protocols configured differently (eg different EIGRP autonomous system) do not exchange information.
However, when a device learns routing information from different sources (eg static routes or using different protocols) Cisco IOS allows the information learned from a specific source to be published to other devices using a different protocol. For example, a route learned through RIP can be advertised to other devices using OSPF. This is what is called “redistribution” of routes: Using a routing protocol to advertise routes that are learned through other means (other protocol, static routes or directly connected). To configure route redistribution some rules must be in place:
- The redistributed route must be present in the routing table.
- The redistributed route will be received by the neighbouring device with a new metric as configured by the redistributing router.
What is it used for?
In principle it is desirable that a network should use a single routing protocol. However, in some cases we may require the use of redistribution: two companies merged, different departments of a company managed by different teams, multi-vendor environments, migration, etc. When addressing a redistribution of routes scenario we should take into account particular aspects of routing: different metrics, administrative distance of each protocol, the capabilities of classful and classless routing, and network topology.
Metrics
Each routing protocol uses a different metric. This causes the routes redistributed to lose the original metric of the protocol and the metric is redefined in terms of the new protocol. For example, if an OSPF route is redistributed with a metric of 1642 in RIP, RIP metric uses number of hops (between 1 and 15). So you must change the metric before redistributing to RIP.
The metric with which a protocol receives the routes learned by another metric is called seed metric.
Each protocol uses a default seed metric:
RIP – default seed metric: infinity.
EIGRP – default seed metric: infinity.
OSPF – default seed metric: 20.
The default seed metric can also be modified using the “default metric” command.
The basic commands
When you configure redistribution of protocols, you should indicate how to redistribute routing information, and how we want to measure these routes (metric) when they are redistributed. If we do not indicate anything, the routes are redistributed with the default metric.
Router (config) # router rip
Router (config-router) # network 129.100.0.0
Router (config-router) # redistribute ospf 1 metric 2
In this example we tell the router to redistribute routing information into RIP when learned through the OSPF process 1 which is in the routing table, with a metric of 2 hops.
Redistribution in EIGRP
To redistribute routing information into EIGRP, it should be noted that the default metric is infinite. Therefore, if you do not specify metric for redistributed routes, they will not appear in the routing table of the neighbouring device.
Furthermore, by defining the metric it should be noted: bandwidth, delay, reliability, load and MTU.
An example:
Router (config) # router eigrp 100
Router (config-router) # redistribute static
Router (config-router) # redistribute rip
Router (config-router) # default-metric 10000 100 255 1 1500
Redistribution in OSPF
The default metric used by OSPF is 20, so it does not require us to specify a metric for the route learned by the adjacent devices. However, when there are multiple subnets on the same network and you want to publish routes for each subnet, you must configure a metric otherwise OSPF will summarize all subnets in the class boundary and publish a single route.
An example:
Router (config) # router ospf 1
Router (config-router) # redistribute static metric 200 subnets
Router (config-router) # redistribute eigrp 100 metric 500 subnets
RIP redistribution
Like EIGRP, RIP redistributes the protocols using a default metric of infinity, so it is necessary to specify a different metric in order for the neighbour router to incorporate the routing information in its table.
An example:
Router (config) # router rip
Router (config-router) # redistribute static metric 1
Router (config-router) # redistribute ospf 1 metric 2



