打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
无编号IP(IP unnumber)用途

一、无编号IP(IP unnumbered)用途:
     使用无编号IP是因为IP地址比较紧张,所以在广域网链路汇总地址的分配时一般采取以下3种策略:1.使用VLSM 2.使用私有地址 3.使用无编号IP(IP unnumbered)
1.关于VLSM:可变长度子网掩码(VLSM)   
VLSM提出供了在一个主类(A、B、C类)网络内包含多个子网掩码的能力,以及对一个子网的再进行子网划分的能力。它的优点如下:   
对IP地址更为有效的使用-如果不采用VLSM,公司将被限制为在一个A、B、C类网络号内只能使用一个子网掩码;   
就用路由归纳的能力更强-VLSM允许在编址计划中有更多的体系分层,因此可以在路由表内进行更好的路由归纳。如果使用VLSM的话,那么运行的路由协议必须是无类(classless)的,以便在路由更新中发送掩码。如果是用有类(classful)路由协议的话,路由更新信息将出现错误,这也算使用VLSM时的交换条件吧。

2.关于私有地址:虽然使用VLSM提高了地址利用率,但仍然消耗了1个本可以用于扩展的子网。所以用私有地址可以比使用VLSM更节约地址,因为前者根本就不会消耗任何全球可寻址的IP。在点对点广域网链路上使用了私有地址,因为私有地址不会被INTERNETROUTER所路由,所以会导致一些限制,如:运行ICMPPING进行排错和远程TELNET等等。
3.关于 IP unnumbered: 前面提到了1.2的限制,在IP unnumbered 的却都没有。IP unnumbered说白了就是在串口上从另一个接口上借用一个IP(可以是ETHERNET 或LOOPBACK),因此不需要它自己的地址。而IPunnumbered 的最大诱惑是可以与classful routing protocols一起使用(看看刚说过的1)。

   但要使用IP unnumbered 也有2个规则:
           1。接口必须是串口且是点到点连接   
       2。在串口2端"借给"它们地址的局域网接口必须满足2者之一:
           ----- 相同主网不同子网,但掩码必须相同。   
           ------不同主网缺省掩码{即未被划分的主网


IP unnumbered 的限制:不能用PING来测试接口是否是UP的;不能通过一个使用IP unnumbered的串口来从网络IOS映像中启动;使用IP unnumbered 的借口不支持 IP 安全选项。

 

具体配置方法:
1:先配置好两台路由器的连接。
2:在两台路由器对连的串口,开启IP unnumbered 功能。

 

interface s0
ip unnumbered e0

图1.1 某公司的网络拓扑

1.1 使用背景
假设有一家公司。总部在北京,在深圳、上海各有一个分公司。在武汉有一个办事处。它的网络情况参加图1.1。R是总部的路由器,它通过电话网(PSTN)与各个分公司、办事处的路由器R1、R2、R3相连。R、R1、R2、R3四台路由器都有一个串口(用于拨号),一个以太网口用于连接本地的网络。
以R、R1为例,R与R1连通,则R、R1的串口上必须配有IP地址,才能实现互通。对于路由器来说,不同的接口必须配置不同网段的IP地址。这样R、R1的以太网口和串口的IP地址必须在不同的网段。R2、R3也是如此。而一个最小的网段也必须有四个IP地址。因此,该公司为了实现总部与各个分公司、办事处的互通,就必须拿出12(三个网段×四个IP地址)个IP地址来。如果该公司申请了一个C类地址(一共有255个IP地址),就只有243个IP地址可用与内部的主机。如果该公司有N个分公司、M个办事处,就需要拿出(N+M)×4个IP地址用于路由器的互通。此时剩下的可用IP地址就更少了

但是仔细想一下,保留给路由器串口的IP地址实际上仅仅是用于实现路由器间的互通,除此再没有别的用途了。在这样一种背景下,借用IP地址(Ipunnumbered)的功能就产生了。

1.2 使用方法
所谓“借用IP地址”实际就是:一个接口上没有配置IP地址,但是还想使用该接口。就向其它有IP地址的接口借一个IP地址来。如果被借用接口有多个IP地址,只能借来主IP地址。如果被借用接口没有IP地址,则借用接口的IP地址为0.0.0.0。该功能通过Ipunnumbered命令来实现。

Ip unnumbered interface number
[no]Ip unnumbered

例如封装PPP的串口借用以太网口的IP地址:

Quidway(config-if-Serial0)#ip unnumbered ethernet 0

由于借用接口本身没有IP地址,无法加上路由,所以必须手工配置两条路由才能实现路由器的连通。请参见下面的实例。

2 使用实例

我们就以图1.1所示的某公司的网络情况为例子,讲解一下具体的配置方法。

先讲总部路由器R的配置方法。R的串口用于连接各个分公司、办事处的路由器。所以可借用以太网口的IP地址。

Current configuration:
!
hostname beijing
!
interface Ethernet0
ip address 172.16.10.1 255.255.255.0
!
interface Serial0
ip unnumbered Ethernet0:借用以太网的IP地址
encapsulation ppp
!
ip route 172.16.20.0 255.255.255.0172.16.20.1:配置到深圳路由器R1以太网网段的路由
ip route 172.16.20.1 255.255.255.255serial0:配置到深圳路由器R1串口的接口路由

以深圳分公司的路由器R1为例,讲解一下它的配置:

Current configuration:
!
hostname shenzhen
!
interface Ethernet0
ip address 172.16.20.1 255.255.255.0
!
interface Serial0
ip unnumbered Ethernet0
encapsulation ppp
!
ip route 0.0.0.0 0.0.0.0 172.16.10.1: 配置到北京路由器R以太网网段的路由
ip route 172.16.10.1 255.255.255.255 serial0:配置到北京路由器R串口的接口路由

为突出主题,上面的配置只包含了与借用IP地址相关的配置。这里需要提请注意的是:路由的配置。

在北京总部的路由器R上必须配置两条静态路由才能访问到深圳路由器R1的以太网上的主机。第一条静态路由是到R1的以太网段的网段路由:下一跳为R1的串口的IP地址(或是借用的IP地址)。

ip route 172.16.20.1 255.255.255.0 172.16.20.1

第二条静态路由是到R1串口的接口路由,下一跳是R的串口。

ip route 172.16.20.1 255.255.255.255 serial0

加上这两条路由后,R就能把访问R1以太网段的IP报文正确地转发给R1。

同样,在R1上也要配置两条静态路由才能正确地访问到R的以太网网段。第一条静态路由是到R的以太网段的网段路由:下一跳为R的串口的IP地址(或是借用的IP地址)。

ip route 0.0.0.0 0.0.0.0 172.16.10.1

第二条静态路由是到R串口的接口路由,下一跳是R1的串口。

ip route 172.16.10.1 255.255.255.255 serial0

R2、R3参照R1的配置即可.

摘几个例子

Note: The information in these configurationexamples is based on Cisco IOS Software version 12.2(10b) and was tested on Cisco 2500 seriesrouters

Let us look at four different sample configurations for IPunnumbered.

Note: We could have used loopback interfacesinstead of ethernet interfaces.

(同一个主网,不同子网)

shows that oneither side of the serial link we have the same major net withdifferent subnets.

 

Router 1.1.1.1

Router 2.2.2.2

Current configuration:interface Ethernet0 ip address 171.68.178.196 255.255.255.192 interface Serial0 ip unnumbered Ethernet0router igrp 10 network 171.68.0.0
Current configuration:interface Ethernet 0 ip address 171.68.179.1 255.255.255.192 interface Serial 0 ip unnumbered Ethernet0 router igrp 10 network 171.68.0.0

 


Router 1.1.1.1# ping 171.68.179.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 171.68.179.1, timeout is 2seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max =28/30/32 ms

Router 2.2.2.2# show ip route

       171.68.0.0/26 is subnetted, 3 subnets
        171.68.179.0 is directly connected, Ethernet0
        171.68.178.192 [100/8976] via 171.68.178.196, 00:00:02,Serial0
        171.68.0.0 [100/8976] via 171.68.178.196, 00:00:02,Serial0
       
Router 2.2.2.2# ping 171.68.178.196

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 171.68.178.196, timeout is 2seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max =32/32/32 ms

The route information about subnets is correctly maintained inthis scenario.

 

shows that oneither side of the serial link we have different major nets and nosubnets.

 

Router 1.1.1.1

Router 2.2.2.2

Current configuration:interface Ethernet0 ip address 171.68.178.196 255.255.0.0 interface Serial0 ip unnumbered Ethernet0  router igrp 10 network 171.68.0.0
Current configuration:interface Ethernet 0 ip address 172.68.1.1 255.255.0.0 interface Serial 0 ip unnumbered Ethernet0  router igrp 10 network 172.68.0.0

Router 1.1.1.1# show ip route

     171.68.0.0/16 is directly connected, Ethernet0
     172.68.0.0/16 [100/8976] via 172.68.1.1, 00:01:26,Serial0

Router 1.1.1.1# ping 172.68.1.1

Sending 5, 100-byte ICMP Echos to 172.68.1.1, timeout is 2seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max =28/28/28 ms

Router 2.2.2.2# show ip route

     171.68.0.0/16 [100/8976] via 171.68.178.196, 00:00:21,Serial0
     172.68.0.0/16 is directly connected, Ethernet0

Router 2.2.2.2# ping 171.68.178.196

Sending 5, 100-byte ICMP Echos to 171.68.178.196, timeout is 2seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max =28/29/32 ms

 

shows that on oneside of the serial link we have a major net with a subnet, and onthe other side a major net with no subnet.

 

Router 1.1.1.1

Router 2.2.2.2

Current configuration:interface Ethernet0 ip address 171.68.178.196 255.255.255.192interface Serial0 ip unnumbered Ethernet0  router igrp 10 network 171.68.0.0
Current configuration:interface Ethernet 0 ip address 172.68.1.1 255.255.0.0interface Serial 0 ip unnumbered Ethernet0  router igrp 10 network 172.68.0.0

 
Router 1.1.1.1# ping 172.68.1.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.68.1.1, timeout is 2seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max =28/31/32 ms

Router 2.2.2.2# show ip route

       171.68.0.0/16 is variably subnetted, 2 subnets, 2 masks
        171.68.178.192/32 [100/8976] via 171.68.178.196, 00:00:48,Serial0
        171.68.0.0/16 [100/8976] via 171.68.178.196, 00:00:48,Serial0
     172.68.0.0/16 is directly connected, Ethernet0

Router 2.2.2.2# ping 171.68.178.196

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 171.68.178.196, timeout is 2seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max =28/29/32 ms

Note: Prior to Cisco IOS software version11.0(2), you are required to put a static route for the majornet171.68.0.0/16 in Router 2.2.2.2.

In this scenario, the subnet information gets lost since it'streated as a host route. In Cisco IOS software version 11.0(2) andhigher, Interior Gateway Routing Protocol (IGRP) and RoutingInformation Protocol (RIP) fix this problem by sending the summaryroute for the majornet across the unnumbered point-to-pointlinks.

 

shows that on bothsides of the serial link we have two different major nets withrespective subnets.

 

Router 1.1.1.1

Router 2.2.2.2

Current configuration:interface Ethernet0 ip address 171.68.178.196 255.255.255.192 interface Serial0 ip unnumbered Ethernet0  router igrp 10 network 171.68.0.0
Current configuration:interface Ethernet 0 ip address 172.68.1.1 255.255.255.192  interface Serial 0 ip unnumbered Ethernet0  router igrp 10 network 172.68.0.0

Router 1.1.1.1# show ip route

       171.68.0.0/26 is subnetted, 1 subnets
        171.68.178.192 is directly connected, Ethernet0
       172.68.0.0/16 is variably subnetted, 2 subnets, 2 masks
        172.68.0.0/16 [100/8976] via 172.68.1.1, 00:00:02,Serial0
        172.68.1.0/32 [100/8976] via 172.68.1.1, 00:00:02, Serial0

Router 1.1.1.1# ping 172.68.1.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.68.1.1, timeout is 2seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max =32/81/280 ms

Router 2.2.2.2# show ip route

       171.68.0.0/16 is variably subnetted, 2 subnets, 2 masks
        171.68.178.192/32 [100/8976] via 171.68.178.196, 00:00:22,Serial0
        171.68.0.0/16 [100/8976] via 171.68.178.196, 00:00:22,Serial0
       172.68.0.0/26 is subnetted, 1 subnets
        172.68.1.0 is directly connected, Ethernet0

Router 2.2.2.2# ping 171.68.178.196

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 171.68.178.196, timeout is 2seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max =28/31/32 ms

Note: In Cisco IOS software versions earlierthan 11.0(2), you are required to put a static route for themajornet 171.68.0.0/16 in Router 2.2.2.2 and 172.68.0.0/16 inRouter 1.1.1.1.

In this scenario, the subnet information gets lost since it'streated as a host route. In Cisco IOS software version 11.0(2) andlater, IGRP and RIP fix this problem by sending the summary routefor the majornet across the unnumbered point-to-point links.

 

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
IPv6 OSPFv3路由协议
CCIE学习(34)—— EIGRP配置
思科扩展ACL具体怎么配置?
导致EIGRP “not on common subnet”错误信息的主要原因
路由器配置命令全集
接口的一般配置
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服