全部博文(395)
分类:
2011-05-25 21:16:34
动态路由协议采用自适应路由算法,能够根据网络拓扑的变化而重新计算机最佳路由。由于路由的复杂性,路由算法也是分层次的,通常把路由协议(算法)划分为自治系统(AS)内的(IGP,Interior Gateway Protocol)与自治系统之间(EGP,External Gateway Protocol)的路由协议。
RIP协议基本配置命令
Router(config)#ip classless 让路由器支持无类编址,RIPv1是不支持无类IP编址的。
RIP基本配置命令:
Router(config)#router rip
Router(config-router)#network w.x.y.z
可选的配置命令:
Router(config)#no router rip在路由器上关闭RIP协议
Router(config-router)#no network w.x.y.z 从RIP协议中移除w.x.y.z网络
Router(config-router)#version 2 RIP协议为第2版
Router(config-if)#ip rip send version 2 该接口仅发送RIP ver 2报文
Router(config-if)#ip rip send version 1 该接口仅发送RIP ver 1报文
Router(conifg-if)#ip rip send version 1 2 该接口发送RIP ver 1报文和RIP ver 2报文
Router(config-if)#ip rip receive version 2 该接口仅接收RIP ver 2报文
Router(config-router)#no auto-summary 关闭路由协议的自动聚合功能
Router(config-router)#ip split-horizon 配置水平分割
以下是我今天试验配置的过程(由于这个试验我弄了块3个小时,我自己比较笨,呵呵,会的估计20分钟就弄成了,呵呵,我经常是时间换取成果,呵呵)(由于其中涉及很多的无用命令,还有重复性操作,我就没有列出,仅供自己参考,呵呵)
下面是第一个pc机得ip配置示意图
//下面是第一个路由器的配置过程
--- System Configuration Dialog ---
Continue with configuration dialog? [yes/no]: no
% Please answer 'yes' or 'no'.
Continue with configuration dialog? [yes/no]: no
Press RETURN to get started!
Router>en
Router>enable
Router#confi
Router#configure t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname Router
Router(config)#hostname Router0
Router0(config)#int
Router0(config)#interface se
Router0(config)#interface serial0/2/0
Router0(config-if)#clock rate 64000
Router0(config-if)#ip address
Router0(config-if)#ip address 192.168.0.1 255.255.255.0
Router0(config-if)#no shutdown
%LINK-5-CHANGED: Interface Serial0/2/0, changed state to down
Router0(config-if)#exit
Router0(config)#int
Router0(config)#interface fa
Router0(config)#interface fastEthernet0/0
Router0(config-if)#ip add
Router0(config-if)#ip address 10.1.1.1 255.255.255.0
Router0(config-if)#no shu
Router0(config-if)#no shutdown
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
Router0(config-if)#end
%SYS-5-CONFIG_I: Configured from console by console
Router0#sho
Router0#show ip
Router0#show ip r
Router0#show ip ro
Router0#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
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
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, 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/0
Router0>enab
Router0>enable
Router0#config
Router0#configure
Configuring from terminal, memory, or network [terminal]? t
Enter configuration commands, one per line. End with CNTL/Z.
Router0(config)#tou
Router0(config)#rout
Router0(config)#router rip
Router0(config-router)#network 10.0.0.0
Router0(config-router)#metwork 192.168.0.1
^
% Invalid input detected at '^' marker.
Router0(config-router)#exit
Router0(config)#end
%SYS-5-CONFIG_I: Configured from console by console
Router0#config
Router0#configure rip
^
% Invalid input detected at '^' marker.
Router0#confi
Router0#configure
Configuring from terminal, memory, or network [terminal]? t
Enter configuration commands, one per line. End with CNTL/Z.
Router0(config)#router rip
Router0(config)#router rip
Router0(config-router)#version 2
Router0(config-router)#end
%SYS-5-CONFIG_I: Configured from console by console
Router0#show ip rout
Router0#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
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
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, 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/0
C 192.168.0.0/24 is directly connected, Serial0/2/0
Router0#config
Configuring from terminal, memory, or network [terminal]? t
Enter configuration commands, one per line. End with CNTL/Z.
Router0>enb
Router0>enba
Router0>ena
Router0>enable
Router0#configure
Router0#configure
Configuring from terminal, memory, or network [terminal]? t
Enter configuration commands, one per line. End with CNTL/Z.
Router0(config)#router rip
Router0(config-router)#network 10.1.1.0
Router0(config-router)#network 192.168.0.0
Router0(config-router)#ve
Router0(config-router)#version 2
Router0(config-router)#exit
Router0(config)#show ip rout
Router0(config)#show ip r
Router0(config)#exit
%SYS-5-CONFIG_I: Configured from console by console
Router0#shown
Router0#shown ip rou
Router0#shown ip r
Router0#sh
Router0#show ip
Router0#show ip ro
Router0#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
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
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, 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/8 is variably subnetted, 2 subnets, 2 masks
R 10.0.0.0/8 [120/1] via 192.168.0.2, 00:00:16, Serial0/2/0
C 10.1.1.0/24 is directly connected, FastEthernet0/0
C 192.168.0.0/24 is directly connected, Serial0/2/0
R 192.168.1.0/24 [120/1] via 192.168.0.2, 00:00:16, Serial0/2/0
Router0#
//下面是第二个路由器的配置过程(关于基于端口的ip和网络配置略(和第一个一样))
Press RETURN to get started!
Rout1>e
Rout1>ena
Rout1>enable
Rout1#show
Rout1#show ip tou
Rout1#show ip rou
Rout1#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
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
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, 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.2.0 is directly connected, FastEthernet0/0
C 192.168.0.0/24 is directly connected, Serial0/2/0
C 192.168.1.0/24 is directly connected, Serial0/2/1
Rout1>enable
Rout1#configure
Rout1#configure
Configuring from terminal, memory, or network [terminal]? t
Enter configuration commands, one per line. End with CNTL/Z.
Rout1(config)#route
Rout1(config)#router rip
Rout1(config-router)#network 10.1.2.0
Rout1(config-router)#network 192.168.0.0
Rout1(config-router)#ver
Rout1(config-router)#version 2
Rout1(config-router)#network 192.168.1.0
Rout1(config-router)#version 2
Rout1(config-router)#end
%SYS-5-CONFIG_I: Configured from console by console
Rout1#sho
Rout1#show ip rou
Rout1#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
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
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, 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/8 is variably subnetted, 2 subnets, 2 masks
R 10.0.0.0/8 [120/1] via 192.168.0.1, 00:00:07, Serial0/2/0
C 10.1.2.0/24 is directly connected, FastEthernet0/0
C 192.168.0.0/24 is directly connected, Serial0/2/0
C 192.168.1.0/24 is directly connected, Serial0/2/1
Rout1#
下面两幅图是我测试时的图像,可以看到,包已经能够接受了,呵呵
下面是2台pc机ping的结果: