Thursday, October 22, 2009

CCNA2 Cisco command

Router#erase startup-config
Router#debug ip routing
Router#debug ip rip
Router#undebug all

Router(config)# hostname R1
Router(config)# enable secret 1234password
Router(config)# banner motd &

!! Authorised ACCESS ONLY!

R1(config)#line console 0
R1(config-line)#password 123
R1(config-line)#logging synchronous
R1(config-line)#exec-timeout 0 0

R1(config)#line vty 4 0
R1(config-line)#password 123
R1(config-line)#logging synchronous
R1(config-line)#exec-timeout 0 0

//Disable domain lookup
R1(config)#no ip domain-lookup

//Clock rate set at DCE
Router(config)#interface serial 1/1
Router(config-if)#ip address
Router(config-if)#no ip address
Router(config-if)# clock rate 64000
Router(config-if)#no shutdown

//Static route need to set for both router
Router(config)#ip route

//Default route
Router(config)# ip route Next_Hop_Add
Router(config)# ip route serial 1/1
Router#show interface serial 1/1

Router(config)#router rip

//prevent the updates send to FE 0/0,save bandwidth
Router(config-router)#passive-interface fastethernet 0/0

//configure the router to include the static route with it RIP updates
Router(config-router)#default-information originate
Router #show ip protocols

Router#show running-config
Router#copy running-config startup-config
Router#show startup-config

Router# show interface
Router#show ip protocols
Router#show ip route
Router#show ip interfaces brief

Router(config)#cdp run
Router(config)#int ethernet 0/1
Router(config-if)#cdp enable
Router(config-if)#no cdp enable
Router(config)#no cdp run

R1(config)#router ospf 1

Router(config-router)#network network-address wildcard-mask area area-id
Router(config-router)#network area 0

Router(config-router)#router-id ip-address
Router#clear ip ospf process // modify router id detection OR reload the router

Router(config)#interfaceloopback number
Router(config-if)#ip address ip-address subnet-mask

Router(config)#interface loopback 0
Router(config-if)#ip address


Router(config-if)#bandwidth bandwidth-kbps
Router(config-if)#bandwidth 56


Router(config-if)#ip ospf cost 1562 //bypass the calcultion but input the direct value


Router(config-if)#ip ospf priority {0 - 255} //to set the DR or BDR

Router(config-if)#ip ospf hello-interval seconds
Router(config-if)#ip ospf dead-interval seconds

R1(config)#ip route loopback 1 //default route

R1(config-router)#auto-cost reference-bandwidth ? //1-4294967 The reference bandwidth in terms of Mbits per second

R1(config-router)#auto-cost reference-bandwidth 10000

R1#show ip protocols
R1#show ip ospf neighbor
R1#show ip ospf
R1#show ip ospf interface serial /0/0/0

Wednesday, October 21, 2009

Tuesday, October 20, 2009

CCNA2 Chapter 10-11 note

Chap 10 Link state protocol

The IP link-state routing protocols are shown in the figure:
Open Shortest Path First (OSPF)
Intermediate System-to-Intermediate System (IS-IS)

Basic OSPF operations can be configured with a router ospfprocess-id command and a network statement.

Each router floods the LSP to all neighbors, who then store all LSPs received in a database

Each router learns about its own links, its own directly connected networks

the interface must be properly configured with an IP address and subnet mask and the link must be in the up state

An LSP only needs to be sent:
During initial startup of the router or of the routing protocol process on that router
Whenever there is a change in the topology, including a link going down or coming up, or a neighbor adjacency being established or broken

Note: The actual SPF algorithm determines the shortest path as it is building the SPF tree.

Note: OSPF routers do flood the own link-states every 30 minutes. This is known as a paranoid update and is discussed in the following chapter. Also, not all distance vector routing protocols send periodic updates. RIP and IGRP send periodic updates; however, EIGRP does not.

when there is a change in the topology, only those routers in the affected area receive the LSP and run the SPF algorithm.

