Chapter 3
Chapter 3
Routers
A Router is a computer, just like any other computer including a PC. Routers have many of the
same hardware and software components that are found in other computers including:
CPU
RAM
ROM
Operating System
Router is the basic backbone for the Internet. The main function of the router is to connect two or
more than two network and forwards the packet from one network to another. A router connects
multiple networks. This means that it has multiple interfaces that each belong to a different IP
network. When a router receives an IP packet on one interface, it determines which interface to
use to forward the packet onto its destination. The interface that the router uses to forward the
packet may be the network of the final destination of the packet (the network with the destination
IP address of this packet), or it may be a network connected to another router that is used to
reach the destination network. A router uses IP to forward packets from the source network to
the destination network. The packets must include an identifier for both the source and
destination networks. A router uses the IP address of the destination network to deliver a packet
to the correct network. When the packet arrives at a router connected to the destination network,
the router uses the IP address to locate the specific computer on the network.
A router uses IP to forward packets from the source network to the destination network. The
packets must include an identifier for both the source and destination networks. A router uses the
IP address of the destination network to deliver a packet to the correct network. When the packet
arrives at a router connected to the destination network, the router uses the IP address to locate
the specific computer on the network.
The primary responsibility of a router is to direct packets destined for local and remote networks
by:
The router uses its routing table to determine the best path to forward the packet. When the
router receives a packet, it examines its destination IP address and searches for the best match
with a network address in the router’s routing table. The routing table also includes the interface
to be used to forward the packet. Once a match is found, the router encapsulates the IP packet
into the data link frame
2. Static routing
Static routes are configured manually, network administrators must add and delete static routes
to reflect any network topology changes. In a large network, the manual maintenance of routing
tables could require a lot of administrative time. On small networks with few possible changes,
static routes require very little maintenance. Static routing is not as scalable as dynamic routing
because of the extra administrative requirements. Even in large networks, static routes that are
intended to accomplish a specific purpose are often configured in conjunction with a dynamic
routing protocol.
A network consists of only a few routers. Using a dynamic routing protocol in such a case does
not present any substantial benefit. On the contrary, dynamic routing may add more
administrative overhead.
A network is connected to the Internet only through a single ISP. There is no need to use a
dynamic routing protocol across this link because the ISP represents the only exit point to the
Internet.
Those network that are directly connected to the Router are called connected routes and are not
needed to configure on the router for routing. They are automatically routed by the Router.
Dynamic Routes: Dynamic routing protocol uses a route that a routing protocol adjusts
automatically for topology or traffic changes. Non-adaptive routing algorithm When a ROUTER
uses a non-adaptive routing algorithm it consults a static table in order to determine to which
computer it should send a PACKET of data. This is in contrast to an ADAPTIVE ROUTING
ALGORITHM, which bases its decisions on data which reflects current traffic conditions (Also
called static route) adaptive routing algorithm When a ROUTER uses an adaptive routing
algorithm to decide the next computer to which to transfer a PACKET of data, it examines the
traffic conditions in order to determine a route which is as near optimal as possible. For example,
it tries to pick a route, which involves communication lines which have light traffic. This
strategy is in contrast to a NON-ADAPTIVE ROUTING ALGORITHM. (Also called Dynamic
route)
3. Dynamic routing
Dynamic routing is a technique in which a router learns about routing information without an
administrator’s help and adds the best route to its routing table. A router running a dynamic
routing protocol adds the best route to its routing table and can also determine another path if the
primary route goes down. Also a networking technique provides optimal data routing. Unlike
static routing, dynamic routing enables routers to select paths according to real-time logical
network layout changes
At the dynamic routing section, we will discuss the implementation of RIPv1, RIPv2, EIGRP,
and Single-Area OSPF.
Routing Protocol:
A routing protocol is the communication used between routers. A routing protocol allows routers
to share information about networks and their proximity to each other. Routers use this
information to build and maintain routing tables. Autonomous System: An AS is a collection of
networks under a common administration that share a common routing strategy. To the outside
world, an AS is viewed as a single entity. The AS may be run by one or more operators while it
presents a consistent view of routing to the external world.
Exterior Routing Protocol (EGP): Between the Autonomous System. Example BGP (Boarder
gateway protocol).
Metric:
There are cases when a routing protocol learns of more than one route to the same destination.
To select the best path, the routing protocol must be able to evaluate and differentiate between
the available paths. For this purpose a metric is used. A metric is a value used by routing
protocols to assign costs to reach remote networks. The metric is used to determine which path is
most preferable when there are multiple paths to the same remote network. Each routing protocol
uses its own metric. For example, RIP uses hop count, EIGRP uses a combination of bandwidth
and delay, and Cisco’s implementation of OSPF uses bandwidth.
Viewing the Default Configuration
When you first boot up your Cisco router, some basic configuration has already been performed.
All of the LAN and WAN interfaces have been created, console and VTY ports are configured,
and the inside interface for Network Address Translation has been assigned. Use the show
running-config command to view the initial configuration.
You need to gather some or all of the following information, depending on your planned network
scenario, prior to configuring your network
Perform these steps to configure selected global parameters for your router:
The Fast Ethernet LAN interfaces on your router are automatically configured as part of the
default VLAN and as such, they are not configured with individual addresses. Access is afforded
through the VLAN. You may assign the interfaces to other VLANs if desired.
Configure WAN Interfaces
The Cisco 851 and Cisco 871 routers each have one Fast Ethernet interface for WAN connection.
The Cisco 857, Cisco 877, and Cisco 878 routers each have one ATM interface for WAN
connection. Based on the router model you have, configure the WAN interface(s) using one of
the following procedures:
This procedure applies only to the Cisco 851 and Cisco 871 router models. Perform these steps
to configure the Fast Ethernet interface, beginning in global configuration mode:
This procedure applies only to the Cisco 857, Cisco 876, Cisco 877 and Cisco 878 models.
Perform these steps to configure the ATM interface, beginning in global configuration mode:
The loopback interface acts as a placeholder for the static IP address and provides default routing
information
Configuration Example
The loopback interface in this sample configuration is used to support Network Address
Translation (NAT) on the virtual-template interface. This configuration example shows the
loopback interface configured on the Fast Ethernet interface with an IP address of
10.10.10.100/24, which acts as a static IP address. The loopback interface points back to virtual-
template1, which has a negotiated IP address.
interface loopback 0
ip nat outside
!
interface Virtual-Template1
ip unnumbered loopback0
no ip directed-broadcast
ip nat outside
To verify that you have properly configured the loopback interface, enter the show interface
loopback command. You should see verification output similar to the following example.
Perform these steps to configure parameters to control access to the router, beginning in global
configuration mode.
Configuring Command-Line Access to the Router
Configuration Example
The following configuration shows the command-line access commands. You do not need to
input the commands marked “default.” These commands appear automatically in the
configuration file generated when you use the show running-config command.
line con 0
exec-timeout 10 0
password 4youreyesonly
login
stopbits 1 (default)
line vty 0 4
password secret
login
!
5. RIP
Routing Information Protocol (RIP) is a distance-vector routing protocol. Routers running the
distance-vector protocol send all or a portion of their routing tables in routing-update messages
to their neighbors. You can use RIP to configure the hosts as part of a RIP network. This type of
routing requires little maintenance and also automatically reconfigures routing tables when your
network changes or network communication stops. RIPv2 was added to the System product so
you can send and receive RIP packets to update routes throughout your network.
In the following figure, a static route is added to the central system (AS1) that describes the
connection to the network 10.1.1.x by way of AS2. This is a static route (added by your network
administrator) with route redistribution set to yes. This setting causes this route to be shared with
other routers and systems so that when they have traffic for 10.1.1.x, they route the traffic to
your central System i platform (AS1). AS2 has the routed system started so that it sends and
receives RIP information. In this example, AS1 is sending the message that AS2 has a direct
connection to 10.1.2.x.
The following process describes the routing of traffic in the preceding figure.
AS1 receives this RIP packet from AS2 and processes it. If AS1 does not have a route to
10.1.2.x, it will store this route. If it does have a path to 10.1.2.x that is the same number
of hops or fewer, it will discard this new route information. In this example, AS1 keeps
the route data.
AS1 receives information from R1 with route information to 10.1.5.x. AS1 keeps this
route information.
AS1 receives information from R2 with route information to 10.1.3.x. AS1 keeps this
route information.
The next time AS1 sends RIP messages, it will send information to R1 that describes all
the connections AS1 knows about that R1 might not know about. AS1 sends route
information about 10.1.1.x, 10.1.2.x, and 10.1.3.x. AS1 does not send information about
10.1.4.x to R1 because AS1 knows that R1 is connected to 10.1.4.x and does not need a
route. Similar information is sent to R2 and AS3.
When would you need this: When you need to implement a routing protocol for a small network
and you need the configuration to be simple. Routing Information Protocol is the simplest that it
can get.
1. The first thing to do is to enable the RIP protocol on the router: Router(config)#router rip
2. Identify the networks to be advertised using the ‘network’ command. Using this
command, you need to identify only the networks that are directly connected to the
router: Router(config-router)#network network-id If the network is sub netted, you will
need to write the main network address without the need to write the subnets. For
example, if you have the following subnets connected to the router (172.16.0.0/24,
172.16.1.0/24, and 172.16.2.0/24), you can put them all in single ‘network’ command
like this: Router(config router) #network 172.16.0.0. The router is intelligent enough to
figure out which subnets are connected to the router.
3. If you need to adjust the timers (update, invalid, hold down, and flush timers), use the
‘timers basic’ command. All the four parameters of this command, update, invalid, hold
down, and flush timer consecutively, are in seconds: Router (config-router)#timers basic
30 180 180 240 The example above is set with the default values of the RIP timers.
Remember to keep the relativity of the timer values. Always keep it as (n 6n 6n 8n). If,
for example, you set the update timer to 40, you need to make the other timers 240 240
320 consecutively. It is highly recommended that you keep the timers on their default
values.
4. You will need to stop the updates from being broadcasted to the Internet, if one of the
router interfaces is connected to the Internet. For this purpose, use the ‘passive interface’
command. This command prevents the interface from forwarding any RIP broadcasts, but
keeps the interface listening to what others are saying in RIP. Router (config
router)#passive-interface interface-type interface-number where interface-type is the type
of the interface, such as Serial, Fast Ethernet, or Ethernet. Interface-number is the number
of the interface such as 0/0 or 0/1/0
5. RIP, by nature, sends updates as broadcast. If the router is connected through non-
broadcast networks (like Frame Relay), you will need to tell RIP to send the updates on
this network as unicast. This is achieved by the ‘neighbor’ command: Router (config-
router)#neighbor neighbor-address where neighbor-address is the IP address of the
neighbor.
6. Cisco’s implementation of RIP Version 2 supports authentication, key management, route
summarization, classless inter-domain routing (CIDR), and variable-length subnet masks
(VLSMs). By default, the router receives RIP Version 1 and Version 2 packets, but sends
only Version 1 packets. You can configure the router to receive and send only Version 2
packets. To do so, use the ‘version’ command: Router (config-router)#version 2 If you
like to stick to version one, just replace the 2 in the command above with 1. Furthermore,
you can control the versions of the updates sent and received on each interface to have
more flexibility in support of both versions. This is achieved by the ‘ip rip send version’
and ‘ip rip receive version’ commands:
Router (config-if)#ip rip send version 2
Router (config-if)#ip rip receive version 1
7. Check the RIP configuration using these commands:
Router#show ip route
Router#show ip protocols
Router#debug ip rip
8. IGRP
Interior Gateway Routing Protocol (IGRP) is a distance vector interior routing protocol (IGP)
invented by Cisco. It is used by routers to exchange routing data within an autonomous system.
IGRP is a proprietary protocol. IGRP was created in part to overcome the limitations of RIP
(maximum hop count of only 15, and a single routing metric) when used within large networks.
IGRP supports multiple metrics for each route, including bandwidth, delay, load, MTU, and
reliability; to compare two routes these metrics are combined together into a single metric, using
a formula which can be adjusted through the use of pre-set constants. The maximum hop count
of IGRP-routed packets is 255 (default 100), and routing updates are broadcast every 90 seconds
(by default).
IGRP is considered a classful routing protocol. Because the protocol has no field for a subnet
mask, the router assumes that all sub network addresses within the same Class A, Class B, or
Class C network have the same subnet mask as the subnet mask configured for the interfaces in
question. This contrasts with classless routing protocols that can use variable length subnet
masks. Classful protocols have become less popular as they are wasteful of IP address space.
In order to address the issues of address space and other factors, Cisco created EIGRP (Enhanced
Interior Gateway Routing Protocol). EIGRP adds support for VLSM (variable length subnet
mask) and adds the Diffusing Update Algorithm (DUAL) in order to improve routing and
provide a loopless environment. EIGRP has completely replaced IGRP, making IGRP an
obsolete routing protocol. In Cisco IOS versions 12.3 and greater, IGRP is completely
unsupported. In the new Cisco CCNA curriculum (version 4), IGRP is mentioned only briefly, as
an “obsolete protocol”.
The IGRP protocol allows a number of gateways to coordinate their routing. Its goals are the
following:
Stable routing even in very large or complex networks. No routing loops should occur,
even as transients.
Fast response to changes in network topology.
Low overhead. That is, IGRP itself should not use more bandwidth than what is actually
needed for its task.
Splitting traffic among several parallel routes when they are of roughly equal desirability
Taking into account error rates and level of traffic on different paths.
Router A
RouterA# conf t
RouterA(config-if)# exit
RouterA(config-if)# exit
RouterB# conf t
RouterB(config-if)# exit
A few other commands might come in useful. Variance 2 can be used to configure IGRP to load
balance between equal cost paths. The command passive-interface eth0 disables IGRP from
sending updates out of eth0.
Testing
Only shows the sending or receiving of IGRP packets and the number of routes in each update. It
does show the routes that are advertised!
Sames as debug ip igrp events but also shows the routes that are advertised.
As with debugging any routing problem, look at the routing table. Is there a static route that takes
precendece?
This command is always useful to quickly verify which links are and which aren’t.
9. EIGRP
EIGRP neighbors find one another using EIGRP “Hello” packets, which are sent to 224.0.0.10 (a
Class “D” link-local multicast address). When a new neighbor is found, the two neighbors
exchange routing information via EIGRP “Update” packets. Like a standard D-V protocol this
information is made up of routing table entries, but unlike a standard D-V protocol EIGRP
“Ack” packets are used to acknowledge the updates. Once the neighbors exchange routing
information, they only receive updates when routing table changes occur, and the neighbor
relationship is maintained with periodic “Hello” packets.
When a neighbor gives routing information, the receiving router places the information in its
EIGRP “topology table”, which is stored in RAM and is a compilation of the neighbors’ routing
tables. Then the router determines the best next hop for each known destination with the
Diffusing Update Algorithm (DUAL) which it places in its own routing table.
When would you need this: When you are implementing a routing protocol on a large
Internetwork and all the networking devices involved are Cisco devices or devices supporting
EIGRP.
Special Requirements: EIGRP is a Cisco proprietary protocol. So, either all the routers in the
Internetwork must be Cisco routers, or the routers should be EIGRP capable.
Before we start, if you have not set the bandwidth of the interfaces, set them now. For correct
routing decisions, you need to set the bandwidth for the serial interfaces depending on the WAN
technologies that you are using. This is done using the following command on each serial
interface:
Where bandwidth is the bandwidth of the WAN connection in kilobits per second.
1. Enable EIGRP on the router with the command, Router (config)#router eigrp
autonomous-system where autonomous-system is the autonomous system number. The
same autonomous-system number must be used for all the routers that you want to
exchange routing information.
2. Instruct the router to advertise the networks that are directly connected to it. Router
(config-router) #network network-address where network-address is the network address
of a network that is directly connected to the router. Repeat this step for each network
that is directly connected to the specific router that you are configuring. For sub netted
networks, remember that you need only to write the original network address of a group
of subnets and the router will automatically identify the subnets. For example, if the
router is connected to the networks, 172.16.1.0/24, 172.16.2.0/24, and 172.16.3.0/24, you
will need to do one ‘network’ command with the address 172.16.0.0.
3. By default, EIGRP packets consume a maximum of 50% of the link bandwidth, as
configured with the ‘bandwidth’ interface configuration command. You might want to
change that value if a different level of link utilization is required or if the configured
bandwidth does not match the actual link bandwidth (it may have been configured to
influence route metric calculations). Use the following command to set the percentage of
bandwidth to be used on each interface separately:
4. You can change the intervals of the hello packets and the hold down timer on each
interface using command:
Router (config-if) #ip hello-interval eigrp autonomous system timer where autonomous-
system is the autonomous system number and time is the new hello packet interval time
in seconds. Router (config-if) #ip hold-time eigrp autonomous-system time
Where autonomous-system is the autonomous system number and time is the new hold
down time in seconds.
5. Check your configuration on the routers after configuring all the routers in the
internetwork using the following commands: To display information about interfaces
configured for EIGRP.
Router #show ip eigrp neighbors to display the EIGRP topology table for a given process.
Or
Router #show ip eigrp topology network-address subnet mask To display the number of
packets sent and received for all or a specified EIGRP process. Router #show ip
eigrp traffic autonomous-system where interface-type is the interface type. Autonomous-
system autonomous system number. Network-address and subnet mask are the network
address and subnet mask.
1. If you are using discontinuous networks, which is mostly the case, you should turn off
auto-summarization using the following command: Router (config)#no ip auto-summary.
2. You can set manual summary addresses using the following command: Router (config-
if)#ip eigrp summary address autonomous system summarized-network summary-subnet
mask where autonomous-system is the autonomous system number and summarized
summarized-network is the network address expressing the summary of multiple
networks. Summary-subnet mask is the subnet mask for the summarized address.
3. When you are using non-broadcast networking technologies such as Frame Relay and
SMDS, you will need to turn off split-horizon to let EIGRP perform efficiently and
effectively.
10. OSPF
The OSPF (Open Shortest Path First) protocol is one of a family of IP Routing protocols, and is
an Interior Gateway Protocol (IGP) for the Internet, used to distribute IP routing information
throughout a single Autonomous System (AS) in an IP network.
The OSPF protocol is a link-state routing protocol, which means that the routers exchange
topology information with their nearest neighbors. The topology information is flooded
throughout the AS, so that every router within the AS has a complete picture of the topology of
the AS. This picture is then used to calculate end-to-end paths through the AS, normally using a
variant of the Dijkstra algorithm. Therefore, in a link-state routing protocol, the next hop address
to which data is forwarded is determined by choosing the best end-to-end path to the eventual
destination.
The main advantage of a link state routing protocol like OSPF is that the complete knowledge of
topology allows routers to calculate routes that satisfy particular criteria. This can be useful for
traffic engineering purposes, where routes can be constrained to meet particular quality of
service requirements. The main disadvantage of a link state routing protocol is that it does not
scale well as more routers are added to the routing domain. Increasing the number of routers
increases the size and frequency of the topology updates, and also the length of time it takes to
calculate end-to-end routes. This lack of scalability means that a link state routing protocol is
unsuitable for routing across the Internet at large, which is the reason why IGPs only route traffic
within a single AS.
Each OSPF router distributes information about its local state (usable interfaces and reachable
neighbors, and the cost of using each interface) to other routers using a Link State Advertisement
(LSA) message. Each router uses the received messages to build up an identical database that
describes the topology of the AS.
From this database, each router calculates its own routing table using a Shortest Path First (SPF)
or Dijkstra algorithm. This routing table contains all the destinations the routing protocol knows
about, associated with a next hop IP address and outgoing interface.
The protocol recalculates routes when network topology changes, using the Dijkstra
algorithm, and minimizes the routing protocol traffic that it generates.
It provides support for multiple paths of equal cost.
It provides a multi-level hierarchy (two-level for OSPF) called "area routing," so that
information about the topology within a defined area of the AS is hidden from routers
outside this area. This enables an additional level of routing protection and a reduction in
routing protocol traffic.
All protocol exchanges can be authenticated so that only trusted routers can join in the
routing exchanges for the AS.
When would you need this: When you need to set up dynamic routing with Cisco and non-Cisco
routers?
OSPF is one of the most widely used dynamic routing protocols. Cisco’s version of OSPF is
compatible with non-Cisco routers. Single-area OSPF is suitable for small-to-medium
internetworks. An area is a logical grouping of routers running OSPF. All routers in the same
area share the same topology database. Multiple-Area OSPF is used for large networks to
prevent their topology databases from becoming out of the capability of the router. Single-area
OSPF configuration is as follows:
Since OSPF best route calculations rely solely on bandwidth, you need to set up the
bandwidth of the serial interface involved in the routing process using the following
command on the interface: Router(config-if)#bandwidth bandwidth Where: bandwidth is
the bandwidth of the connection in kilobits per second. Remember that this command
does not change the actual bandwidth. It only changes the bandwidth value being used by
the routing protocol for the purpose of best path calculation.
Instruct the router to activate the OSPF routing process: Router (config)#router ospf
process-number Where: process-number is the process number of OSPF. This process
number is of local significance. It does not have to be the same on all routers.
Instruct the router to advertise the directly connected networks: Router(config-
router)#network network-address wildcard mask area 0 Where: network-address is the
network address of a directly connected network. Wildcard-mask is the wildcard mask of
the network address. Since we are setting a single-area OSPF, we will always use ‘area
0’.
Repeat step 3 for every network that is directly connected to the router. If you finished
the first four steps on all the routers involved in the process, everything should work just
fine.
If you want to do more configurations, there are a few optional advanced steps to go through:
To change the selection process of the DR (Designated Router) and BDR (Backup
Designated Router), use the following command to change the router’s OSPF priority on
a certain interface: Router(config)#ip ospf priority priority Where: priority is the priority
(0–255). The router with the highest priority becomes the DR. A priority of 0 means that
this router will never be elected as DR.
To restart the whole process of DR and BDR elections, use the command: Router#clear
ip ospf process *
To change the cost of a certain link in the OSPF process, use the following command:
Router(config-if)#ip ospf cost suggested-cost Where: CC is the suggested cost (0–65,
535).
When would you need this: When you need to set up dynamic routing with Cisco and non-Cisco
routers Special Requirements: None.
Router(config-if)#ipv6 enable
Where ipv6-address is the IPv6 address you want to assign to this interface. Prefix-length is the
prefix length for the IPv6 address.
Repeat step 4 for every network that is directly connected to the router. If you finished
the first four steps on all the routers involved in the process, everything should work just
fine.
If you want to do more configurations, there are a few optional advanced steps to go through:
To change the selection process of the DR (Designated Router) and BDR (Backup
Designated Router), use the following command to change the router’s OSPF priority on
a certain interface: Router(config)#ipv6 ospf priority priority where priority is the priority
(0–255). The router with the highest priority becomes the DR. A priority of 0 means that
this router will never be elected as DR.
To restart the whole process of DR and BDR elections, use the command: Router#clear
ipv6 ospf process *
To change the cost of a certain link in the OSPF process, use the following command:
Router(config-if)#ipv6 ospf cost suggested-cost
Where CC is the suggested cost (0–65,535) For troubleshooting, you can use the following
commands:
11. DHCP
Every device on a TCP/IP-based network must have a unique unicast IP address to access the
network and its resources. Without DHCP, IP addresses for new computers or computers that are
moved from one subnet to another must be configured manually; IP addresses for computers that
are removed from the network must be manually reclaimed. With DHCP, this entire process is
automated and managed centrally. The DHCP server maintains a pool of IP addresses and leases
an address to any DHCP-enabled client when it starts up on the network. Because the IP
addresses are dynamic (leased) rather than static (permanently assigned), addresses no longer in
use are automatically returned to the pool for reallocation.
The network administrator establishes DHCP servers that maintain TCP/IP configuration
information and provide address configuration to DHCP-enabled clients in the form of a lease
offer. The DHCP server stores the configuration information in a database that includes:
Benefits of DHCP
When would you need this: When your ISP gives you a dynamic IP address upon each
connection or you need to configure the router to obtain its interface IP address automatically.
Special Requirements: None.
Router(config-if)#ip address dhcp Some service providers might ask you to use a client-id and/or
a hostname of their own choice. This can be done by adding the following parameters to the
command above:
Where interface-name is the interface name that will be used for the client-id and hostname is the
hostname that will be used for the DHCP binding. This hostname can be different from the one
that was set for the router in the global configuration. You can use both of these parameters, one
of them, or none of them.
Special Requirements: DHCP server software is supported for these series: 800, 1000, 1400,
1600, 1700 series (support for the Cisco 1700 series was added in Cisco IOS Release 12.0[2]T),
2500, 2600, 3600, 3800, MC3810, 4000, AS5100, AS5200, AS5300, 7000, 7100, 7200, MGX
8800 with an installed Route Processor Module, 12000, uBR900, uBR7200, Catalyst 5000
family switches with an installed Route Switch Module, Catalyst 6000 family switches with an
installed MultiLayer Switch Feature Card, and Catalyst 8500.
Implementation notes:
You can create a DHCP database agent that stores the DHCP binding database. A DHCP
database agent is any host; for example, an FTP, TFTP, or RCP server that stores the
DHCP bindings’ database. You can configure multiple DHCP database agents, and you
can configure the interval between database updates and transfers for each agent. To
configure a database agent and database agent parameters, use the following command in
global configuration mode:
If you choose not to configure a DHCP database agent, disable the recording of DHCP address
conflicts on the DHCP server. To disable DHCP address conflict logging, use the following
command in global configuration mode:
DHCP service uses port 67 and 68. So, if you are using a firewall, remember to open
these ports. To clear DHCP server variables, use the following commands as needed:
If you want to clear a certain binding not all of them, replace the * in the previous command with
the IP address to be cleared.
How to Configure a Cisco Router as a DHCP Server for IPv6
When would you need this: When using the router as a DHCP server to provide IPv6 in stateless
and stateful configuration of DHCPv6.
NAT is used to convert a private IP address into a public IP address and also a public IP address
into a private IP address. We use NAT due to the shortage of IP addresses. IP Version 4 is a 32-
bit address and it has almost 4.3 billion IP addresses, but the population of the world is much
higher and it is approximately about 7.8 billion as of the latest reports of June 2020. Most of
them use multiple gadgets and devices like smartphones, laptops, tablets and many more for
accessing the internet for various needs. All these devices need an IP address. So, 4.3 billion IP
addresses is not sufficient for more than 7.8 billion people. Hence, we use NAT. It is also used to
convert a private IP address onto public and public IP address into private.
Port Address Translation (PAT)
PAT is the port address translation. Initially when NAT was there it was very easy and thought
everything was too easy with only NAT. But, when multiple users open one website from one pc
and give a second request to open a second website, the IP address is the same. So, there arises
confusion on where the contents need to be delivered and fetched on which Multipage. If it was a
single request, then NAT was enough but when multiple requests are coming from one pc itself
then which content to be displayed on which page there was a confusion. Then, the PAT
technology came into use. Along with NAT even PAT is important because, by using NAT the ip
address was carried and translated. However, by using PAT, the port from which content is to be
carried to which port is done.
When would you need this: When you want to connect a local network to the Internet and the
available global IP addresses are less than the local IP addresses. This can also be used as an
additional security feature.
There are two types of NAT that can be configured on a Cisco router: static and dynamic.
This type is used when you want to do one-to-one assignment of global (namely public) IP
addresses to local IP addresses.
Establish static translation between an inside local address and an inside global address:
Router(config)#ip nat inside source static local-ip-address global-ip-address where local-
ip address is the (inside) local address and global-ip-address is the (inside) global address.
Specify the local interface (the interface connected to the internal network). This is done
by going to the interface configuration mode and issuing:
Router(config-if)#ip nat inside
Specify the global interface (the interface connected to the external network).
This is done by going to the interface configuration mode and issuing:
Router(config-if)#ip nat outside
This type is used when you want the router to do the mapping dynamically. This method is
useful when you have too many global and local addresses and you do not want to do the
mapping manually, or when the number of global addresses available is less than the local
addresses.
A. The number of global IP addresses is more than one and it is equal or less than the
local addresses.
Define a pool of global addresses that would be employed in the translation:
Router(config)#ip nat pool pool-name first-public-address last-public-address netmask
public-subnetmask.
Where pool-name is the name of the pool, first-public-address is the starting IP address of the
pool, last-public-address is the end IP address of the pool, and public-subnetmask is the subnet
mask of the network that the pool is part of (i.e., the global network).
Define the range of local addresses permitted to participate in the translation using an
access-list:
Where access-list-number is the number of the access-list, which is usually a standard access list;
thus, the number can be any number from 1 to 99; local-network-address is the network address
of the local network or the starting IP address of the range; and wildcard-mask is the wildcard
mask used to define the range. You can issue more than one access-list sentence in the same
access-list to define the specific IP address range(s). If you are not familiar with wildcard masks,
refer to the note in section.
Associate the pool and the local range in a dynamic NAT translation command:
Router(config)#ip nat inside source list access-list number pool nat-pool-name [overload]
Where : access-list-number is the number of the access-list, nat-pool-name is the name of the
global pool, and overload : This parameter must be used when you have global IP addresses less
than local IP addresses (this type of NAT is also known as Port Address Translation, PAT).
Specify the local interface. This is done by going to the interface configuration mode and
issuing:
Specify the global interface. This is done by going to the interface configuration mode
and issuing:
B. The other scenario is when there is only one global IP address and a group of local
IP addresses.
In this case, the only global IP address is assigned to the interface connected to the global
network.
Define the range of local addresses permitted to participate in the translation using an
access-list:
Where: access-list-number is the number of the access-list, which is usually a standard accesslist;
thus, the number can be any number from 1 to 99, local-network-address is the network address
of the local network or the starting IP address of the range, and wildcard-mask is the wildcard
mask used to define the range. You can issue more than one access-list sentence in the same
access-list to define the specific IP address range(s). If you are not familiar with wildcard masks,
refer to the note in Section.
Associate the pool and the local range in a dynamic NAT translation command:
Where: access-list-number is the number of the access-list, interface-type is the type of the
interface that has the global IP address (e.g., serial or Ethernet), and interface-number is the
number of the interfaces. An example of the interface type and number is serial 0 or Ethernet 0/0.
Specify the local interface. This is done by going to the interface configuration mode and
issuing: Router(config-if)#ip nat inside
Specify the global interface. This is done by going to the interface configuration mode
and issuing:
Router(config-if)#ip nat outside
Troubleshooting Commands
Note that these translations have a certain lifetime. They do not remain in the list forever. If you
need to test your NAT configuration, ping to an outside host from an inside host and look for the
translations immediately.
Router#debug ip nat
Disabling NAT
Remove the NAT assignment command by preceding it with a ‘no’. For example,
Remove the access-list, if any, by putting ‘no’ ahead of the command: Router(config)#no
access-list access-list-number
13. PPP
Point-to-Point Protocol (PPP) refers to a suite of computer communication protocols that provide
a standard way to transport multiprotocol data over point-to-point links. PPP has the following
three main components:
In terms of the Open Systems Interconnection model, however, PPP provides Layer 2, or data
link layer, service that creates the foundation for network layer protocols to operate on top. From
an operational standpoint, PPP is a peer-to-peer protocol, meaning that either side of the link can
be used to establish a PPP connection. However, when it is put in real-world situations, there
typically is a PPP server that operates as a connection hub for multiple PPP clients. The PPP
server sits idle until a PPP client attempts to establish a connection. If the PPP server is
configured for authentication, the server responds to the client with an authentication request.
PPP can use Challenge-Handshake Authentication Protocol or Password Authentication
Protocol. Once authenticated, the final step is to establish the Network Control Protocol (NCP)
used between systems. The most commonly used NCP is Internet Protocol Control Protocol.
Once established, the client and server can begin communicating and transmitting packets
between each other.
When would you need this: When you are creating a WAN link. This procedure might also be
required when the other end of a WAN link is not a Cisco router. Point-to-Point Protocol can be
used in synchronous, asynchronous, HSSI, and ISDN links.
A. Get to the interface configuration mode of the router’s serial interface and issue the
following command,
Router(config-if)#encapsulation ppp
B. If you want to configure authentication (which is almost always the case), go through the
following steps:
Choose the authentication type: Password Authentication Protocol (PAP) or
Challenge Handshake Authentication Protocol (CHAP)
Router(config-if)#ppp authentication authentication type
Where authentication type is the authentication type, which can be: PAP, CHAP, PAP
CHAP, or CHAP PAP. The last two choices are to use the second authentication type
when the first one fails. CHAP is strongly recommended over PAP for two reasons. First,
PAP sends the username and password in plaintext, while CHAP sends hashed challenges
only.
Second is that CHAP does an operation similar to periodic re-authentication in the middle
of the communication session, such that it provides more security than PAP.
Set a username and a password that the remote router would use to connect to
your local router. You can define many username/password pairs for many PPP
connections to the same router.
Router(config)#username remote-username password remote-password
Where remote-username is username sent from the remote router, and remote-password
is its password. If the remote router was not configured with a username to send, it will
send its hostname instead. Issue this command once for each PPP connection. For
example, if you are connecting RouterA to RouterB and RouterC, on RouterA issue this
command once for each remote router.
Now, you can set the username and password that your local router would send to
access the remote router. For PAP authentication, you can specify the username
and password that the local router will send to the remote router for authentication
using the following command,
Router(config-if)#ppp pap sent-username sent-username password sent-password For
CHAP, two commands are used,
Router(config-if)#ppp chap hostname sent-usernam
Router(config-if)#ppp chap password sent-password
The usernames and passwords are case sensitive, so be careful when writing them. This
way, you will have to write the username and password of the remote router in your local
router and write the username and password of your local router into your remote using
the ‘username’ command. If you do not set the username and password that will be sent
from the local router to the remote router for authentication, the router will use its
hostname and secret password instead.
C. You can monitor the quality of the serial link that is using PPP with the following
command,
Where percentage is the minimum accepted link quality. If the link quality drops below the
percentage, the link will be shutdown and considered bad.
D. If the available bandwidth is small, you might consider compressing the data being
transmitted using the following command,
Where compression type is the compression type which can be predictor or stacker.
E. To troubleshoot PPP, you can use the following commands,
Frame relay is a type of telecommunications technology that can be used to connect local area
networks (LANs) and to transmit data between endpoints in wide area networks (WANs). Frame
relay uses packet switching technology. This means that it breaks data, such as call data, into
smaller packets, also known as frames, to transmit it through a shared frame relay network.
These data packets are then reassembled at the data’s destination. Frame relay has long been
used as part of many companies’ Integrated Services Digital Network (ISDN) systems. It’s often
considered to be the streamlined update to the older type of packet switching tech, X.25 packets.
Frame relay services are usually used either for transferring data between geographically
separated LANs or across a WAN. Frame relay is a cost-effective alternative to point-to-point
circuits, which are dedicated leased lines between LANs or in a WAN. Frame relay is cheaper
because rather than paying for the bandwidth of one or more leased lines, each router in the
network shares the single, multi-access network provided by the frame relay virtual circuit. The
amount of bandwidth that each company using the virtual circuit gets is determined by the
service provider’s committed information rate (CIR)–the guaranteed minimum amount of
bandwidth for each circuit.
Access to a frame relay network is given via a frame relay access device (FRAD) on a
company’s premises, which could be software in the router or a separate device. The FRAD
connects to one of the service provider’s frame relay switch ports via the User-to-Network
Interface (UNI) and creates an access link.
When would you need this: When you are setting up a Frame-relay WAN connection rented
from a service provider.
Router(config-if)#encapsulation Frame-relay
where interface number is the number of the serial interface connected to the frame-relay
equipment.
where lmi-type is the type of LMI standard used. The supported types are Cisco, ansi and q933a.
This information should be given to you by the Frame-relay service provider.
where the ip address1 and subnetmask1 are the IP address and subnetmask assigned to the
Frame-relay interface on the first side of the link.
where
ip-address2 is the IP address of the other side of the link. dlci-number is the virtual circuit
number given to you by the Frame-relay service provider. encapsulation-type is the type of
encapsulation standard used. The value is usually either Cisco or ietf. This information should
also be given to you by the Frame-relay service provider.
On the other end, the serial interface encapsulation type is changed to Frame-
relay:
Router(config-if)#encapsulation Frame-relay
where interface number is the number of the serial interface connected to the Frame-relay
equipment.
where lmi-type is the type of LMI standard used. The supported types are Cisco, ansi and q933a.
This information should be given to you by the Frame-relay service provider. Usually, it is the
same type used in step 2.
where the ip address2 and subnetmask2 are the IP address and subnetmask assigned to the
Frame-relay interface on the second side of the link.
where
ip address1 is the IP address of the first side of the link. dlci-number is the virtual circuit number
given to you by the Frame-relay service provider. encapsulation-type is the type of encapsulation
standard used. The value is usually either Cisco or ietf. This information should also be given to
you by the Frame-relay service provider.
Cisco routers employ a technique called split-horizon. This technique is used to eliminate routing
loops by which a routing update cannot be forwarded to the same interface it came from.
Building on that logic, split-horizon can cause issues when using Frame-relay point-to-multipoint
topologies. Now think of a scenario where a routing update is coming from one of the remote
points connected on the other end of a point-to-multipoint link. The routing update, due to split-
horizon, will not be forwarded on the same physical link over to the other points connected to the
point-to-multipoint topology, because it will be considered coming from one interface and
cannot be forwarded over to the same interface. This way, the other points will not be able to
exchange routing updates.
Split-horizon can be disabled using the following command on the interface level:
Router(config-if)#no ip split-horizon
Router on a Stick’ allows routing between VLANs with only one interface. Each VLAN
represents a different Subnet. In general, routers can take traffic from only one subnet and
transfer it to another subnet. And we can assign only one IP Address to a router interface.
‘Router on a stick’ allow us to create sub-interfaces, and assign IP Addresses to those sub-
interfaces. To make it work, we have to create a truck connection between the switch and a
router so that traffic from multiple VLANs can be sent to the router. If we create a route between
VLANs without the ‘Router on a Stick’ method, then we have to waste interfaces on the switches
and routers. And if we enable routing between multiple VLANs then it will become practically
inefficient as the switches and the routers will use those multiple interfaces. The image below is
an alternative method for allowing routing between VLANs. As you can see, we are using two
interfaces on both the router and a switch to allow routing between VLANs. We have not created
sub-interface in the below figure.
Configuration of Router on a stick
Switches divide broadcast domain through VLAN (Virtual LAN). VLAN is a partitioned
broadcast domain from a single broadcast domain. Switch doesn’t forward packets across
different VLANs by itself. If we want to make these virtual LANs communicate with each other,
a concept of Inter VLAN Routing is used.
Inter VLAN routing is a process in which we make different virtual LANs communicate with
each other irrespective of where the VLANs are present (on same switch or different switch).
Inter VLAN Routing can be achieved through a layer-3 device i.e. Router or layer-3 Switch.
When the Inter VLAN Routing is done through Router it is known as Router on a stick.
Router on a Stick:
The Router’s interface is divided into sub-interfaces, which acts as a default gateway to their
respective VLANs.
Configuration:
Configuration
Here is a topology in which there is a router and a switch and some end hosts. 2 different VLANs
have been created on the switch. The router’s interface is divided into 2 sub-interfaces (as there
are 2 different VLANs) which will acts as a default gateway to their respective VLANs. Then
router will perform Inter VLAN Routing and the VLANs will communicate with each other.
First we will assign IP address to the host PC1 as 192.168.1.10/24, Server 192.168.1.20/24, and
the other host PC2 will have IP address 192.168.2.10/24 manually.
Now, we will make sub-interface of fa0/0 as fa0/0.1 and fa0/0.2 and assign IP addresses as
192.168.1.1/24 and 192.168.2.1/24 respectively on the router’s ports.
NOTE : Here encapsulation type dot1q is used for frame tagging between the 2 different VLAN.
When the switch forwards packet of one VLAN to another, it inserts a VLAN into the Ethernet
header.
Now, we will make 2 different VLANs on switch namely VLAN 2 and VLAN 3 giving names
HR_dept and sales_dept.
Switch# vlan 2
Switch# vlan 3
Here, we have assigned VLAN 2 to the specific switch ports fa0/1, fa0/2 and vlan 3 to fa0/3
respectively.
NOTE: int range fa0/1-2 command is used as there are more than one host present in a single
VLAN.
Now to check reachability of PC2 from PC1, we will try to PING PC2 from PC1.