今天做的实验是配置LMI自动检测,我所使用的Router3640!
 
实验拓扑图,如下:
 
 
实验连线:
          
      帧交换机  S0/0  -------------帧中继DTE S0/0
 
IP地址表:
     
        RouterB  S0/0  192.1.1.1/24
 
具体配置如下:

Frameswitch:

Router>en
Router#config t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#hostname Frameswitch
Frameswitch(config)#frame-relay switching    //使Router具有帧中继交换机的能力
Frameswitch(config)#int s0/0
Frameswitch(config-if)#encapsulation frame-relay   //使接口在帧中继上封装,有两种类型IETF/CISCO,默认为CISCO.
Frameswitch(config-if)#clock rate 64000         //提供时钟
Frameswitch(config-if)#frame-relay intf-type dce    //使用Router作为帧中继交换机时使用的命令,用来定义帧中继交换机的类型。
Frameswitch(config-if)#frame-relay lmi-type cisco    //设置路由器本地管理接口LMI的类型
Frameswitch(config-if)#no shut
Frameswitch(config-if)#exit
Frameswitch(config)#exit
Frameswitch#
注意:
       frame-relay lmi-type cisco   由于默认是CISCO,所以不用设置也行,除非设置为ANSI,ITU类型,才需要设置,这里只是为了大家明白而已。

RouterB:
 
Router>en
Router#config t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#hostname RouterB
RouterB(config)#int s0/0
RouterB(config-if)#encapsulation frame-relay    
RouterB(config-if)#ip address 192.1.1.1 255.255.255.0
RouterB(config-if)#no shut
RouterB(config-if)#end
RouterB#
 
注意:
          这里我并没有配置LMI-TYPE,因为Router可以自动检测到LMI的类型,然后自动匹配。
 
下面我们来检测配置:
 
使用show int s0/0 查看输出的结果:
 
Frameswitch#show int s0/0
 
  Serial0/0 is up, line protocol is up
  Hardware is M4T
  MTU 1500 bytes, BW 2048 Kbit, DLY 20000 usec,
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation FRAME-RELAY, crc 16, loopback not set
  Keepalive set (10 sec)
  LMI enq sent  6, LMI stat recvd 0, LMI upd recvd 0
  LMI enq recvd 450, LMI stat sent  440, LMI upd sent  0, DCE LMI up
  LMI DLCI 1023  LMI type is CISCO  frame relay DCE
  FR SVC disabled, LAPF state down
  Broadcast queue 0/64, broadcasts sent/dropped 0/0, interface broadcasts 0
  Last input 00:00:03, output 00:00:03, output hang never
  Last clearing of "show interface" counters 01:12:23
  Queueing strategy: fifo
  Output queue 0/40, 0 drops; input queue 0/75, 0 drops
  5 minute input rate 0 bits/sec, 0 packets/sec
  5 minute output rate 0 bits/sec, 0 packets/sec
     452 packets input, 5878 bytes, 0 no buffer
     Received 0 broadcasts, 0 runts, 0 giants, 0 throttles
     0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
     452 packets output, 5878 bytes, 0 underruns
     0 output errors, 0 collisions, 5 interface resets
     0 output buffer failures, 0 output buffers swapped out
     5 carrier transitions     DCD=up  DSR=up  DTR=up  RTS=up  CTS=up
 
注意:
        情况表明,接口已经正常开启,LMI类型为CISCO,frame-relay DCE.

现在我们查看一下LMI的类型:
 
RouterB#show frame lmi
 
LMI Statistics for interface Serial0/0 (Frame Relay DTE) LMI TYPE = CISCO
  Invalid Unnumbered info 0             Invalid Prot Disc 0
  Invalid dummy Call Ref 0              Invalid Msg Type 0
  Invalid Status Message 0              Invalid Lock Shift 0
  Invalid Information ID 0              Invalid Report IE Len 0
  Invalid Report Request 0              Invalid Keep IE Len 0
  Num Status Enq. Sent 1                Num Status msgs Rcvd 2
  Num Update Status Rcvd 0              Num Status Timeouts 0
  
注意:
       情况表明RouterB的LMI TYPE为CISCO,这就是自动检测LMI的结果。
 
然而我们是要明白自动检测的一个过程,具体情况如下
 
注意:
      现在我们把S0/0接口down掉,然后通过debug frame-relay lmi ,然后开启S0/0接口,开始观察其自动检测的过程。