Link-state routing protocols typically require more memory, more CPU processing, and at times more bandwidth than distance vector routing protocols.
1. Each router learns about its own directly connected networks.

2. Each router is responsible for "saying hello" to its neighbors on directly connected networks.

3. Each router builds a Link-State Packet (LSP) containing the state of each directly connected link.

4. Each router floods the LSP to all neighbors, who then store all LSPs received in a database.

5. Each router uses the database to construct a complete map of the topology and computes the best path to each destination network.

Each router determines its own link-states and floods the information to all other routers in the area. As a result, each router builds a link-state database (LSDB) containing the link-state information from all other routers. Each router will have identical LSDBs. Using the information in the LSDB, each router will run the SPF algorithm. The SPF algorithm will create an SPF tree, with the router at the root of the tree. As each link is connected to other links, the SPF tree is created. Once the SPF tree is completed, the router can determine on its own the best path to each network in the tree.

link-state routing protocol will faster convergence (EIGRP is an expeption)


Chapter 11 OSPF

By default, OSPF Hello packets are sent every 10 seconds on multiaccess and point-to-point segments and every 30 seconds on non-broadcast multiaccess (NBMA) segments (Frame Relay, X.25, ATM).

In most cases, OSPF Hello packets are sent as multicast to an address reserved for ALLSPFRouters at

The Dead interval is the period, expressed in seconds, that the router will wait to receive a Hello packet before declaring the neighbor "down." Cisco uses a default of four times the Hello interval. For multiaccess and point-to-point segments, this period is 40 seconds. For NBMA networks, the Dead interval is 120 seconds

To reduce the amount of OSPF traffic on multiaccess networks, OSPF elects a Designated Router (DR) and Backup Designated Router (BDR).

An LSU contains one or more LSAs and either term can be used to refer to link-state information propagated by OSPF routers.

OSPF is enabled with the router ospf process-id global configuration command. The process-id is a number between 1 and 65535 and is chosen by the network administrator. The process-id is locally significant, which means that it does not have to match other OSPF routers in order to establish adjacencies with those neighbors. This differs from EIGRP. The EIGRP process ID or autonomous system n-mber does need to match for two EIGRP neighbors to become adjacent.

R1(config)#router ospf 1

Router(config-router)#network network-address wildcard-mask area area-id

#network area 0

Unlike EIGRP, however, OSPF requires the wildcard mask

Although any area-id can be used, it is good practice to use an area-id of 0 with single-area OSPF.

The OSPF router ID is used to uniquely identify each router in the OSPF routing domain. A router ID is simply an IP address. Cisco routers derive the router ID based on three criteria and with the following precedence:

1. Use the IP address configured with the OSPF router-id command.

2. If the router-id is not configured, the router chooses highest IP address of any of its loopback interfaces.

3. If no loopback interfaces are configured, the router chooses highest active IP address of any of its physical interfaces.

R3:, which is higher than either or

One command you can use to verify the current router ID is show ip protocols.

Router(config)#interfaceloopback number
Router(config-if)#ip addressip-address subnet-mask

Router(config)#interface loopback 0
Router(config-if)#ip add

The advantage of using a loopback interface is that - unlike physical interfaces - it cannot fail. There are no actual cables or adjacent devices on which the loopback interface depends for being in the up state.

Router(config)#router ospfprocess-id

Modifying the Router ID

The router ID is selected when OSPF is configured with its first OSPF network command. If the OSPF router-id command or the loopback address is configured after the OSPF network command, the router ID will be derived from the interface with the highest active IP address.

The router ID can be modified with the IP address from a subsequent OSPF router-id command by reloading the router or by using the following command:

Router#clear ip ospf process

R1#show ip ospf neighbor
command can be used to verify that the router has formed an adjacency with its neighboring routers

Two routers may not form an OSPF adjacency if:
The subnet masks do not match, causing the routers to be on separate networks.
OSPF Hello or Dead Timers do not match.
OSPF Network Types do not match.
There is a missing or incorrect OSPF network command.

The SPF algorithm is CPU-intensive and the time it takes for calculation depends on the size of the area. The size of an area is measured by the number of routers and the size of the link-state database.

A network that cycles between an up state and a down state is referred to as a flapping link. A flapping link can cause OSPF routers in an area to constantly recalculate the SPF algorithm, preventing proper convergence. To minimize this problem, the router waits 5 seconds (5000 msecs) after receiving an LSU before running the SPF algorithm. This is known as the SPF schedule delay. In order to prevent a router from constantly running the SPF algorithm, there is an additional Hold Time of 10 seconds (10000 msecs). The router waits 10 seconds after running the SPF algorithm before rerunning the algorithm again.

#show ip protocols
#show ip ospf
#show ip ospf interface serial /0/0/0

OSPF may have different Hello and Dead intervals on various interfaces, but for OSPF routers to become neighbors, their OSPF Hello and Dead intervals must be identical. For example, in the figure, R1 is using a Hello interval of 10 and a Dead interval of 40 on the Serial 0/0/0 interface. R2 must also use the same intervals on its Serial 0/0/0 interface or the two routers will not form an adjacency.

Unlike RIPv2 and EIGRP, OSPF does not automatically summarize at major network boundaries.

Loopback interfaces counts as a directed connected network as it is not advertise in OSPF

OSPF metric
The reference bandwidth defaults to 10 to the 8th power, 100,000,000 bps or 100 Mbps. This results in interfaces with a bandwidth of 100 Mbps and higher having the same OSPF cost of 1. The reference bandwidth can be modified to accommodate networks with links faster than 100,000,000 bps (100 Mbps) using the OSPF command auto-cost reference-bandwidth

The cost of an OSPF route is the accumulated value from one router to the destination network.

Cisco routers, the bandwidth value on many serial interfaces defaults to T1 (1.544 Mbps). However, some serial interfaces may default to 128 kbps.

Never assume that OSPF is using any particular bandwidth value. Always check the default value with the show interface command.

show interface command to view the bandwidth value used for an interface

Router(config-if)#bandwidth bandwidth-kbps

The figure shows the bandwidth commands used to modify the costs of all the serial interfaces in the topology.


R1(config-if)#ip ospf cost 1562

The main difference between the two commands is that the bandwidth command uses the result of the cost calculation to determine the cost of the link. The ip ospf cost command bypasses this calculation by directly setting the cost of the link to a specific value.

Multiaccess networks can create two challenges for OSPF regarding the flooding of LSAs:

1. Creation of multiple adjacencies, one adjacency for every pair of routers.

2. Extensive flooding of LSAs (Link-State Advertisements).

The solution to managing the number of adjacencies and the flooding of LSAs on a multiaccess network is the Designated Router (DR).

DROthers only send their LSAs to the DR and BDR using the multicast address (ALLDRouters - All DR routers).

The end result is that there is only one router doing all of the flooding of all LSAs in the multiaccess network.

How do the DR and BDR get elected? The following criteria are applied:

1. DR: Router with the highest OSPF interface priority.

2. BDR: Router with the second highest OSPF interface priority.

3. If OSPF interface priorities are equal, the highest router ID is used to break the tie.

When two DROther routers form a neighbor adjacency, the neighbor state is displayed as 2WAY.

The DR and BDR election process takes place as soon as the first router with an OSPF enabled interface is active on the multiaccess network. This can happen when the routers are powered-on or when the OSPF network command for that interface is configured.

If a new router enters the network after the DR and BDR have been elected, it will not become the DR or the BDR even if it has a higher OSPF interface priority or router ID than the current DR or BDR. The current DR and BDR must both fail before the new router can be elected DR or BDR.

A previous DR does not regain DR status if it returns to the network.

So, how do you make sure that the routers you want to be DR and BDR win the election? Without further configurations, the solution is to either:
Boot up the DR first, followed by the BDR, and then boot all other routers, or
Shut down the interface on all routers, followed by a no shutdown on the DR, then the BDR, and then all other routers.

Instead of relying on the router ID to decide which routers are elected the DR and BDR, it is better to control the election of these routers with the ip ospf priority interface command.

