Default Routing and Classful Behavior

When you use a default route to reach a subnet of a connected major net, you must ensure that the router is configured with the ip classless global config command. Without ip classless, the router takes a classful posture and problems might surface. Consider the scenario depicted in Figure 3-12.

In the network pictured in Figure 3-12, Router A is classful (configured with no ip classless) and has a default route pointing to Router B as the gateway of last resort. Everything in Router A's routing table looks acceptable:

RTA#sh ip ro

Codes: C - connected, S - static, I - IGRP, R RIP, M mobile, B - BGP D • EIGRP, EX EIGRP external, 0 • OSPF, IA - OSPF inter area E1 OSPF external type 1, E2 - OSPF external type 2, E EGP i - IS-IS, L1 • IS-IS level -1, L2 IS IS level-2, * • candidate default

Gateway of last resort is 172.18.202.1 to network 0.0.0.0

C 172.18.202.0 is directly connected, Serial0

172.18.0.0/24 is subnetted, 3 subnets C 172.18.1.0 is directly connected, Ethernet©

C 172.18.2.0 is directly connected, Ethernetl

C 172.18.3.0 is directly connected, Seriall

Figure 3-12 Problems with Default Routing and Glassful Behavior

Figure 3-12 Problems with Default Routing and Glassful Behavior

As shown in the preceding output, Router A lacks routes to 172.18.99.0/24 and 15.15.15.0/24, hut it has a default route to Router B for all unknown destinations. Will the default route let Router A reach both 172.18.99.0/24 and 15.15.15.0/24? The answer is no, as shown by the following ping tests.

Issuing a ping to 15.15.15.15 gives:

RTA#ping 15.15.15.15

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 15.15.15.15, timeout is 2 seconds: 11!!!

Success rate is 100 percent (5/5), round-trip min/avg/max ■ 4/4/8 ms

As shown in the preceding output, Router A can reach 15.15.15.0/24 through the default route (exclamation points signify successful receipt of ping reply packets).

But issuing a ping to 172.18.99.1 gives:

RTA#ping 172.18.99.1

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 172.18.99.1, timeout is 2 seconds: Success rate is 0 percent (0/5)

The preceding output shows that Router A cannot reach 172.18.99.0/24 (dots indicate ping timeouts). So, what's the difference?

As a classful router. Router A checks for a direct connection to the major net before it forwards a packet. If the packet is destined to a directly connected major net (called a local domain), the router ignores the default route and looks in its routing table for a route to the destination. If a route does not exist, the packet is dropped.

Destination 172.18.99.1 is part of Router A's local domain. Subsequently, Router A does not use the default route and it drops the ping packets in the absence of a route to 172.18.99.0/24.

Packets to 15.15.15.0/24, on the other hand, arc forwarded to the gateway of last resort because it is outside Router A's local domain and no routes exist for that destination.

To disable classful behavior (checking of the local domain), issue the ip classless global config command. like so:

RTA#conf t

Enter configuration commands, one per line. End with CNTL/Z. RTA(config)#ip classless

The ip classless command toggles the router from classful mode to classless mode. Willi this command, the router has no notion of traditional classful addressing nor major nets. It simply looks at network prefixes. If Router A doesn't have a route to a destination, it uses the default route. The local domain check is skipped.

Issuing a ping to 172.18.99.1 with ip classless configured gives:

RTA#ping 172.18.99.1

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 172.18.99.1, timeout is 2 seconds: 11111

Success rate is 100 percent (5/5), round trip min/avg/»ax = 4/4/8 ms

The preceding output shows that ip classless has resolved the problem of reaching the unknown destination 172.18.99.0/24.

NOTE An alternate way to resolve the problem with default routing and classful behavior is to configure a static route that points the major net to default route 0.0.0.0. Looking back to the initial problem in Figure 3-12, you can configure ip route 172.18.0.0 255.255.0.0 0.0.0.0 in Router A. This allows classful Router A to reach unknown subnets of 172.18.0.0 through 0.0.0.0 (no ip classless is configured).

Was this article helpful?

0 0

Post a comment