标签:rip 添加 企业网 外部 客户 ext 技术 str 路径
OSPF高级配置1.一个单一IP路由协议是管理网络中IP路由的首选方案
2.Cisco ISO能执行多个路由协议,每一个路由协议和该路由协议所服务的网络属于同一个自治系统
3.Cisco ISO使用路由重分发特性以交换不同协议创建的路由信息
1.度量值
2.管理距离
1.类型1的外部路径(type1 external path,E1)
2.类型2的外部路径(type2 external path,E2)
Router(config-router)#redistribute protocol metric metric-value metric-type type-value subnets
router rip
redistribute ospf 1metric 10
router ospf 1
redistribute rip metric 200 subnets
router ospf 1
redistribute static metric 100 subnets metric-type2
router ospf 1
network 192.168.0.0 0.0.0.255 area 0
default-information originate metric 10 netric-type 1
ip route 0.0.0.0 0.0.0.0 10.0.1.1
打开GNS3后:
1.拖出六个路由器(每台路由器需要右键点击选择configure,在Slots中添加一个端口NM-1FE-TX,点击OK添加)
2.四台PC机
3.将R6的 图标改为cloud(这里作为电信运营商)
其中:
1.area1和area2都为ospf协议
2.R4到R5段为RIP协议
3.R3担任ABR的角色
R1:
R1#conf t
R1(config)#int f0/0
R1(config-if)#ip add 192.168.10.1 255.255.255.0
R1(config-if)#no shut
R1(config-if)#int f0/1
R1(config-if)#ip add 192.168.20.1 255.255.255.0
R1(config-if)#no shut
R1(config-if)#ex
R1(config)#ip route 0.0.0.0 0.0.0.0 192.168.20.0 //末梢网络环境配置默认路由出去,指向下一跳地址
R2:
R2#conf t
R2(config)#int f0/1
R2(config-if)#ip add 192.168.20.2 255.255.255.0
R2(config-if)#no shut
R2(config-if)#ex
R2(config)#int f0/0
R2(config-if)#ip add 192.168.30.1 255.255.255.0
R2(config-if)#no shut
R2(config-if)#ex
R2(config)#router ospf 1 //启用OSPF进程1
R2(config-router)#router-id 2.2.2.2 //标注router-id
R2(config-router)#network 192.168.30.0 0.0.0.255 area 1 //宣告30段落的网段,在area1中
R2(config-router)#ex
R2(config)#ip route 192.168.10.0 255.255.255.0 192.168.20.1 //做静态路由
R2(config)#router ospf 1 //启用OSPF进程1
R2(config-router)#redistribute connected subnets //直连网段20段落注入
R2(config-router)#redistribute static subnets //静态网段10段落注入
R2(config-router)#ex
R3:
R3#conf t
R3(config)#int f0/0
R3(config-if)#ip add 192.168.30.2 255.255.255.0
R3(config-if)#no shut
R3(config-if)#int f0/1
R3(config-if)#ip add 192.168.40.1 255.255.255.0
R3(config-if)#no shut
R3(config-if)#int f1/0
R3(config-if)#ip add 12.0.0.1 255.255.255.0
R3(config-if)#no shut
R3(config-if)#int f2/0
R3(config-if)#ip add 192.168.70.1 255.255.255.0
R3(config-if)#no shut
R3(config-if)#do show ip int b
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 192.168.30.2 YES manual up up
FastEthernet0/1 192.168.40.1 YES manual up up
FastEthernet1/0 12.0.0.1 YES manual up up
FastEthernet2/0 192.168.70.1 YES manual up up
R3(config-if)#ex
R3(config)#ip route 0.0.0.0 0.0.0.0 12.0.0.2 //配置默认路由出去,指向下一跳
R3(config)#router ospf 1 //启用OSPF进程1
R3(config-router)#router-id 3.3.3.3 //标注router-id
R3(config-router)#network 192.168.30.0 0.0.0.255 area 1 //在area1中宣告30段
R3(config-router)#network 192.168.40.0 0.0.0.255 area 0 //在area0中宣告40段
R3(config-router)#network 192.168.70.0 0.0.0.255 area 0 //在area0中宣告70段
R3(config-router)#default-information originate //注入外部默认路由
R3(config-router)#ex
R4:
R4#conf t
R4(config)#int f0/0
R4(config-if)#ip add 192.168.40.2 255.255.255.0
R4(config-if)#no shut
R4(config-if)#int f0/1
R4(config-if)#ip add 192.168.50.1 255.255.255.0
R4(config-if)#no shut
R4(config-if)#ex
R4(config)#router rip //配rip协议
R4(config-router)#ver 2
R4(config-router)#no auto-summary
R4(config-router)#network 192.168.50.0
R4(config-router)#redistribute ospf 1 metric 5 //注入ospf协议包含进程号和度量值
R4(config-router)#ex
R4(config)#router ospf 1 //启用OSPF进程1
R4(config-router)#router-id 4.4.4.4 //标注router-id
R4(config-router)#network 192.168.40.0 0.0.0.255 area 0
R4(config-router)#redistribute rip subnets //注入rip协议
R4(config-router)#ex
R5:
R5#conf t
R5(config)#int f0/0
R5(config-if)#ip add 192.168.50.2 255.255.255.0
R5(config-if)#no shut
R5(config-if)#int f0/1
R5(config-if)#ip add 192.168.60.1 255.255.255.0
R5(config-if)#no shut
R5(config-if)#ex
R5(config-if)#router rip //配rip协议
R5(config-router)#ver 2
R5(config-router)#no auto-summary
R5(config-router)#network 192.168.50.0
R5(config-router)#network 192.168.60.0
R5(config-router)#ex
R6:
R6#conf t
R6(config)#int f0/0
R6(config-if)#ip add 12.0.0.2 255.255.255.0
R6(config-if)#no shut
R6(config-if)#int f0/1
R6(config-if)#ip add 13.0.0.1 255.255.255.0
R6(config-if)#no shut
R6(config-if)#ex
R6(config)#ip route 192.168.0.0 255.255.0.0 12.0.0.1 //配静态路由
1客户机>ip 192.168.10.2 192.168.10.1
2客户机>ip 192.168.70.2 192.168.70.1
3客户机>ip 13.0.0.13 13.0.0.1
4客户机>ip 192.168.60.2 192.169.60.1
进入PC1
PC1>ping 192.168.70.2 -t(长ping测试)
PC1>ping 192.168.60.2 -t(长ping测试)
PC1>ping 13.0.0.13 -t(长ping测试)
结果如下图,达成全网互通,实验成功!
R1:
R1(config)#do show ip route
......(省略部分显示)
C 192.168.10.0/24 is directly connected, FastEthernet0/0
C 192.168.20.0/24 is directly connected, FastEthernet0/1
S* 0.0.0.0/0 [1/0] via 192.168.20.2
R2:
R2(config)#do show ip route
......(省略部分显示)
C 192.168.30.0/24 is directly connected, FastEthernet0/0
O E2 192.168.60.0/24 [110/20] via 192.168.30.2, 00:12:45, FastEthernet0/0
S 192.168.10.0/24 [1/0] via 192.168.20.1
O IA 192.168.40.0/24 [110/20] via 192.168.30.2, 01:43:09, FastEthernet0/0
C 192.168.20.0/24 is directly connected, FastEthernet0/1
O E2 192.168.50.0/24 [110/20] via 192.168.30.2, 00:12:45, FastEthernet0/0
O IA 192.168.70.0/24 [110/11] via 192.168.30.2, 01:42:47, FastEthernet0/0
O *E2 0.0.0.0/0 [110/1] via 192.168.30.2, 01:41:24, FastEthernet0/0
R3:
R3(config)#do show ip route
......(省略部分显示)
C 192.168.30.0/24 is directly connected, FastEthernet0/0
O E2 192.168.60.0/24 [110/20] via 192.168.40.2, 00:21:06, FastEthernet0/1
O E2 192.168.10.0/24 [110/20] via 192.168.30.1, 01:51:31, FastEthernet0/0
C 192.168.40.0/24 is directly connected, FastEthernet0/1
O E2 192.168.20.0/24 [110/20] via 192.168.30.1, 01:51:31, FastEthernet0/0
12.0.0.0/24 is subnetted, 1 subnets
C 12.0.0.0 is directly connected, FastEthernet1/0
O E2 192.168.50.0/24 [110/20] via 192.168.40.2, 00:21:07, FastEthernet0/1
C 192.168.70.0/24 is directly connected, FastEthernet2/0
S* 0.0.0.0/0 [1/0] via 12.0.0.2
R4:
R4(config)#do show ip route
......(省略部分显示)
O IA 192.168.30.0/24 [110/20] via 192.168.40.1, 00:24:05, FastEthernet0/0
R 192.168.60.0/24 [120/1] via 192.168.50.2, 00:00:00, FastEthernet0/1
O E2 192.168.10.0/24 [110/20] via 192.168.40.1, 00:24:05, FastEthernet0/0
C 192.168.40.0/24 is directly connected, FastEthernet0/0
O E2 192.168.20.0/24 [110/20] via 192.168.40.1, 00:24:05, FastEthernet0/0
C 192.168.50.0/24 is directly connected, FastEthernet0/1
O 192.168.70.0/24 [110/11] via 192.168.40.1, 00:24:05, FastEthernet0/0
O*E2 0.0.0.0/0 [110/1] via 192.168.40.1, 00:24:07, FastEthernet0/0
R5:
R5(config)#do show ip route
......(省略部分显示)
R 192.168.30.0/24 [120/5] via 192.168.50.1, 00:00:20, FastEthernet0/0
C 192.168.60.0/24 is directly connected, FastEthernet0/1
R 192.168.10.0/24 [120/5] via 192.168.50.1, 00:00:20, FastEthernet0/0
R 192.168.40.0/24 [120/5] via 192.168.50.1, 00:00:20, FastEthernet0/0
R 192.168.20.0/24 [120/5] via 192.168.50.1, 00:00:20, FastEthernet0/0
C 192.168.50.0/24 is directly connected, FastEthernet0/0
R 192.168.70.0/24 [120/5] via 192.168.50.1, 00:00:20, FastEthernet0/0
R* 0.0.0.0/0 [120/1] via 192.168.50.1, 00:00:10, FastEthernet0/0
R6:
R6(config)#do show ip route
......(省略部分显示)
12.0.0.0/24 is subnetted, 1 subnets
C 12.0.0.0 is directly connected, FastEthernet0/0
13.0.0.0/24 is subnetted, 1 subnets
C 13.0.0.0 is directly connected, FastEthernet0/1
S 192.168.0.0/16 [1/0] via 12.0.0.1
标签:rip 添加 企业网 外部 客户 ext 技术 str 路径
原文地址:https://blog.51cto.com/14464303/2437866