Router(config-if)#ip ospf priority {0 - 255}

But if you change the default value from 1 to a higher value, the router with the highest priority will become the DR and the router with the next highest priority will become the BDR. A value of 0 makes the router ineligible to become a DR or BDR.

After doing a shutdown and a no shutdown on the FastEthernet 0/0 interfaces of all three routers, we see the result of the change of OSPF interface priorities.

in OSPF terminology, the router located between an OSPF routing domain and a non-OSPF network is called the Autonomous System Boundary Router (ASBR).

Static Default Configuration

R1(config)#ip route loopback 1

Like RIP, OSPF requires the use of the default-information originate command to advertise the static

Therefore, 100,000,000 is the default bandwidth referenced when the actual bandwidth is converted into a cost metric.

The reference bandwidth can be modified to accommodate these faster links by using the OSPF command auto-cost reference-bandwidth.

R1(config-router)#auto-cost reference-bandwidth ?
1-4294967 The reference bandwidth in terms of Mbits per second

R1(config-router)#auto-cost reference-bandwidth 10000

Router(config-if)#ip ospf hello-interval  seconds
Router(config-if)#ip ospf dead-interval seconds

Monday, October 19, 2009

CCNA2 Chapter 7-9 note

Chapter 7 RIP2
Some of these enhanced features include:
Next-hop addresses included in the routing updates
Use of multicast addresses in sending updates
Authentication option available

