Nov 22, 2011

Abstract of CCNA study guide-22 - IP Routing 1


IP Routing
IP routing: is the process of moving packets from one network to another network using routers.
A routing protocol: is used by routers to dynamically
1) find all the networks in the internetwork
2) ensure that all routers have the same routing table.
3) determines the path of a packet through an internetwork..
Examples of routing protocols are RIP, RIPv2, EIGRP, and OSPF.

A routed protocol: Used to send user data (packets) through the established enterprise. Routed protocols are assigned to an interface and determine the method of packet delivery.
Examples of routed protocols are IP and IPv6.
Routing Basics
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.
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

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 or dynamic routing
Static Routing : someone must hand-type all network locations into the routing table
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.

The IP Routing Process
-        You must know that the frame changes at each hop but the packet is never changed in any way until it reaches the destination device.
-        The MAC addresses are always local. A MAC (hardware) address will only be used on a local LAN. It will never pass a router’s interface.
-        Understand that a frame carries a packet to only two places. A frame uses MAC (hardware) addresses to send a packet on a LAN. The frame will take the packet to either a host on the LAN or a router’s interface if the packet is destined for a remote network


Configuring IP Routing in Our Network
You’ll learn about the following types of routing in the following sections:
_ Static routing
_ Default routing
_ Dynamic routing

Static Routing
Static routing has the following benefits:
_ There is no overhead on the router CPU.
_ There is no bandwidth usage between routers.
_ It adds security because the administrator can choose to allow routing access to certain networks only.

Static routing has the following disadvantages:
_ The administrator must understand the internetwork and how each router is connected in order to configure routes correctly.
_ If a network is added , the administrator has to add a route to it on all routers by hand.
_ It’s not feasible in large networks.

syntax for  static route :
ip route [destination _network ] [mask ] [next hop-address or exit interface ]   [administrative_distance]  [permanent]

This list describes each command in the string:
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 .
exit interface : Used in place of the next-hop address , 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.
Permanent: keeps the entry in the routing table no matter what happens.

Example
Router(config)#ip route 172.16.3.0 255.255.255.0 192.168.2.4
Router(config)#ip route 172.16.3.0 255.255.255.0 192.168.2.4 150
Router(config)#ip route 172.16.3.0 255.255.255.0 s0/0/0

Verifying Your Configuration
Sh ip route command:
View the IP routing tables created on a Cisco router
Ex:
Corp#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
  D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
  N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
  E1 - OSPF external type 1, E2 - OSPF external type 2
  i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS
  level-2, ia - IS-IS inter area, * - candidate default, U - per-user
 static route, o - ODR, P - periodic downloaded static route

Gateway of last resort is not set
10.0.0.0/24 is subnetted, 1 subnets
C         10.1.1.0 is directly connected, FastEthernet0/1
Corp#

Ping Command:
I’ll start by pinging from the 1242AP to the 871W router.
Ex:
871W# ping 10.1.1.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.1.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms

Trace Command:
 we can trace from the 871W router to see the hops the packet takes to get to HostA:
871W#trace 10.1.6.2
Type escape sequence to abort.
Tracing the route to 10.1.6.2
1 10.1.11.1 0 msec 0 msec 0 msec
2 10.1.5.1 4 msec 0 msec 4 msec
3 10.1.2.2 0 msec 0 msec 4 msec
4 10.1.6.2 4 msec 4 msec *

Default Routing
-        We use default routing to send packets with a remote destination network not in the routing table to the next-hop router.
-        You should only use default routing on stub networks—those with only one exit path out of the network..

Configure default route :
we use wildcards in the network address and mask locations of a static route .
871W(config)#ip route 0.0.0.0 0.0.0.0 10.1.11.1
871W(config)#ip classless
871W(config)#do show ip route
Gateway of last resort is 10.1.11.1 to network 0.0.0.0
10.0.0.0/24 is subnetted, 2 subnets
C 10.1.11.0 is directly connected, Vlan1
C 10.1.12.0 is directly connected, Dot11Radio0
S* 0.0.0.0/0 [1/0] via 10.1.11.1
871W(config)#
An S*, indicates that this entry is for a default route.

I could have completed the default route command another way:
871W(config)#ip route 0.0.0.0 0.0.0.0 vlan1
What this is telling us is that if you don’t have an entry for a network in the routing table, just
forward it out VLAN1 .

Here are three commands for adding a gateway of last resort on the gateway router to the ISP.
Gateway(config)#ip route 0.0.0.0 0.0.0.0 217.124.6.1
Gateway(config)#ip route 0.0.0.0 0.0.0.0 s0/0
Gateway(config)#ip default-network 217.124.6.0

all three of these commands would accomplish the goal of setting the gateway of last resort, but there are some small differences between them.
- First, the exit interface solution would be used over the other two solutions because it has an AD of 0.
- Also, the ip default-network command would advertise the default network when you configure an IGP
(like RIP) on the router. This is so other routers in your internetwork will receive this route as a default route automatically.
Problems:
Problem1: But what happens if you misconfigured a default route? look at the output of a show ip route command and  next Figure  :
Router#sh ip route
[output cut]
Gateway of last resort is 172.19.22.2 to network 0.0.0.0
C 172.17.22.0 is directly connected, FastEthernet0/0
C 172.18.22.0 is directly connected, Serial0/0
S* 0.0.0.0/0 [1/0] via 172.19.22.2

the WAN link is on network 172.18.22.0 and  the default route is forwarding all packets to the 172.19.22.0 network. This is just bad—it will never work, so the problem is a misconfigured static (default) route.

Problem2: If you have the routing table as shown in the following lines, what happens if the router receives a packet from 10.1.6.100 destined for host 10.1.8.5?
Corp#sh ip route
[output cut]
Gateway of last resort is 10.1.5.5 to network 0.0.0.0
R 10.1.3.0 [120/1] via 101.2.2, 00:00:00, Serial 0/0
C 10.1.2.0 is directly connected, Serial0/0
C 10.1.5.0 is directly connected, Serial0/1
C 10.1.6.0 is directly connected, Fastethernet0/0
R* 0.0.0.0/0 [120/0] via 10.1.5.5, 00:00:00 Serial 0/1

the default route is listed as R*, which means it’s a RIP-injected route. This is because someone configured the ip default-network command on a remote router as well as configuring RIP, causing RIP to advertise this route through the internetwork as a default route. Since the destination address is 10.1.8.5 and there is no route to network 10.1.8.0, the router would use the default  route and send the packet out serial 0/1.

No comments:

Post a Comment