您好,欢迎来到江浙沪招生考试网 !

设为首页|加入收藏|联系我们|网站地图|

江浙沪招生考试网

您现在的位置: test4exam >> 计算机考试 >> CISCO认证 >> 正文

各种路由协议认识

日期:2009/10/6 13:49:53 来源:本站原创 访问量:

purpose:目标

1static router(ip route [network] [subnetwork] [ip]) 静态路由

2default router   默认路由

   ip route 0.0.0.0 0.0.0.0.0 [ip]

   ip default-network [network]

3dynamic router (rip) 动态路由

Network Topology网络拓扑图

  

We need: 要求

1. configure RIP between R1R2 and R3 R1R2 and R3配置RIP路由协议

2. configure default network in R1,配置默认路由

###############################################################################

问题:在模拟器中R1的(config)中不能配置default-network

problem:i can't configure default-network in R1 with simulation

###############################################################################

R1

 

Press Enter to Start

Router>en

Router#conf t

Enter configuration commands, one per line.  End with CNTL/Z.

Router(config)#hostname R1  更改主机名

R1(config)#int s0  配置serial0

R1(config-if)#ip add 2.2.2.1 255.255.255.0 配置ip

R1(config-if)#clock rate 56000 DCE端配置时钟频率

R1(config-if)#no shut  开启端口

%LINK-3-UPDOWN: Interface Serial0, changed state to up

R1(config-if)#exit

%LINK-3-UPDOWN: Interface Serial0, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0, changed state to down

R1(config)#int e0  配置Ethernet0

R1(config-if)#ip add 1.1.1.1 255.255.255.0   配置ip

R1(config-if)#no shut  开启端口

%LINK-3-UPDOWN: Interface Ethernet0, changed state to up

R1(config-if)#exit

R1(config)#int s1   配置serial1

R1(config-if)#ip add 5.5.5.1 255.255.255.0  配置ip

R1(config-if)#no shut  开启端口

%LINK-3-UPDOWN: Interface Serial1, changed state to up

%LINK-3-UPDOWN: Interface Serial1, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1, changed state to down

R1(config-if)#

%LINK-3-UPDOWN: Interface Serial0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0, changed state to up

%LINK-3-UPDOWN: Interface Serial1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1, changed state to up

R1(config-if)#eixt

% Invalid input detected at '^' marker.

 

R1(config-if)#exit

R1(config)#^Z

%SYS-5-CONFIG_I: Configured from console by console

 

R1#show ip route 显示路由表

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

       D - EIGRP, EX - EIGRP external, O - 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

       U - per-user static route

 

Gateway of last resort is not set

C      1.1.1.0/24 is directly connected, Ethernet0

C      2.2.2.0/24 is directly connected, Serial0

C      5.5.5.0/24 is directly connected, Serial1

 

R1#conf t

Enter configuration commands, one per line.  End with CNTL/Z.

R1(config)#router rip  启用rip路由协议

R1(config-router)#net 1.0.0.0 设置宣告网段

R1(config-router)#net 2.0.0.0 设置宣告网段

R1(config-router)#net 5.0.0.0 设置宣告网段

R1(config-router)#^Z

%SYS-5-CONFIG_I: Configured from console by console

 

R1#show ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

       D - EIGRP, EX - EIGRP external, O - 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

       U - per-user static route

 

Gateway of last resort is not set

C      1.1.1.0/24 is directly connected, Ethernet0

C      2.2.2.0/24 is directly connected, Serial0

C      5.5.5.0/24 is directly connected, Serial1

 

R1#conf t

Enter configuration commands, one per line.  End with CNTL/Z.

R1(config)#ip ?    问题?这里没有配置default(模拟器上没有此命令)

access-list         Named access-list

dhcp                Configure DHCP server and relay parameters

domain-lookup       Enable IP Domain Name System hostname translation

host                Add an entry to the ip hostname table

http                HTTP server configuration

nat                 NAT configuration commands

route               Establish static routes

subnet-zero         Allow 'subnet zero' subnets

 

