Feb 12, 2010

Enabling Static Routing on Cisco Devices

Easy Static Routing configuration on Cisco Router / Switches

Static routing occurs when you manually add routes in each router’s routing table. The advantages of static routing are mentioned below:

1) It puts no overhead on the router CPU (dynamic routing protocols eg OSPF, EIGRP, RIP are CPU intensive).
2) There is no bandwidth usage between routers for routing managenent traffic (as for “Routing Updates” in dynamic routing protocols).
3) It adds security because the administrator can choose to allow routing access to certain networks only and can define a specific path for specific traffic etc.

But Static routing also has the following disadvantages:
1) The administrator must really understand the internetwork and how each router is connected in order to configure routes correctly (more responsibility on administrator).
2) If a single network is added to the internetwork, the administrator has to add a route to it on all routers by hand (this can be a lengthy job if you have many routers in your network).
3) If one network or next-hop has gone down, you will have to manually edit the routing entries in all affected routers.

The command syntax to configuring a static route in cisco router’s routing table is:

Router#configure terminal
Router(config)#ip route [destination_network] [destination_mask]  
     [next-hop_address or exit interface]


An example of configuring a static route is mentioned below:

Router#configure terminal
Router(config)#ip route 10.0.0.0 255.0.0.0 15.0.0.2

Where 10.0.0.0 / 255.0.0.0 is destination network and 15.0.0.2 is the next-hop address of far-end router.


How OSPF Router ID is selected?

OSPF Router ID selection algorithm

Every OSPF process running in Cisco IOS requires a router-wide unique router ID. An IP address of an active interface is commonly used as the OSPF router ID; you can also use the router-id address router configuration command to ensure the OSPF router ID does not change even when the interface IP addresses change.
OSPF router ID should not be changed after the OSPF process has been started. OSPF router ID change resets all OSPF adjacencies, resulting in temporary router outage. The router also has to originate new copies of all its LSAs with the new router ID. Stale copies of the LSAs originated by the “old” OSPF process remain in the OSPF topology databases of all routers until they expire (their age increases beyond max-age).

Router ID selection algorithm

If the router-id is specified in the OSPF configuration, the specified IP address is used. If the IP address configured with the router-id command overlaps with the router ID of another already active OSPF process, the router-id command fails.
If OSPF router ID was not set with the router-id configuration command (router-id command was not used in the OSPF configuration or there was a router ID overlap with another OSPF process), OSPF uses an interface IP address as its router ID.
The following algorithm is used to select an interface IP address as the OSPF router ID:
  • IP addresses of all applicable loopback interfaces are collected. Addresses already used as OSPF router ID of other OSPF processes are removed. If any addresses are left, the highest IP address is used as the OSPF router ID.
Applicable interfaces are operational (line protocol is up) interfaces in the IP routing table as the OSPF process.
  • If the OSPF router ID has not been selected in the first step, IP addresses of all other applicable interfaces are collected. OSPF router IDs of active OSPF processes are removed from the list and the highest IP address is used.
  • If the router was still not able to select an OSPF router ID, an error message is logged and the OSPF process does not start.
An OSPF process that failed to select a router ID retries the selection process every time an IP address becomes available (an applicable interface changes its state to up or an IP address is configured on an applicable interface).

Changing the OSPF router ID

Once an OSPF router ID is selected, it is not changed even if the interface that was used to select it changes its operational state or its IP address. Earlier IOS releases changed the OSPF router ID when the underlying interface state changed, resulting in unnecessary network instabilities.
To change the OSPF router ID, you have to reset the OSPF process with the clear ip ospf process command (even when the new router ID was requested with the router-id router configuration command).

Feb 3, 2010

AN EXCELLENT CISCO IOS COMMAND


AN EXCELLENT IOS COMMAND


           I just found and amazing Cisco IOS command, that i should have learned years ago. This IOS command is very handy, specially when making lengthy configurations on a large number of routers.

 The said command works as a macro and can actually assigns a "keyword" (which can be a single alphabet) for a lengthy IOS command. This command is issued from global config mode and the syntax of this command is;

          Router(config)# alias (config mode) (your keyword) (complete command)


where,
 config mode:    It is the mode from which the actual command (or keyword) will be issued. This mode can be EXEC, CONFIG, INTERFACE mode etc.
 your keyword: It is your keyword that you want to use in-place of lengthy command.
 complete command: It is the complete command that the router will assume instead of the keyword.



Example 1, To assign keyword "SII" for command "Show Ip Interface" (which in entered in exec mode), you can use following command;



          Router(config)# alias exec SII Show Ip Interface

          Now, when keyword "SII" will be typed in exec-mode (# mode), it will be treated by router as complete command "Show Ip Interface" were entered. 


Example 2, To assign keyword "NS" for command "No Shut" for enabling an interface, we can use this as;

         Router(config)# alias interface NS No Shut


         After that, whenever keyword NS will be entered in any interface configuration mode, it will be treated as complete command "No Shutdown" were entered.


          As a general guideline, I am also showing some most commonly used aliases. You just copy them in the global config mode of your Router / Switch.

          Router(config)# alias configure sir show ip route
          Router(config)# alias configure siib show ip interface brief
          Router(config)# alias exec sir show ip route
          Router(config)# alias exec siib show ip interface brief
          Router(config)# alias exec s sh run
          Router(config)# alias exec c conf t
          Router(config)# alias exec map show frame map
          Router(config)# alias exec pvc show frame pvc
          Router(config)# alias interface ns no shutdown
          Router(config)# alias interface sa switchport mode access
          Router(config)# alias exec w write memory