监测清单4-1 ip address、ip address secondary、show interface等命令
R1# R1#conft Enter configuration commands, one per line. End with CNTL/Z. R1(config)#int e0 R1(config-if)#ip addr 172.16.1.1255.255.255.0 R1(config-if)#no sh R1(config-if)#end R1# 00:51:18: %SYS-5-CONFIG_1: Configured from console by console (键入组合键Ctrl+shift+6,x,切换回终端服务器) Term_Server>2 [Resuming connection 2 to R2 ... ] R2# R2#conft Enter configuration commands, one per line. End with CNTL/Z. R2(config)#int eO R2(config-if)#ip addr 172.16.1.2 255.255.255.0 R2(config-if)#no sh R2(config-if)#end R2# 00:52:58: %SYS-5-CG_I: Configured from console by console R2#sh int eO Ethernet0 is up, line PRotocol is up Hardware is Internet address is 172.16.1.2/24 MTU 1500 bytes,BW 1000 Kbit,DLY 1000 usec. reliability 255/255,txload 1/255,rxload 1/255 Encapsulation ARPA, loopback not set Keepalive set (10 sec) ARP type: ARPA, ARP Timeout 04:00:00 Last input 00:00:10, output 00:00:09, output hang never Last clearing of "show interface" counters never Input queue: 0/75/0/0 Queueing strategy:fifo Output queue :0/40 (size/max) 5 minute input rate Orbits/see, ;1:pactets/sec 5 minute output 203 packets input, 29123 bytes, 0 no buffer Received 203 broadcasts, 0 runts, 0 giants, 0 throttles 0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored 0 input packets with dribble condition detected 382 packets output, 37648 bytes, 0 underruns 0 output errors, 0 collisions, 18 interface resets 0 babbles, 0 late collision, 0 deferred 0 lost carrier, 0 no carrier 0 output buffer failures, 0 output buffers swapped out R2#sh ip int eO EthemetO is up, line protocol is up Internet address is 172.16.1.2.2/24 Broadcast address is 255.255.255.255 Adress determined by setup command MTU is 1500 bytes Helper address is not set Directed broadcast forwarding is desabled lutgoing access list is not set Inbound access list is not set Proxy ARP is enabled security level is default split horion is enabled ICMP redirects are always sent ICMP unreachables are always sent IP fast switching is enabled IP fast switching on the same interface is disabled IP Flow switching is disabled IP Fast switching turbo vector IP multicast fast switching is enabled IP multicast distributed fast switching is disabled IP route-cache flags are Fast Router Discovery is disabled IP output packet accounting is disabled IP access violation accounting is disabled TCP/IP header compression is disabled RTP/IP header compression is disabled Probe proxy name replies are disabled Policy routing is disabled Network address translation is disabled WCCP Redirect outbound is disabled WCCP Redirect exclude is disabled BGP Policy Mapping is disabled R2#SH IP int brief interface IP-Address ok?Method status protocol Ethernet0 170.16.1.2 YES manual up up serial0 unassigned YES NVRAM administratively down down serial1 unassigned YES NVRAM administratively down down R2#ping 172.16.1.1 Type escape sequence to abort. sending 5,100-byte ICMPEchos to 172.16.1.1,timeout is 2 seconds: ..!!! sUCcess rate is 60 percent(3/5),round-trip min/avg/max=4/4/4 ms R2#conft Enter configuration commands,one per line.End winth CNTL/Z R2(config)#ip subnet-zero R2(config)#ing e0 R2(config-if)#ip addr 172.0.0.1 255.255.255.0 Bad mask/24 for address 172.0.0.1 R2(config-if)#exit R2(config)#if subnet-zero R2(config)#int e0 R2(config-if)#ip addr 172.0.0.1255.255.255.0 R2(config-if)#ip addr 172.1.0.1 255.255.255.0 secondary R2(config-if)#ip addr 172.2.0.1 255.255.255.0 secondary R2(config-if)#^Z R2# (1)在监测清单的开始部分,分别在Rl和R2路由器的EO接口上配置了相应的IP地址。注重配置好IP地址后立即发出了Ho shut命令激活接口,初学者往往忽视此命令。 (2)sh int e0命令即show interface e0,其运行结果显示了EO接口的配置信息和统计信息,其中大部分是统计信息。配置信息有MAC地址(0000。0c8e。cdd2)、IP地址、MTU(15OOBytes)、BW(带宽,lOMbMs)、DLY(延迟)。reliability(可靠性)以及负载 (txload和rxload)等信息;统计信息是关于队列(而putqueue、Output queue)、最近5min时间内的输入、输出速率及数据包数量等信息。 (3)show ip interface e0(sh ip int eo)命令显示了EO接口上有关IP的所有配置信息,包括IP地址、广播地址、MTU、访问列表。Proxy ARP等众多条目我们应主要关注与CCNA考试相关的条目。 (4),show ip interface e0(sh ip int brief)以简洁的形式列出了路由器所有接口有关IP地址的配置信息,包括接口IP地址、是否可用 (OK?)、IP地址获取的方式 (Method)。接口状态(Status)和协议状态(Protocol)。其中manual表示人工设置,NVRAM表示启动时从配置文件中获取。 (5)使用Ping命令测试Rl和R2的IP连通性,以确认配置是否生效。注重ping命令执行结果中的细节,即"..!!!",这表示前两个包没有ping通,这是因为开始时在R2的ARP表中还没有R1的EO接口相关的表项,即不知道172.16.1.1的MAC地址是什么,在下面关于ARP相关命令的实验中,这一点会非常清楚地显示出来。 (6)在IOS11.3以后的版本中,ip subnet-zero语句成为Cisco路由器的缺省配置。它使得零子网成为合法的网络号。在实验中,首先关闭了此功能,即发出命令no ip subnet-zero,当设置EO接口的IP地址为172.0.0.1时,路由器报错;当发出命令ip subnet-zero答应零子网存在时,对EO接口重复上述的配置命令时,IP地址被成功设置。 (7)ip addr 172.1.0.1.255.255.255.0 secondary命令为EO接