Friday, September 13, 2013

Cisco IP Routing

Once you create an internetwork by connecting your WANs and LANs to a router, you’ll need to configure logical network addresses, such as IP addresses, to all hosts on the internetwork so that they can communicate across that internetwork.

The term routing is used for taking a packet from one device and sending it through the network to another device on a different network. Routers don’t really care about hosts, they only care about networks and the best path to each network. The logical network address of the destination host is used to get packets to a network through a routed network, and then the hardware address of the host is used to deliver the packet from a router to the correct destination host.

If your network has no routers, then it should be apparent that you are not routing. Routers route traffic to all the networks in your internetwork.
To be able to route packets, a router must know, at a minimum, the following:
  • Destination address
  • Neighbor routers from which it can learn about remote networks
  • Possible routes to all remote networks
  • The best route to each remote network
  • How to maintain and verify routing information



The router learns about remote networks from neighbor routers or from an administrator. The router then builds a routing table (a map of the internetwork) that describes how to find the remote networks. If a network is directly connected, then the router already knows how to get to it.

If a network isn’t directly connected to the router, the router must use one of two ways to learn how to get to the remote network: static routing, meaning that someone must hand-type all network locations into the routing table, or something called dynamic routing.

In dynamic routing , a protocol on one router communicates with the same protocol running on neighbor routers. The routers then update each other about all the networks they know about and place this information into the routing table. If a change occurs in the network, the dynamic routing protocols automatically inform all routers about the event. If static routing is used, the administrator is responsible for updating all changes by hand into all routers. Typically, in a large network, a combination of both dynamic and static routing is used.

Configuring IP Routing in Our Network

Our network is good to go—right? Bow does a router send packets to remote networks when the only way it can send them is by looking at the routing table to find out how to get to the remote networks? Our configured routers only have information about directly connected networks in each routing table. And what
happens when a router receives a packet for a network that isn’t listed in the routing table? It doesn’t send a broadcast looking for the remote network—the router just discards it. Period.

So we’re not exactly ready to rock after all. But no worries—there are several ways to configure the routing tables to include all the networks in our little internetwork so that packets will be forwarded. And what’s best for one network isn’t necessarily what’s best for another.

Understanding the different types of routing will really help you come up with the best solution for your specific environment and business requirements.

I’m going to start off by describing and implementing static routing on our network because if you can implement static routing and make it work, it means you have a solid understanding of the internetwork.
So let’s get started.

Static Routing

Static routing occurs when you manually add routes in each router’s routing table. There are pros and cons to static routing, but that’s true for all routing processes.
Static routing has the following benefits:
  1. There is no overhead on the router CPU, which means you could possibly buy a cheaper router than you would use if you were using dynamic routing.
  2. There is no bandwidth usage between routers, which means you could possibly save money on WAN links.
  3. It adds security because the administrator can choose to allow routing access to certain networks only.
Static routing has the following disadvantages:
  1. The administrator must really understand the internetwork and how each router is connected in order to configure routes correctly.
  2. If a network is added to the internetwork, the administrator has to add a route to it on all routers by hand.
  3. It’s not feasible in large networks because maintaining it would be a full-time job in itself.
Okay—that said, here’s the command syntax you use to add a static route to a routing table:

ip route [destination_network] [mask] [next-hop_address or exitinterface] [administrative_distance]  [permanent]

This list describes each command in the string:
ip route: The command used to create the static route.
destination_network: The network you’re placing in the routing table.
mask: The subnet mask being used on the network.
next-hop_address: The address of the next-hop router that will receive the packet and forward it to the remote network. This is a router interface that’s on a directly connected network. You must be able to ping the router interface before you add the route. If you type in the wrong next-hop address or the interface to that router is down, the static route will show up in the router’s configuration but not in the routing table.
exitinterface: Used in place of the next-hop address if you want, and shows up as a
directly connected route.
administrative_distance: By default, static routes have an administrative distance of 1 (or even 0 if you use an exit interface instead of a next-hop address). You can change the default value by adding an administrative weight at the end of the command. I’ll talk a lot more about this subject later in the chapter when we get to the section on dynamic routing.