qq524061227 发表于 2018-7-17 09:13:41

Cisco实用命令笔记(适合网管)

  1. IP和MAC地址绑定
  网上资料很多,但多是转载。访问控制列表有点复杂,而端口绑定对我们又没必要,我们只是想防止别人盗用他人有外网权限的IP地址上网,所以我们只是用了以下命令:
  6509-1(config)# arp [ ip地址]arpa(arpa是一种arp协议类型)
  测试:1)两台电脑A和B,A的IP开通外网并做IP和MAC绑定,B的未开通且不做绑定,
  将A网线拔出,并将A的IP设置在B上,B还是无法上外网
  2)两台电脑A和B,A和B的IP均开通外网并做IP和MAC绑定
  将A网线拔出,并将A的IP设置在B上,B依然可以上外网
  结论:虽然该方法无法绝对阻止非外网用户盗用IP,但是非外网用户设置外网IP后还是不能上外网,一定程度上可以减少IP盗用现象。
  如果是外网用户,盗用其他外网IP是可以上网的,但是自己本身的IP已经能上外网了,没必要盗用,除非是设置错误。
  所以,这一条命令对我们来说还是有作用的。
  2.查看下面接了些什么设备
  #show cdp neighbors
  例如:
  6509-1#showcdp neighbors
  Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
  S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone,

  D - Remote, C - CVTA, M - Two-port Mac>
  Device>  cm8fe1         Gig 1/1/29      162            S I   WS-C2960G Gig 0/45
  cm9fe1         Gig 1/1/34      175            S I   WS-C2960G Gig 0/45
  cm8fe2         Gig 1/1/23      130            S I   WS-C2960G Gig 0/45
  cm4fe1         Gig 1/1/9         148            S I   WS-C2960G Gig 0/45
  cm7fe2         Gig 1/1/24      126            S I   WS-C2960G Gig 0/45
  Cisco_10:10:e3   Gig 1/1/48      166               H    AIR-WLC44 Gig 0/0/1
  CM-SDH         Gig 1/3/45      166               R    7206VXR   Gig 0/1
  3.查看IP和MAC地址对应表
  6509-1#show ip arp
  ProtocolAddress          Age (min)Hardware Addr   Type   Interface
  Internet192.168.17.121      118   f0de.f1e5.01c7ARPA   Vlan17
  Internet192.168.112.24      168   6cfd.b924.8002ARPA   Vlan112
  如果后面不加参数,就显示所有的IP和MAC的对应信息

  常用参数一般有以下三种:IP地址,MAC地址,VLAN>  1)加IP地址,就会显示该IP地址相关的信息,例如:
  6509-1#show ip arp 192.168.17.121
  ProtocolAddress          Age (min)Hardware Addr   Type   Interface
  Internet192.168.17.121      122   f0de.f1e5.01c7ARPA   Vlan17
  2)加MAC地址,就会显示该MAC地址相关信息,例如:
  6509-1#show ip arpf0de.f1e5.01c7
  ProtocolAddress          Age (min)Hardware Addr   Type   Interface
  Internet192.168.17.121      125   f0de.f1e5.01c7ARPA   Vlan17

  3) 加VLAN>  6509-1#show ip arpvlan 17
  ProtocolAddress          Age (min)Hardware Addr   Type   Interface
  Internet192.168.17.121      133   f0de.f1e5.01c7ARPA   Vlan17
  Internet192.168.17.120          5   0011.5b1c.d1b3ARPA   Vlan17
  Internet192.168.17.123          3   0006.0a0d.312fARPA   Vlan17
  Internet192.168.17.125          5   0011.5b1c.f518ARPA   Vlan17
  4.查看MAC地址表
  6509-1#show mac-address-table vlan 17
  Legend: * - primary entry
  age - seconds since last seen
  n/a - not available
  vlan   mac address   type    learn   age            ports
  ------+----------------+--------+-----+----------+--------------------------
  Supervisor switch 1 Module 5
  *   1714fe.b5c4.95e0   dynamicYes          0   Gi1/3/1
  *   170040.3636.818d   dynamicYes          0   Gi1/3/1

  show mac-address-table 后面如果不加任何参数,则会显示所有的信息,一般我们常用vlan>  5.查看交换机所有端口开启和关闭情况(以cisco 2960为例)
  命令 #show ip interface brief
  例如:
  cm6fw1#show ip interface brief
  Interface            IP-Address      OK? Method Status                Protocol
  Vlan1                  192.168.1.26    YES NVRAMup                  up
  GigabitEthernet0/1   unassigned      YES unsetup                  up
  GigabitEthernet0/2   unassigned      YES unsetup                  up
  GigabitEthernet0/3   unassigned      YES unsetup                  up
  GigabitEthernet0/4   unassigned      YES unsetup                  up
  GigabitEthernet0/5   unassigned      YES unsetup                  up
  GigabitEthernet0/6   unassigned      YES unsetup                  up
  GigabitEthernet0/7   unassigned      YES unsetup                  up
  GigabitEthernet0/8   unassigned      YES unsetdown                  down
  GigabitEthernet0/9   unassigned      YES unsetup                  up
  GigabitEthernet0/10    unassigned      YES unsetup                  up
  GigabitEthernet0/11    unassigned      YES unsetup                  up
  GigabitEthernet0/12    unassigned      YES unsetup                  up
  GigabitEthernet0/13    unassigned      YES unsetup                  up
  GigabitEthernet0/14    unassigned      YES unsetup                  up
  GigabitEthernet0/15    unassigned      YES unsetdown                  down
  GigabitEthernet0/16    unassigned      YES unsetup                  up
  6.查看交换机负载情况,CPU和内存
  命令: #show processcpuhistory,    #show processcpu
  例如:
  #show processes cpu history
  11111
  8877777888887777788888999955555888888888888888888887777777
  100
  90
  80
  70
  60
  50
  40
  30
  20                           *****
  10 **********************************************************
  0....5....1....1....2....2....3....3....4....4....5....5....
  0    5    0    5    0    5    0    5    0    5
  CPU% per second (last 60 seconds)
  1111111111111111111111111111191111111111111111111111111112
  5454546354554555555556455455514337477541455662653555551523
  100
  90                              *
  80                              *
  70                              *
  60                              *
  50                              *
  40                              *
  30                              *
  20 * * * * * ** ********* ** ***#   * ***   **** ** ***** * *
  10 ##########################################################
  0....5....1....1....2....2....3....3....4....4....5....5....
  0    5    0    5    0    5    0    5    0    5
  CPU% per minute (last 60 minutes)
  * = maximum CPU%   # = average CPU%
  9222233432542422333826253333326552732124352252464332235343333343474254
  1886747505513759105071948496491379776963772006608223868735484931072202
  100
  90 *
  80 *                  *            *                              *
  70 *                  *            *                              *
  60 *         *      * *      * * *      *   *      *          *
  50 *      ***   * * *      *** *      ** ***   *          **
  40 *   **** *    ** * ** ***** **   **** ***    ***** * ** *** **
  30 ************ ************************ *********** *************** **
  20 **********************************************************************
  10 ######################################################################
  0....5....1....1....2....2....3....3....4....4....5....5....6....6....7.
  0    5    0    5    0    5    0    5    0    5    0    5    0
  CPU% per hour (last 72 hours)
  * = maximum CPU%   # = average CPU%
页: [1]
查看完整版本: Cisco实用命令笔记(适合网管)