nidr 发表于 2018-7-11 12:37:32

cisco设备的基础命令


  switch>#用户模式,此模式操作权限最低,只可以调试部分简单的命令
  switch>enable #通过命令 enable 切换到特权模式
  switch# #特权模式,此模式操作权限自动提升,支持比用户模式更多的命令
  switch#configure terminal #通过 configure terminal 命令切换至全局模式
  switch(config)# #全局模式,支持更多的操作操作
  switch(config)#route rip #通过 route 命名可进入路由协议模式
  sw2(config)#router#路由器的协议模式
  bgp Border Gateway Protocol (BGP)
  eigrp Enhanced Interior Gateway Routing Protocol (EIGRP)
  isis ISO IS-IS
  iso-igrp IGRP for OSI networks
  mobile Mobile routes
  odr On Demand stub Routes
  ospf Open Shortest Path First (OSPF)
  rip Routing Information Protocol (RIP)
  switch(config)#exit #可通过 exit 命令,退出协议模式,返回全局模式
  switch(config)#
  switch(config)#hostname sw-1 #修改路由器的名称
  sw-1(config)#
  sw-1(config)#interface ethernet 1/0 #进入接口模式
  sw-1(config-if)#ip address 1.1.1.1 255.255.255.0 #接口模式,配置接口 e1/0 IP 地址为1.1.1.1
  sw-1(config-if)#no shutdown #激活接口
  sw2(config)#interface ethernet 1/0 #进入接口模式
  sw2(config-if)#ip address 1.1.1.2 255.255.255.0 #接口模式,配置接口 e1/0 IP 地址为1.1.1.2
  sw2(config-if)#no shut
  sw2(config-if)#exit
  *Mar 1 00:03:25.259: %LINK-3-UPDOWN: Interface Ethernet1/0, changed state to up
  *Mar 1 00:03:26.259: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet1/0, changed state to up
  sw2(config)#do ping 1.1.1.1
  Type escape sequence to abort.
  Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
  .!!!!
  Success rate is 80 percent (4/5), round-trip min/avg/max = 52/73/96 ms
  sw2(config)#
  以下命令在初始配置路由器和交换机时,建议配上:
  ***********************************************************************************
  switch(config)#no ip domain-lookup #取消路由器的域名解析
  switch(config)#line console 0 #进入console接口
  switch(config-line)#exec-timeout 0 0 #取消console配置界面超时
  switch(config-line)#logging synchronous #取消同步日志
  switch(config)#line vty 0 4 #进入 vty 接口
  switch(config-line)#exec-timeout 0 0 #取消 vty 配置界面超时
  switch(config)#hostname sw-1 #修改路由器的名称
  switch#copy running-config startup-config #保存当前的配置
  switch#copy startup-config running-config #将NVRAM中的文件调用至RAM中
  switch(config)#service password-encryption #加密所有密码
  ***********************************************************************************
  基本的查看命令:
  ***********************************************************************************
  show 是静态的查看路由器和交换机的配置
  switch#show ip interface brief #查看当前路由器所有接口的简单信息
  switch#show interfaces fastEthernet 0/0 #查看 f0/0 接口的信息
  switch#show ip route #查看路由表
  switch#show arp #查看ARP表项
  switch#show running-config #查看当前配置文件 (保存在RAM中)
  switch#show startup-config #查看保存在NVRAM中的文件
  sw1#show ip interface brief#查看接口物理层、数据链路层、网络层信息
  Interface IP-Address OK? Method Status Protocol
  Serial0/0 unassigned YES unset administratively down down
  Serial0/1 unassigned YES unset administratively down down
  Serial0/2 unassigned YES unset administratively down down
  Serial0/3 unassigned YES unset administratively down down
  Ethernet1/0 1.1.1.1 YES manual up up
  Ethernet1/1 unassigned YES unset administratively down down
  Ethernet1/2 unassigned YES unset administratively down down
  Ethernet1/3 unassigned YES unset administratively down down
  原文出处: http://www.itom.net.cn/305/.html
页: [1]
查看完整版本: cisco设备的基础命令