不连续网络配置及其解决方案
创始人
2024-03-31 19:12:18
0
 
配置RIPV1
R1基本配置
    Router>enable
Router#conf t
Router(config)#host r1
R1(config)#int s2/1
R1(config-if)#ip add 12.1.1.1 255.255.255.0
R1(config-if)#no shut
R1(config-if)#exit
R1(config)#int f0/0
R1(config)#ip add 172.16.10.1 255.255.255.0
R1(config)#no shut

R2基本配置
    Router>enable
Router#conf t
Router(config)#int s2/1
Router(config-if)#ip add 12.1.1.2 255.255.255.0
Router(config-if)#no shut
Router(config-if)#exit
Router(config)#int f0/0
Router(config-if)#ip add 172.16.20.1 255.255.255.0
Router(config-if)#no shut

配置RIPV1
R1配置rip
   R1(config)#router rip
R1(config-route)#net 12.0.0.0
R1(config-route)#net 172.16.10.0

R2配置rip
    R2(config)#router rip
R2(config-route)#net 12.0.0.0
R2(config-route)#net 172.16.20.0

检测网络
  R1#ping 172.16.20.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.20.1, timeout is 2 seconds:
.....
Success rate is 0 percent (0/1)
R1#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
     172.16.0.0/24 is subnetted, 1 subnets
C       172.16.10.0 is directly connected, FastEthernet0/0
     12.0.0.0/24 is subnetted, 1 subnets
C       12.1.1.0 is directly connected, Serial2/1
r2#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
     172.16.0.0/24 is subnetted, 1 subnets
C       172.16.20.0 is directly connected, FastEthernet0/0
     12.0.0.0/24 is subnetted, 1 subnets
C       12.1.1.0 is directly connected, Serial2/1
r2#show ip pro
Routing Protocol is "rip"
  Sending updates every 30 seconds, next due in 1 seconds
  Invalid after 180 seconds, hold down 180, flushed after 240
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Redistributing: rip
  Default version control: send version 1, receive any version
    Interface           Send  Recv  Triggered RIP  Key-chain
    FastEthernet0/0       1     1 2                                 
    Serial2/1             1     1 2                                 
  Automatic network summarization is in effect
  Maximum path: 4
  Routing for Networks:
    12.0.0.0
    172.16.0.0
  Routing Information Sources:
    Gateway         Distance      Last Update
    12.1.1.1             120      00:00:24
  Distance: (default is 120)
这就是不连续网络造成的下来我们用不同方法来解决,让它可以ping通。
方法1 配置ripv2
      借助ripv2的特性支持不连续网络,支持可变长子网
  R1(config)#router rip
R1(config-router)#version 2
R2(config)#router rip
R2(config-router)#version 2
r1#show ip pro    //注意查看变化
Routing Protocol is "rip"
  Sending updates every 30 seconds, next due in 15 seconds
  Invalid after 180 seconds, hold down 180, flushed after 240
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Redistributing: rip
  Default version control: send version 2, receive version 2
    Interface           Send  Recv  Triggered RIP  Key-chain
    FastEthernet0/0       2     2                                   
    Serial2/1             2     2                                   
  Automatic network summarization is in effect
  Maximum path: 4
  Routing for Networks:
    12.0.0.0
    172.16.0.0
  Routing Information Sources:
    Gateway         Distance      Last Update
    12.1.1.2             120      00:00:02
  Distance: (default is 120)
r2#show ip pro
Routing Protocol is "rip"
  Sending updates every 30 seconds, next due in 10 seconds
  Invalid after 180 seconds, hold down 180, flushed after 240
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Redistributing: rip
  Default version control: send version 2, receive version 2
    Interface           Send  Recv  Triggered RIP  Key-chain
    FastEthernet0/0       2     2                                   
    Serial2/1             2     2                                   
  Automatic network summarization is in effect
  Maximum path: 4
  Routing for Networks:
    12.0.0.0
    172.16.0.0
  Routing Information Sources:
    Gateway         Distance      Last Update
    12.1.1.1             120      00:00:00
  Distance: (default is 120)


#p#

检测网络通断

   r1#ping 172.16.20.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.20.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 56/114/196 ms
r2#ping 172.16.10.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.10.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 24/108/200 ms

我们发现网络通了。这就是RIPV1与RIPV2的特征不同所决定的
方法2配置静态路由
静态路由的管理距离为默认为1.而rip的管理距离为120。所以在这个时候是静态路由起作用所以路由由不通到通
在配置完RIP后,我们再来配置两条静态路由
    r1(config)#ip route 172.16.20.0 255.255.255.0 12.1.1.2