R1(config)#ip default-network 3.0.0.0

% Invalid input detected at '^' marker.

 

R1(config)#^Z

%SYS-5-CONFIG_I: Configured from console by console

 

R1#show ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

       D - EIGRP, EX - EIGRP external, O - 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

       U - per-user static route

 

Gateway of last resort is not set

C      1.1.1.0/24 is directly connected, Ethernet0

C      2.2.2.0/24 is directly connected, Serial0

C      5.5.5.0/24 is directly connected, Serial1

R      3.3.3.0/24 [120/1] via 2.2.2.2, 00:03:23, Serial0

R      6.6.6.0/24 [120/1] via 5.5.5.2, 00:05:41, Serial1

 

 

R1(config)#ip ?

access-list         Named access-list

dhcp                Configure DHCP server and relay parameters

domain-lookup       Enable IP Domain Name System hostname translation

host                Add an entry to the ip hostname table

http                HTTP server configuration

nat                 NAT configuration commands

route               Establish static routes

subnet-zero         Allow 'subnet zero' subnets

 

############################################################################################

R2

 

Router>en

Router#conf t

Enter configuration commands, one per line.  End with CNTL/Z.

Router(config)#hostname R2

R2(config)#int s1

R2(config-if)#ip add 2.2.2.2 255.255.255.0

R2(config-if)#no shut                                            『配置各个端口ip

%LINK-3-UPDOWN: Interface Serial1, changed state to up

R2(config-if)#exit

R2(config)#int s0

R2(config-if)#ip add 6.6.6.2 255.255.255.0

R2(config-if)#clock rate 56000

R2(config-if)#no shut

%LINK-3-UPDOWN: Interface Serial0, changed state to up

R2(config-if)#exit

R2(config)#

R2(config)#

R2(config)#

%LINK-3-UPDOWN: Interface Serial0, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0, changed state to down

R2(config)#int e0

R2(config-if)#ip add 3.3.3.1 255.255.255.0

R2(config-if)#no shut

%LINK-3-UPDOWN: Interface Ethernet0, changed state to up

%LINK-3-UPDOWN: Interface Serial0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0, changed state to up

R2(config-if)#^Z

%SYS-5-CONFIG_I: Configured from console by console

 

R2#show ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

       D - EIGRP, EX - EIGRP external, O - 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

       U - per-user static route

 

Gateway of last resort is not set

C      2.2.2.0/24 is directly connected, Serial1

C      3.3.3.0/24 is directly connected, Ethernet0

C      6.6.6.0/24 is directly connected, Serial0

 

R2#conf t

Enter configuration commands, one per line.  End with CNTL/Z.

R2(config)#router rip                                                 配置rip动态路由

R2(config-router)#net 2.0.0.0

R2(config-router)#net 3.0.0.0

R2(config-router)#net 6.0.0.0

R2(config-router)#^Z

%SYS-5-CONFIG_I: Configured from console by console

 

R2#show ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

       D - EIGRP, EX - EIGRP external, O - 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

       U - per-user static route

 

Gateway of last resort is not set

C      2.2.2.0/24 is directly connected, Serial1

C      3.3.3.0/24 is directly connected, Ethernet0

C      6.6.6.0/24 is directly connected, Serial0

 

R2#show ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

       D - EIGRP, EX - EIGRP external, O - 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

       U - per-user static route

 

Gateway of last resort is not set

C      2.2.2.0/24 is directly connected, Serial1

C      3.3.3.0/24 is directly connected, Ethernet0

C      6.6.6.0/24 is directly connected, Serial0

 

 

R2#show ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

       D - EIGRP, EX - EIGRP external, O - 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

       U - per-user static route

 

Gateway of last resort is not set

C      2.2.2.0/24 is directly connected, Serial1

C      3.3.3.0/24 is directly connected, Ethernet0

C      6.6.6.0/24 is directly connected, Serial0

R      1.1.1.0/24 [120/1] via 2.2.2.1, 00:05:41, Serial1