R2(config-router)#redistribute static
we want the RIP process on R2 to redistribute our static route ( by importing the route into RIP and then sending it to R1 and R3 using the RIP process.

R2(config)#ip route Null0

The address space represented by the static summary route does not actually exist. In order to simulate this static route, we use a null interface as the exit interface.

RIPv1 cannot support discontiguous networks, VLSM, or Classless Inter-Domain Routing (CIDR) supernets.
The autosumarization sometime will be the big problem for the routing table

RIPv1 either summarizes the subnets to the classful boundary or uses the subnet mask of the outgoing interface to determine which subnets to advertise.

all subnets must use the same subnet mask when a classful routing protocol is implemented in the network. If the subnets mask not the same, the route wont send or updates to other router.

R1(config)#router rip
R1(config-router)#version 2
R1(config-router)#version 1

By default, RIPv2 automatically summarizes networks at major network boundaries, just like RIPv1.

R1(config-router)#no auto-summary

This command important! Automatic summarization must be disabled to support discontiguous networks. After this, the route will send updates with individual subnet mask.

debug ip rip

A supernet is a block of contiguous classful networks that is addressed as a single network.

Supernets have masks that are smaller than the classful mask (/16 here, instead of the classful /24).

What is the default behaviour of RIP if no version type specified?
-send version 1 updates only, receive version 1 and updates

tip: remember if RIP1, and it using VLSM, the 1st thing is to "version 2"

The maximum network parameter permitted by default of RIPv2 is 15

A discontiguous network will have two or more subnetworks of a classful network connected together by different classful networks. It occurs when a classful major network address , such as, is seperated by one or more other major networks, like


Chapter 8 Routing Table

Level 1 route is a route with a subnet mask equal to or less than the classful mask of the network address.

A level 1 route can function as a:
Default route - A default route is a static route with the address
Supernet route - A supernet route is a network address with a mask less than the classful mask.
Network route - A network route is a route that has a subnet mask equal to that of the classful mask.

An ultimate route is a route that includes:
either a next-hop IP address (another path)
and/or an exit interface

A level 1 parent route is a network route that does not contain a next-hop IP address or exit interface for any network.

A parent route is actually a heading that indicates the presence of level 2 routes, also known as child routes.

A level 2 route is a route that is a subnet of a classful network address.

level 1 parent route exists only when there is at least one level 2 child route.

Regardless of the addressing scheme used by the network (classless or classful), the routing table will use a classful scheme.

Step in the route lookup process:
After child route search, it will be :

Classful routing behavior: If classful routing behavior is in effect, terminate the lookup process and drop the packet.

ultimate--> parent-->child--> drop

Classless routing behavior: If classless routing behavior is in effect, continue searching level 1 supernet routes in the routing table for a match, including the default route, if there is one.

ultimate--> parent-->child-->level 1 supernet-->default route--> drop

Remember that the route lookup process will need to do a recursive lookup on any route that references only a next-hop IP address and not an exit interface.

Using VSLM does not change the lookup process.

Routing behaviors
no ip classless
ip classless
ip classless

this 2 commands determine the address lookup behavior of the routing process

In IOS versions 11.3 and later, the command ip classless is the default, implementing a classless route lookup process.

A common error is to assume that a default route will always be used if the router does not have a better route. But for Classful routing behaviors, R2's default route is not examined nor used, although it is a match. This is often a very surprising result when a network administrator does not understand the difference between classful and classless routing behavior.


Chapter 9 EIGRP
The main purpose in Cisco's development of EIGRP was to create a classless version of IGRP.

EIGRP has a default administrative distance of 90 for internal routes and 170 for routes imported from an external source, such as default routes.

These features include:
Reliable Transport Protocol (RTP)
Bounded Updates
Diffusing Update Algorithm (DUAL)
Establishing Adjacencies
Neighbor and Topology Tables

RTP and the tracking of neighbor adjacencies set the stage for the EIGRP workhorse, the Diffusing Update Algorithm (DUAL).

As the computational engine that drives EIGRP, DUAL resides at the center of the routing protocol, guaranteeing loop-free paths and backup paths throughout the routing domain.

Instead of hop count, both IGRP and EIGRP use metrics composed of bandwidth, delay, reliability, and load. By default, both routing protocols use only bandwidth and delay.

Loop-free means that the neighbor does not have a route to the destination network that passes through this router.

EIGRP does not use holddown timers. Instead, loop-free paths are achieved through a system of route calculations (diffusing computations) that are performed in a coordinated fashion among the routers.

EIGRP packet header opcode:
Update (1)
Query (3)
Reply (4)
Hello (5)

In the IP packet header, the protocol field is set to 88 to indicate EIGRP, and the destination address is set to the multicast If the EIGRP packet is encapsulated in an Ethernet frame, the destination MAC address is also a multicast address: 01-00-5E-00-00-0A.

In TLV field, By default, only bandwidth and delay are weighted. Both are equally weighted, therefore, the K1 field for bandwidth and the K3 field for delay are both set to 1. The other K values are set to zero.

The Hold Time is the amount of time the EIGRP neighbor receiving this message should wait before considering the advertising router to be down

If the hold time expires, EIGRP will declare the route as down and DUAL will search for a new path by sending out queries.

The IP External message is used when external routes are imported into the EIGRP routing process.

The Destination field stores the address of the destination network. Although only 24 bits are shown in this figure, this field varies based on the value of the network portion of the 32-bit network address. For example, the network portion of is 10.1. Therefore, the Destination field stores the first 16 bits. Because the minimum length of this field is 24 bits, the remainder of the field is padded with zeros. If a network address is longer than 24 bits (, for example), then the Destination field is extended for another 32 bits (for a total of 56 bits) and the unused bits are padded with zeros.

Protocol dependent modules are responsible for the specific routing tasks for each Network layer protocol.

Reliable RTP requires an acknowledgement to be returned by the receiver to the sender. An unreliable RTP packet does not require an acknowledgement.

Hello packets
normal network - sent every 5 seconds.
nonbroadcast multiaccess network(NBMA) eg X25,Frame relay,ATM T1 - sent 60 second

hold time
normal - 15 second
NBMA - 180 seconds
An autonomous system (AS) is a collection of networks under the administrative control of a single entity that presents a common routing policy to the Internet. In the figure, companies A, B, C, and D are all under the administrative control of ISP1. ISP1 "presents a common routing policy" for all of these companies when advertising routes to ISP2.

The ISP is responsible for the routing of packets within its autonomous system and between other autonomous systems.

Although EIGRP refers to the parameter as an "autonomous-system" number, it actually functions as a process ID. This number is not associated with an autonomous system number discussed previously and can be assigned any 16-bit value.

Router1(config)#router eigrp 1
Router2(config)#router eigrp 1
Router3(config)#router eigrp 1

In order to establish neighbor adjacencies, EIGRP requires all routers in the same routing domain to be configured with the same process ID.

The autonomous system parameter is a number chosen by the network administrator between 1 and 65535

To configure EIGRP to advertise specific subnets only, use the wildcard-mask option with the network command:

Router(config-router)#network network-address [wildcard-mask]

show ip eigrp neighbors

By default, EIGRP automatically summarizes routes at the major network boundary. We can disable the automatic summarization with the "no auto-summary" command, just as we did in RIPv2.

Note: EIGRP automatically includes a null0 summary route as a child route whenever both of following conditions exist:
There is at least one subnet that was learned via EIGRP.
Automatic summarization is enabled.

By default, K1 and K3 are set to 1, and K2, K4, and K5 are set to 0.

Router(config-router)#metric weights tos k1 k2 k3 k4 k5

tos is 0 for eigrp

default mteric = k1*bandwidth + k3*delay

Use the interface command bandwidth to modify the bandwidth metric:

Router(config-if)#bandwidth kilobits

That bandwidth is used for the (10,000,000/bandwidth) * 256 portion of the formula. Next, determine the delay value for each outgoing interface on the way to the destination. Sum the delay values and divide by 10 (sum of delay/10) and then multiply by 256 (* 256). Add the bandwidth and sum of delay values to obtain the EIGRP metric.

EIGRP uses the slowest bandwidth in its metric calculation
EIGRP uses the cumulative sum of delay metrics of all of the outgoing interfaces.

DUAL determines the best loop-free path and loop-free backup paths.

The feasibility condition (FC) is met when a neighbor's reported distance (RD) to a network is less than the local router's feasible distance to the same destination network. (refer to the screenshot)

R2#show ip eigrp topology
more specific
R2#show ip eigrp topology

A feasible successor (FS) is a neighbor who has a loop-free backup path to the same network as the successor by satisfying the feasibility condition.

The show ip eigrp topology all-links command shows all possible paths to a network including successors, feasible successors, and even those routes that are not feasible successors

This finite state machine contains all of the logic used to calculate and compare routes in an EIGRP network.

#debug eigrp fsm

When the successor is no longer available and there is no feasible successor, DUAL will put the route into active state. . DUAL will send EIGRP queries asking other routers for a path to this network.

The Null0 summary:
Regardless of whether classful or classless routing behavior is being used, the null0 summary will be used and therefore denying the use of any supernet or default route.

example :Even if a default route was configured, R1 would still discard the packet because it matches the Null0 summary route to

To establish EIGRP manual summarization on all interfaces that send EIGRP packets, use the following interface command:

Router(config-if)#ip summary-address eigrp  as-number network-address subnet-mask

Because R3 has two EIGRP neighbors, the EIGRP manual summarization in configured on both Serial 0/0/0 and Serial 0/0/1.

EIGRP requires the use of the redistribute static command to include this static default route with its EIGRP routing updates.

Note: There is another method to propagate a default route in EIGRP, using the ip default-network comman

Router(config-if)#ip bandwidth-percent eigrp as-number percent
used to configure the percentage of bandwidth that may be used by EIGRP on an interface.

In our example, if bandwidtth is 64kbps,we are limiting EIGRP to no more than 50 percent of the link's bandwidth. Therefore, EIGRP will never use more the 32kbps of the link's bandwidth for EIGRP packet traffic.

Router(config-if)#ip hello-interval eigrp as-number seconds

If you change the hello interval, make sure that you also change the hold time to a value equal to or greater than the hello interval

Router(config-if)#ip hold-time eigrp as-number seconds

What is the purpose of EIGRP neighbor and topology table ?
the neighbour and topology tables are used by DUAL to building table

topology table : tables that contains successor and feasible successor

routing table: contain succssors only

Friday, October 2, 2009