在RouterB路由器上:
 
在接口S0/0下,把接口关闭并将封装转为PPP.
 
RouterB#config t
Enter configuration commands, one per line.  End with CNTL/Z.
RouterB(config)#int s0/0
RouterB(config-if)#shut
RouterB(config-if)#encap ppp
RouterB(config-if)#end
 
验证一下S0/0的状态:
 
RouterB#show run
01:28:34: %SYS-5-CONFIG_I: Configured from console by console
Building configuration...
Current configuration : 784 bytes
!
version 12.1
no service single-slot-reload-enable
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname RouterB
!
logging rate-limit console 10 except errors
!
ip subnet-zero
!
!
no ip finger
!
call rsvp-sync
cns event-service server
!
!
!
!        
!
!
!
!
interface Serial0/0
 ip address 192.1.1.1 255.255.255.0
 encapsulation ppp
  shutdown
 no fair-queue
 clockrate 2015232
!
interface Serial0/1
 no ip address
 shutdown
 clockrate 2015232
!
interface Serial0/2
 no ip address
 shutdown
 clockrate 2015232
!
interface Serial0/3
 no ip address
 shutdown
 clockrate 2015232
!
ip kerberos source-interface any
ip classless
no ip http server
!
!
!
dial-peer cor custom
!
!
!
!
line con 0
 transport input none
line aux 0
line vty 0 4
!
end
注意:
      情况表明S0/0已经DOWN掉了。
 
输入debug frame-relay lmi启动帧中继LMI调试程序:
 
RouterB# debug frame lmi   //由于没有开启接口,所以这个时候没有数据输出。
Frame Relay LMI debugging is on
Displaying all Frame Relay LMI data
 
RouterB#config t
Enter configuration commands, one per line.  End with CNTL/Z.
RouterB(config)#int s0/0      
RouterB(config-if)#encap frame-relay  //封装为Frame-relay
RouterB(config-if)#no shut     //开启S0/0接口。
RouterB(config-if)#end
 
在退出配置模式几秒钟后,用户将看到四条调试信息
 
RouterB#          //下面为debug frame lmi 输出的数据。
01:44:52: %SYS-5-CONFIG_I: Configured from console by console
01:44:53: %LINK-3-UPDOWN: Interface Serial0/0, changed state to up
01:44:53: Serial0/0( out): StEnq, myseq 1, yourseen 0, DTE up
01:44:53: datagramstart = 0x5C01B14, datagramsize = 14
01:44:53: FR encap = 0x00010308
01:44:53: 00 75 95 01 01 00 03 02 01 00
01:44:53:
01:44:53: Serial0/0( out): StEnq, myseq 1, yourseen 0, DTE up
01:44:53: datagramstart = 0x5D4CE34, datagramsize = 13
01:44:53: FR encap = 0x00010308
01:44:53: 00 75 51 01 00 53 02 01 00
01:44:53:
01:44:53: Serial0/0( out): StEnq, myseq 1, yourseen 0, DTE up
01:44:53: datagramstart = 0x5D4DAB4, datagramsize = 13
01:44:53: FR encap = 0xFCF10309
01:44:53: 00 75 01 01 00 03 02 01 00
01:44:53:
01:44:53: Serial0/0( in): Status, myseq 1
01:44:53: RT IE 1, length 1, type 0
01:44:53: KA IE 3, length 2, yourseq 1 , myseq 1
RouterB#

注意:
           前三条RouterB分别用附件D,附件A及CISCO LMI发出的信令的结果,最后一条为Frameswitching对第三个帧的应答。
 
RouterB#show frame lmi   //再查看一下LMI的类型
LMI Statistics for interface Serial0/0 (Frame Relay DTE) LMI TYPE = CISCO
  Invalid Unnumbered info 0             Invalid Prot Disc 0
  Invalid dummy Call Ref 0              Invalid Msg Type 0
  Invalid Status Message 0              Invalid Lock Shift 0
  Invalid Information ID 0              Invalid Report IE Len 0
  Invalid Report Request 0              Invalid Keep IE Len 0
  Num Status Enq. Sent 91               Num Status msgs Rcvd 92
  Num Update Status Rcvd 0              Num Status Timeouts 0

到这里我们就完成了整个过程,文章的不足之处,请大家多多指教。