ipunnumbered命令配置.docx_第1页
ipunnumbered命令配置.docx_第2页
ipunnumbered命令配置.docx_第3页
ipunnumbered命令配置.docx_第4页
ipunnumbered命令配置.docx_第5页
已阅读5页,还剩5页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

Ip unnumbered 命令、配置“借用IP地址”实际就是:一个接口上没有配置IP地址,但是还想使用该接口。就向其它有IP地址的接口借一个IP地址来。如果被借用接口有多个IP地址,只能借来主IP地址。如果被借用接口没有IP地址,则借用接口的IP地址为。该功能通过Ip unnumbered命令来实现。例子: loopback0 /24R1R2loopback0 /24实验说明: 通过二层PPP封装可以实现地址借用,地址借用可节省可用IP地址,本实验R1,R2 串口不配地址,通过ppp封装,可借用内网IP地址,loopback口模拟内网。实验要求: 通过借用地址让两台路由器之间可正常通信。实验过程:第一步:配置R1R2预配置RouterenRouter#conf tEnter configuration commands, one per line. End with CNTL/Z.Router(config)#hos R1R1(config)#no ip domain-looR1(config)#line con 0R1(config-line)#no exec-tR1(config-line)#logg synR1(config-line)#endR1#RouterenRouter#conf tEnter configuration commands, one per line. End with CNTL/Z.Router(config)#hos R2R2(config)#no ip domain-looR2(config)#line con 0R2(config-line)#no exec-tR2(config-line)#logg synR2(config-line)#endR2#第二步:配置内网接口地址and封装串口与地址借用R1#conf tEnter configuration commands, one per line. End with CNTL/Z.R1(config)#int loo 0R1(config-if)#R1(config-if)#ip add /模拟内网地址R1(config-if)#exiR1(config)#int s 2/1R1(config-if)#en ppp /封装接口地址pppR1(config-if)# R1(config-if)#ip unnR1(config-if)#ip unnumbered loo 0 /借用内网loopback地址R1(config-if)#no shR1(config-if)#endR1#R2#conf tEnter configuration commands, one per line. End with CNTL/Z.R2(config)#int loo 0R2(config-if)#ip add R2(config-if)#exiR2(config)#int s 2/1R2(config-if)#en pppR2(config-if)#ip unnR2(config-if)#ip unnumbered l*Jul 18 14:38:00.579: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial2/1, changed state to upR2(config-if)#ip unnumbered loo 0R2(config-if)#第三步:查看接口并测试R1#sh run int s 2/1Building configuration.Current configuration : 95 bytes!interface Serial2/1 ip unnumbered Loopback0 encapsulation ppp serial restart-delay 0endR2#sh run int s 2/1Building configuration.Current configuration : 95 bytes!interface Serial2/1 ip unnumbered Loopback0 encapsulation ppp serial restart-delay 0endR1#sh ip int bInterface IP-Address OK? Method Status ProtocolFastEthernet0/0 unassigned YES unset administratively down down Serial2/0 unassigned YES unset administratively down down Serial2/1 YES TFTP up up Serial2/2 unassigned YES unset administratively down down Serial2/3 unassigned YES unset administratively down down Serial3/0 unassigned YES unset administratively down down Serial3/1 unassigned YES unset administratively down down Serial3/2 unassigned YES unset administratively down down Serial3/3 unassigned YES unset administratively down down Loopback0 YES manual up up /可以看出串口地址借用的是内网loopback地址第四步:ping测试R1 R2之间的连通性R1#ping Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to , timeout is 2 seconds:!Success rate is 100 percent (5/5), round-trip min/avg/max = 40/72/116 ms/连通性正常IP unnumbered配置一般而言,每个逻辑接口都要配置一个独立的IP,然而IOS是支持在串行接口(点到点)配置IP unnumbered 命令,这个命令的作用可以使串行接口,“借用”另外一个接口的IP,作用是节省IP地址分配,在实际中,见于拨号网络的接入设备,因访问服务器同时给很多个用户拨入,如果每个用户对应的接口都要IP地址的话,配置管理任务较多,而且需耗费较多IP地址。R2 (config)#interface loopback 0R2 (config-if)#ip address R2 (config-if)#no shutR2 (config-if)#interface serial 1R2 (config-if)#ip unnumbered loopback 0R1(config)#interface loopback 0R1(config-if)#ip addR1(config-if)#ip address R1(config-if)#interface serial 1R1(config-if)#ip unnumbered loopback 0R1(config-if)#clock rate 64000以上配置已经使R1和R2连接同步串行接口借用了各自环回口IP地址,注意,以太网接口时无法借用IP的:R1(config)#interface ethernet 0R1(config-if)#ip unnumbered loopback 0Point-to-point (non-multi-access) interfaces only在这种配置下,可以查看接口IP情况如下:Serial1 is up, line protocol is upHardware is HD64570Interface is unnumbered. Using address of Loopback0 ()R2#show interfaces serial 1Serial1 is up, line protocol is upHardware is HD64570Interface is unnumbered. Using address of Loopback0 ()接下来,我们验证在,无编号(ip unnumbered)接口运行路由协议的情况:(1) RIPR1(config)#router ripR1(config-router)#network R2#show ip routeCodes: 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 routeGateway of last resort is not set /8 is variably subnetted, 2 subnets, 2 masksR /32 120/1 via , 00:00:08, Serial1R /8 120/1 via , 00:00:08, Serial1 /24 is subnetted, 1 subnetsC is directly connected, Loopback0R1#show ip routeCodes: 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 routeGateway of last resort is not set /24 is subnetted, 1 subnetsC is directly connected, Loopback0 /8 is variably subnetted, 2 subnets, 2 masksR /32 120/1 via , 00:00:06, Serial1R /8 120/1 via , 00:00:06, Serial1可见,R1从R2学习到主类网络路由及子网,但因为RIPv1通告未携带子网掩码信息,R1把安装成/32的路由,如果是运行RIPv2就没有这个路由,RIP的这个问题在后面对应的实验里面分析。在这里我们只验证连通性:R1#ping Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to , timeout is 2 seconds:!Success rate is 100 percent (5/5), round-trip min/avg/max = 32/33/36 ms(2) 运行eigrpR2(config)#no router ripR2(config)#router eigrp 100R2(config-router)#network 55R1(config)#no router ripR1(config)#router eigrp 100R1(config)#router eigrp 100R1(config-router)#network 55查看邻居关系及路由表R1#show ip eigrp neighborsIP-EIGRP neighbors for process 100H Address Interface Hold Uptime SRTT RTO Q Seq (sec) (ms) Cnt Num0 Se1 13 00:00:47 494 2964 0 2R1#show ip routeCodes: 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 routeGateway of last resort is not set /24 is subnetted, 1 subnetsC is directly connected, Loopback0 /24 is subnetted, 1 subnetsD 90/2297856 via , 00:01:11, Serial1R1#ping Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to , timeout is 2 seconds:!Success rate is 100 percent (5/5), round-trip min/avg/max = 32/32/36 ms(3) 运行OSPF,先关闭EIGRPR1(config)#no router eigrp 100R1(config)#router ospf 100R1(config-router)#network 55 area 0R1(config-router)#interface loo0R1(config-if)#ip ospf network point-to-point /ospf通告的环回口默认是/32的主机路由,用这条命令可清除。R2(config)#no router eigrp 100R2(config)#router ospf 100R2(config-router)#network 55 area 0R2(config-router)#interface loo0R2(config-if)#ip ospf network point-to-pointR2#show ip routeCodes: C - connected, S - static, R - RIP

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论