Wednesday 4 May 2011

OSPF Neighbor States

Introduction
When OSPF adjacency is formed, a router goes through several state changes before it becomes fully adjacent with its neighbor. Those states are defined in the OSPF RFC 2328, section 10.1. The states are Down, Attempt, Init, 2-Way, Exstart, Exchange, Loading, and Full. This document describes each state in detail.

Down
This is the first OSPF neighbor state. It means that no information (hellos) has been received from this neighbor, but hello packets can still be sent to the neighbor in this state.
During the fully adjacent neighbor state, if a router doesn't receive hello packet from a neighbor within the RouterDeadInterval time (RouterDeadInterval = 4*HelloInterval by default) or if the manually configured neighbor is being removed from the configuration, then the neighbor state changes from Full to Down.
Attempt
This state is only valid for manually configured neighbors in an NBMA environment. In Attempt state, the router sends unicast hello packets every poll interval to the neighbor, from which hellos have not been received within the dead interval.
Init
This state specifies that the router has received a hello packet from its neighbor, but the receiving router's ID was not included in the hello packet. When a router receives a hello packet from a neighbor, it should list the sender's router ID in its hello packet as an acknowledgment that it received a valid hello packet.
2-Way
This state designates that bi-directional communication has been established between two routers. Bi-directional means that each router has seen the other's hello packet. This state is attained when the router receiving the hello packet sees its own Router ID within the received hello packet's neighbor field. At this state, a router decides whether to become adjacent with this neighbor. On broadcast media and non-broadcast multiaccess networks, a router becomes full only with the designated router (DR) and the backup designated router (BDR); it stays in the 2-way state with all other neighbors. On Point-to-point and Point-to-multipoint networks, a router becomes full with all connected routers.
At the end of this stage, the DR and BDR for broadcast and non-broadcast multiacess networks are elected. For more information on the DR election process, refer to DR Election.
Note: Receiving a Database Descriptor (DBD) packet from a neighbor in the init state will also a cause a transition to 2-way state.
Exstart
Once the DR and BDR are elected, the actual process of exchanging link state information can start between the routers and their DR and BDR.
In this state, the routers and their DR and BDR establish a master-slave relationship and choose the initial sequence number for adjacency formation. The router with the higher router ID becomes the master and starts the exchange, and as such, is the only router that can increment the sequence number. Note that one would logically conclude that the DR/BDR with the highest router ID will become the master during this process of master-slave relation. Remember that the DR/BDR election might be purely by virtue of a higher priority configured on the router instead of highest router ID. Thus, it is possible that a DR plays the role of slave. And also note that master/slave election is on a per-neighbor basis.
Exchange
In the exchange state, OSPF routers exchange database descriptor (DBD) packets. Database descriptors contain link-state advertisement (LSA) headers only and describe the contents of the entire link-state database. Each DBD packet has a sequence number which can be incremented only by master which is explicitly acknowledged by slave. Routers also send link-state request packets and link-state update packets (which contain the entire LSA) in this state. The contents of the DBD received are compared to the information contained in the routers link-state database to check if new or more current link-state information is available with the neighbor.
Loading
In this state, the actual exchange of link state information occurs. Based on the information provided by the DBDs, routers send link-state request packets. The neighbor then provides the requested link-state information in link-state update packets. During the adjacency, if a router receives an outdated or missing LSA, it requests that LSA by sending a link-state request packet. All link-state update packets are acknowledged.
Full
In this state, routers are fully adjacent with each other. All the router and network LSAs are exchanged and the routers' databases are fully synchronized.
Full is the normal state for an OSPF router. If a router is stuck in another state, it's an indication that there are problems in forming adjacencies. The only exception to this is the 2-way state, which is normal in a broadcast network. Routers achieve the full state with their DR and BDR only. Neighbors always see each other as 2-way.

Including and Excluding Character strings in startup configurations

In Cisco IOS software release 12.0 and later, a nice trick is to use the + , - and / characters with sh run and sh start commands to search for specific strings (or exclude strings) in a configuration. This is similar to “ include | exclude” pipe-sentence, but is available in startup or running configuration.
For example:
To use include to search for “voice” in the running configuration, type:
Router# sh run | include voice
Voice-card 2
Voice class permanent 1
No voice hpi capture buffer
Voice-port 2/0/0
Dial-peer voice 123456 voip
Router#
As with include, to exclude strings from output, pipe sh run with exclude and the string you want to filter
For example:
Router# sh run | exclude voice
------display configuration except any sentence with word / string voice.
With the sh run or sh start commands, if your terminal is set to display one page at a time, when the display stops scrolling at the bottom of the screen use the “+” , “-“ or “/” characters to search configuration lines.
For example, type +voice to get the same output as sh run | include voice
Type a hypen (-) to skip (exclude) lines that contain the string you want to filter out. You can add several strings to include or exclude, grouping them with the pipe (|) character. Do not allow spaces between the pipes.
For example, type “–voice|description|line” which excludes sentence with word / string voice or description or line.
The forward slash (/) character lets you find the first occurrence of the given string. It stops at the first occurrence of the string to search for the next line that contains the string, so to continue searching type “/” and the string you want to find again.

Configure Frame relay switch (DCE side) FRSW and on Customer end (DTE Side) R1 and R2

Steps to configure:
· Configure R1's interface Serial0/0 with the IP address 12.0.0.1/16
· Configure R2's interface Serial0/0 with the IP address 12.0.0.2/16
· Configure Frame Relay Switching on FRSW
· Configure the Frame Relay circuit between R1 and R2 using static layer 3 to layer 2 resolution
· Configure LMI type ANSI b/w R1 and FRSW
· Configure LMI type Cisco b/w FRSW and R2

Configuration:

FRSW
frame-relay switching
!
interface Serial1
no ip address
encapsulation frame-relay
keepalive 15
frame-relay lmi-type ansi
frame-relay intf-type dce
frame-relay route 102 interface Serial2 201
clockrate 2000000
!
interface Serial2
encapsulation frame-relay
keepalive 15
frame-relay intf-type dce
frame-relay route 201 interface Serial1 102
clockrate 64000
!
R1
interface serial 0/0
ip address 12.0.0.1 255.255.0.0
encapsulation frame-relay
frame-relay lmi-type ansi
frame-relay map ip 12.0.0.2 102 broadcast

R2
interface serial 0/0
ip address 12.0.0.1 255.255.0.0
encapsulation frame-relay
frame-relay map ip 12.0.0.1 201 broadcast

Verification:
R1
R1>ping 12.0.0.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 12.0.0.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5) 



Optimizing Port configuration

Using switchport host command on Cisco 2900, 3550, 3560 series switches is a useful way to optimize switch port for host connection. When each switch port has a single host connected to it, you can use this command instead of manually setting the correct feature for every port.
This command sets channel mode to off, enables spanning tree portfast, sets the trunk mode off and disables the 802.1q tunnel features.
Note that this command should not be enabled on ports where hubs, switches or bridges are connected because it can cause temporary switching/ bridging loops.

Switch(config)# interface fastethernet 0/1
Switch(config-if)# switchport host

Using "do" command in cisco Routers and Switches

Using privilege mode commands in global configuration mode:

Here’s a handy tip when using the show, ping, telnet or any other privilege mode commands. Instead of switching back and forth between global configuration mode and privilege mode to use these commands, you can remain in global configuration mode and type the do with original syntax.

For example:

Router(config)# do show running-config

Pinging multiple IP addresses with the tcl script

You can use the tcl script to ping multiple IP addresses from the router. The following is an example of pinging IP address 192.168.26.1, 192.168.25.1 and 192.168.17.2
Router# tclsh
Router(tcl)# foreach addr {
Router(tcl)# 192.168.26.1
Router(tcl)# 192.168.25.1
Router(tcl)# 192.168.17.2
Router(tcl)# } {ing $addr re 10 si 1500
Router(tcl)# }

After completion of task use “exit” command to come out of the tcl mode.

Cisco SD-WAN: Onboarding Controllers step by step (on-prem)

 This configuration example only covers the process of installing the SD-WAN controller software images on a VMWare ESXI instance, establish...