R      5.5.5.0/24 [120/1] via 2.2.2.1, 00:02:44, Serial1

 

R2#conf t

Enter configuration commands, one per line.  End with CNTL/Z.

R2(config)#ip route 0.0.0.0 0.0.0.0 3.3.3.2                         『添加缺省路由』

R2(config)#^Z

%SYS-5-CONFIG_I: Configured from console by console

 

R2#show ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

       D - EIGRP, EX - EIGRP external, O - 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

       U - per-user static route

 

Gateway of last resort is  to network 0.0.0.0

C      2.2.2.0/24 is directly connected, Serial1

C      3.3.3.0/24 is directly connected, Ethernet0

C      6.6.6.0/24 is directly connected, Serial0

R      1.1.1.0/24 [120/1] via 2.2.2.1, 00:09:16, Serial1

R      5.5.5.0/24 [120/1] via 2.2.2.1, 00:04:25, Serial1

S*     0.0.0.0/0 [1/0] via 3.3.3.2

 

R2#ping 1.1.1.1

 

Type escape sequence to abort.

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

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms

R2#ping 1.1.1.14.4.4.1

% Unrecognized host or address, or protocol not running.

 

R2#ping 4.4.4.1

 

Type escape sequence to abort.

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

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms

 

 

############################################################################################R3

 

Router>en

Router#conf t

Enter configuration commands, one per line.  End with CNTL/Z.

Router(config)#hostname R3

R3(config)#int s0                                                『配置各个端口ip

R3(config-if)#ip add 5.5.5.2 255.255.255.0

R3(config-if)#clock rate 56000

R3(config-if)#no shut

%LINK-3-UPDOWN: Interface Serial0, changed state to up

R3(config-if)#exit

R3(config)#int s1

R3(config-if)#ip add 6.6.6.1 255.255.255.0

R3(config-if)#no shut

%LINK-3-UPDOWN: Interface Serial1, changed state to up

R3(config-if)#exit

R3(config)#^Z

%SYS-5-CONFIG_I: Configured from console by console

 

R3#show ip route

% Invalid input detected at '^' marker.

 

R3#show ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

       D - EIGRP, EX - EIGRP external, O - 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

       U - per-user static route

 

Gateway of last resort is not set

C      5.5.5.0/24 is directly connected, Serial0

C      6.6.6.0/24 is directly connected, Serial1

 

R3#conf t

Enter configuration commands, one per line.  End with CNTL/Z.

R3(config)#router rip                                                  『配置rip路由协议』

R3(config-router)#net 5.0.0.0

R3(config-router)#net 6.0.0.0

R3(config-router)#exit

R3(config)#

R3(config)#^Z

%SYS-5-CONFIG_I: Configured from console by console

R3#show ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

       D - EIGRP, EX - EIGRP external, O - 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

       U - per-user static route

 

Gateway of last resort is not set

C      5.5.5.0/24 is directly connected, Serial0

C      6.6.6.0/24 is directly connected, Serial1

 

R3#ping 6.6.6.2

 

Type escape sequence to abort.

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

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms

R3#ping 3.3.3.1

 

Type escape sequence to abort.

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

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms

R3#ping 2.2.2.1

 

Type escape sequence to abort.

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

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms

R3#ping 5.5.5.1

 

Type escape sequence to abort.

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

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms

R3#ping 5.5.5.2

 

Type escape sequence to abort.

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

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms

R3#show ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

       D - EIGRP, EX - EIGRP external, O - 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

       U - per-user static route

 

Gateway of last resort is not set

C      5.5.5.0/24 is directly connected, Serial0

C      6.6.6.0/24 is directly connected, Serial1

R      3.3.3.0/24 [120/1] via 6.6.6.2, 00:01:31, Serial1

R      1.1.1.0/24 [120/1] via 5.5.5.1, 00:02:42, Serial0

R      2.2.2.0/24 [120/1] via 5.5.5.1, 00:07:17, Serial0

 

############################################################################################

R4

 

Router>en

Router#conf t

Enter configuration commands, one per line.  End with CNTL/Z.

Router(config)#hostname R

R(config)#hostname R4

R4(config)#int e1

R4(config-if)#ip add 3.3.3.2 255.255.255.0

R4(config-if)#no shut

%LINK-3-UPDOWN: Interface Ethernet1, changed state to up

R4(config-if)#exit

R4(config)#int e0

R4(config-if)#ip add 4.4.4.1 255.255.255.0

R4(config-if)#no shut

%LINK-3-UPDOWN: Interface Ethernet0, changed state to up

R4(config-if)#show ip route

% Invalid input detected at '^' marker.

 

R4(config-if)#^Z

%SYS-5-CONFIG_I: Configured from console by console

 

R4#show ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

       D - EIGRP, EX - EIGRP external, O - 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

       U - per-user static route

 

Gateway of last resort is not set

C      3.3.3.0/24 is directly connected, Ethernet1

C      4.4.4.0/24 is directly connected, Ethernet0

 

R4#conf t

Enter configuration commands, one per line.  End with CNTL/Z.

R4(config)#ip route 0.0.0.0 0.0.0.0 3.3.3.1

R4(config)#^Z

%SYS-5-CONFIG_I: Configured from console by console

 

R4#show ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

       D - EIGRP, EX - EIGRP external, O - 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

       U - per-user static route

 

Gateway of last resort is  to network 0.0.0.0

C      3.3.3.0/24 is directly connected, Ethernet1

C      4.4.4.0/24 is directly connected, Ethernet0

S*     0.0.0.0/0 [1/0] via 3.3.3.1

 

R4#ping 3.3.3.1

 

Type escape sequence to abort.

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

.....

Success rate is 0 percent (0/5), round-trip min/avg/max = 1/2/4 ms

R4#ping 3.3.3.2

 

Type escape sequence to abort.

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

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms

R4#ping 4.4.4.2

 

Type escape sequence to abort.

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

.....

Success rate is 0 percent (0/5), round-trip min/avg/max = 1/2/4 ms

 

R4#show run

Building configuration...

 

!

Version 12.1

service timestamps debug uptime

service timestamps log uptime

no service password-encryption

!

hostname R4

!

!

!

ip subnet-zero

!

!

!

!

interface Serial0

 no ip address

 no ip directed-broadcast

 shutdown

!

interface Serial1

 no ip address

 no ip directed-broadcast

 shutdown

!

interface Ethernet0

 ip address 4.4.4.1 255.255.255.0

 no ip directed-broadcast

!

interface Ethernet1

 ip address 3.3.3.2 255.255.255.0

 no ip directed-broadcast

!

!

ip classless

no ip http server

ip route 0.0.0.0 0.0.0.0 3.3.3.1

!

!

line con 0

 transport input none

line aux 0

line vty 0 4

!

no scheduler allocate

end

 

R4#conf t

Enter configuration commands, one per line.  End with CNTL/Z.

R4(config)#int e1

R4(config-if)#ip add 4.4.4.1 255.255.255.0

4.4.4.0 overlaps with Ethernet0

 

R4(config-if)#exit

R4(config)#int e0

R4(config-if)#no ip add 4.4.4.1 255.255.255.0

R4(config-if)#ip add 3.3.3.2 255.255.255.0

3.3.3.0 overlaps with Ethernet1

 

R4(config-if)#exit

R4(config)#int e1

R4(config-if)#ip add 4.4.4.1 255.255.255.0

R4(config-if)#no shut

R4(config-if)#exit

R4(config)#int e0

R4(config-if)#ip add 3.3.3.2 255.255.255.0

R4(config-if)#no shut

R4(config-if)#^Z

%SYS-5-CONFIG_I: Configured from console by console

相关阅读

Copyright ©2013-2015 江浙沪招生考试网 All Rights Reserved.
地址: 苏州市姑苏区阊胥路483号(工投创业园)  电话:0512-85551931 邮编: 214000
邮箱: [email protected] 版权所有:苏州迈峰教育科技有限公司 苏ICP备15050684号-2