如下拓扑:

clip_image002

静态:

R6(config)#ip route 192.168.3.0 255.255.255.0 192.168.2.2 8

R6(config)#end

查看:

R6#show 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

C 192.168.1.0/24 is directly connected, FastEthernet2/0

192.168.2.0/24 is variably subnetted, 2 subnets, 2 masks

C 192.168.2.2/32 is directly connected, Serial1/2

C 192.168.2.0/24 is directly connected, Serial1/2

S 192.168.3.0/24 [8/0] via 192.168.2.2

R6#

动态:

RIP:

R6(config)#router rip

R6(config-router)#distance 11

R6(config-router)#network 192.168.1.0

R6(config-router)#network 192.168.2.0

R6(config-router)#end

查看:

Routing Protocol is "rip"

Outgoing update filter list for all interfaces is not set

Incoming update filter list for all interfaces is not set

Sending updates every 30 seconds, next due in 26 seconds

Invalid after 180 seconds, hold down 180, flushed after 240

Redistributing: rip

Default version control: send version 1, receive any version

Interface Send Recv Triggered RIP Key-chain

Serial1/2 1 1 2

FastEthernet2/0 1 1 2

Automatic network summarization is in effect

Maximum path: 4

Routing for Networks:

192.168.1.0

192.168.2.0

Routing Information Sources:

Gateway Distance Last Update

Distance: (default is 11)

EIGRP:

R6(config)#router eigrp 200

R6(config-router)#network 192.168.1.0

R6(config-router)#network 192.168.2.0

R6(config-router)#

Feb 25 15:13:21.335: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 200: Neighbor 192.168.2.2 (Serial1/2) is up: new adjacency

Feb 25 15:13:30.867: IP-EIGRP(Default-IP-Routing-Table:200): Neighbor 192.168.3.1 not on common subnet for FastEthernet2/0

R6(config-router)#

R6(config-router)#

R6(config-router)#

R6(config-router)#distance 33 192.168.1.0 0.0.0.255

R6(config-router)#distance 33 192.168.2.0 0.0.0.255

R6(config-router)#end

查看EIGRP的管理距离:

R6#show 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

C 192.168.1.0/24 is directly connected, FastEthernet2/0

192.168.2.0/24 is variably subnetted, 2 subnets, 2 masks

C 192.168.2.2/32 is directly connected, Serial1/2

C 192.168.2.0/24 is directly connected, Serial1/2

D 192.168.3.0/24 [33/2172416] via 192.168.2.2, 00:00:50, Serial1/2

查看:

OSPF:

R6(config)#router ospf 22

R6(config-router)#distance 22 192.168.1.0 0.0.0.255

R6(config-router)#distance 22 192.168.2.0 0.0.0.255

R6#show ip route

Routing Protocol is "ospf 22"

Outgoing update filter list for all interfaces is not set

Incoming update filter list for all interfaces is not set

Router ID 192.168.2.1

Number of areas in this router is 0. 0 normal 0 stub 0 nssa

Maximum path: 4

Routing for Networks:

Reference bandwidth unit is 100 mbps

Routing Information Sources:

Gateway Distance Last Update

Distance: (default is 22)

Address Wild mask Distance List

192.168.1.0 0.0.0.255 22

192.168.2.0 0.0.0.255 22