R2(config)#ip route 172.16.10.0 255.255.255.0 12.1.1.1
 
r1#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 defa ult, U - per-user static route
 o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
     172.16.0.0/24 is subnetted, 2 subnets
S       172.16.20.0 [1/0] via 12.1.1.2
C       172.16.10.0 is directly connected, FastEthernet0/0
     12.0.0.0/24 is subnetted, 1 subnets
C       12.1.1.0 is directly connected, Serial2/1
方法三在每个接口上通告发送数据用RIPV2
R1配置
    R1#config t
R1(conf ig)#router rip
R1(conf ig- router)#net 12.0.0.0
R1(conf ig- router)#net 172.16.10.0
R1(config-router)#int s2/1
R1(config-if)#ip rip send version 2
R1(config-if)#int f0/0
R1(config-if)#ip rip send version 2
R2配置
   R2#config t
R2(conf ig)#router rip
R2(conf ig- router)#net 12.0.0.0
R2(conf ig- router)#net 172.16.20.0
R2(config-router)#int s2/1
R2(config-if)#ip rip send version 2
R2(config-if)#int f0/0
R2(config-if)#ip rip send version 2

测试网络
   R1#Ping 172.16.20.1 
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.20.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 32/109/208 ms
r1#show ip pro
Routing Protocol is "rip"
  Sending updates every 30 seconds, next due in 22 seconds
  Invalid after 180 seconds, hold down 180, flushed after 240
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Redistributing: rip
  Default version control: send version 1, receive any version
    Interface             Send  Recv  Triggered RIP  Key-chain
    FastEthernet0/0       2     1 2                                 
    Serial2/1             2     1 2                                 
  Automatic network summarization is in effect
  Maximum path: 4
  Routing for Networks:
    12.0.0.0
    172.16.0.0
  Routing Information Sources:
    Gateway         Distance      Last Update
    12.0.0.2             120      00:00:10
  Distance: (default is 120)

大家对照第四页和第六页的红字部分看看他们的区别
方法四,在同一接口上配置双IP来解决
我们在有RIPv1运行的情况下来进行配置
我们在中间网络中配置双IP   即R1 和R2上的S2/1上
我们给他配上172.16.30.0这个网络
    R1(config)#int s2/1
R1(config-if)#ip add 172.16.30.1 255.255.255.0 secondary
R2(config)#int s2/1
R2(config-if)#ip add 172.16.30.2 255.255.255.0 secondary
R2#  show run int s2/1
Building configuration...
Current configuration : 134 bytes
!
interface Serial2/1
 ip address 172.16.30.2 255.255.255.0 secondary
 ip address 12.0.0.2 255.255.255.0
 serial restart-delay 0
end
R1#  show run int s2/1
Building configuration...
Current configuration : 134 bytes
!
interface Serial2/1
 ip address 172.16.30.1 255.255.255.0 secondary
 ip address 12.0.0.1 255.255.255.0
 serial restart-delay 0
end
我们来测试以下网络
R1#Ping 172.16.20.1        //大家可以自己去试一试

【编辑推荐】

  1. IPV6的配置实例
  2. 北京某大型网吧Cisco 3700系列路由器优化方案
  3. 五个你从未用过的路由器与交换机功能

相关内容

热门资讯

如何允许远程连接到MySQL数... [[277004]]【51CTO.com快译】默认情况下,MySQL服务器仅侦听来自localhos...
如何利用交换机和端口设置来管理... 在网络管理中,总是有些人让管理员头疼。下面我们就将介绍一下一个网管员利用交换机以及端口设置等来进行D...
施耐德电气数据中心整体解决方案... 近日,全球能效管理专家施耐德电气正式启动大型体验活动“能效中国行——2012卡车巡展”,作为该活动的...
20个非常棒的扁平设计免费资源 Apple设备的平面图标PSD免费平板UI 平板UI套件24平图标Freen平板UI套件PSD径向平...
德国电信门户网站可实时显示全球... 德国电信周三推出一个门户网站,直观地实时提供其安装在全球各地的传感器网络检测到的网络攻击状况。该网站...
为啥国人偏爱 Mybatis,... 关于 SQL 和 ORM 的争论,永远都不会终止,我也一直在思考这个问题。昨天又跟群里的小伙伴进行...
《非诚勿扰》红人闫凤娇被曝厕所... 【51CTO.com 综合消息360安全专家提醒说,“闫凤娇”、“非诚勿扰”已经被黑客盯上成为了“木...
2012年第四季度互联网状况报... [[71653]]  北京时间4月25日消息,据国外媒体报道,全球知名的云平台公司Akamai Te...