Static vs. dynamic routing
To configure routing at all, it must be ON in the Cisco IOS. This is always the default and rarely does anyone change it. Of course, the router command that is used to configure routing isn't going to work unless it's turned on, on the router. So, just in case it's been turned off for some reason, you should know how to turn it on in the Cisco IOS. Enter the following in global configuration mode:
Router(config)# ip routing
To turn routing off, you would do:
Router(config)# no ip routingThe Cisco IOS global configuration mode router command is used to configure dynamic routing. I say dynamic because the router command is used to configure only the dynamic routing protocol. If you are configuring static routes, you would use the ip route command, and not the router command.
What is the Cisco IOS router command?The router command to configure dynamic routing can be used in global configuration mode only. The dynamic routing protocols available will vary based on the model of Cisco router or switch that you are using. Routing protocols offered by the Router command
You can find out what dynamic routing protocols are offered by your IOS with the model and version you are using. Here is how you do it:
Router# configure terminal
Enter configuration commands, one per line.
Router(config)# router ?
bgp Border Gateway Protocol (BGP)
eigrp Enhanced Interior Gateway Routing Protocol (EIGRP)
isis ISO IS-IS
iso-igrp IGRP for OSI networks
mobile Mobile routes
odr On Demand stub Routes
ospf Open Shortest Path First (OSPF)
rip Routing Information Protocol (RIP)
Router (config)# router
So what are all these routing protocols? Let's look at them one by one.
- BGP (Border Gateway Protocol): The routing protocol of the Internet; for more information on BGP, see my TechRepublic article,"Five things you should know about Cisco IOS BGP Configuration>"
- EIGRP (Enhanced Interior Gateway Routing Protocol): An excellent Cisco-proprietary routing protocol for your LAN and WAN, no matter the size, and comparable to OSPF. For more information on EIGRP, see my TechRepublic article,"Cisco Administration 101: What you need to know about EIGRP."
- ISIS: The ISO IS-IS is the intermediate-system to intermediate-system routing protocol, a decent link-state routing protocol, comparable to OSPF. For more information on configuring IS-IS in the Cisco IOS, see Cisco's IS-IS Support site.
- ISO- IGRP: A Cisco proprietary routing protocol for CLNS, based on Cisco's IGRP. As CLNS is rarely used anymore, neither is ISO-IGRP.
- Mobile: Cisco's IP Mobile routing is a very cool routing option for network admins who have mobile devices. Imagine being able to move your laptop or PDA around the network from subnet to subnet, keeping the same IP address no matter where you go.
- ODR: Cisco's On Demand Stub Routing (ODR) is a proprietary Cisco method of routing stub networks (that all come back to a central point) with the most minimal routing protocol overhead possible. ODR actually uses CDP.
- OSPF (Open Shortest Path First) is an open-standard routing protocol and probably the most popular routing protocol in use on LANs and WANs today. For more information on BGP, see my TechRepublic article, "Cisco Administration 101: What you need to know about OSPF."
- RIP (Routing Information Protocol) is an open-standard routing protocol for smaller networks. For more information on RIP, see my TechRepublic article, "Cisco Administration 101: Know the basics about RIPv2."
Router(config)# router ospf 100
Router(config-router)# (OSPF routing configuration commands)
In this example, 100 is the process ID number.
To remove OSPF from running on a router, you would do:
Router(config)# no router ospf 100
ConclusionThe router global configuration command is a critical command to use when configuring any dynamic routing protocol on a Cisco router. While you may have configured one of the routing protocols before in the Cisco IOS, it is always interesting to see the various routing options available under the router command. In this article, you learned what dynamic routing options are available and what each of those options are.
For more information on routing protocols and how they are weighed differently in the Cisco IOS, see my article, "Understand the significance of administrative distance and metrics when working with routers."
Want to learn more about router and switch management? Automatically sign up for our free Cisco Routers and Switches newsletter, delivered each Friday!