设为首页 收藏本站
查看: 1541|回复: 0

[经验分享] Cisco路由器及交换机口令集合

[复制链接]

尚未签到

发表于 2018-7-20 11:41:19 | 显示全部楼层 |阅读模式
  交换机口令设置:
  switch>enable ;进入特权模式
  switch#config terminal ;进入全局配置模式
  switch(config)#hostname ;设置交换机主机名
  switch(config)#enable secret xxx ;设置特权加密口令为xxx
  switch(config)#enable password xxx ;设置特权非密口令为xxx
  switch(config)#line console 0 ;进入控制口(Rs232)初始化
  switch(config-line)#line vty 0 4 ;进入虚拟终端virtual tty
  switch(config-line)#login ;允许登录
  switch(config-line)password xx ;设置登录口令xx
  switch#exit ;返回命令
  交换机VLAN设置:
  switch#vlan database ;进入VLAN设置
  switch(vlan)#vlan 2 ;建VLAN 2
  switch(vlan)#no vlan 2 ;删VLAN 2
  switch(config)#int f0/1 ;进入端口1
  switch(config-if)#switchport access vlan 2 ;当前端口1加入VLAN 2
  switch(config-if)#switchport mode trunk ;设置为干线
  switch(config-if)#switchport trunk allowed vlan 1,2 ;设置允许的VLAN
  switch(config-if)#switchport trunk encap dot1q ;设置VLAN中继
  switch(config)#vtp domain ;设置VTP域名
  switch(config)#vtp password
  switch(config)#vtp mode server
  switch(config)#vtp mode client
  交换机设置IP地址:
  switch(config)#interface vlan 1 ;进入VLAN 1
  switch(config-if)#ip address ;添加远程登录IP
  switch(config)#ip default-gateway ;添加默认网关
  switch#dir flash ;查看内存
  交换机显示命令:
  switch#write ;写入保存
  switch#show vtp
  switch#show run ;查看当前配置信息
  switch#show vlan ;看VLAN
  switch#show interface ;查看所有端口信息
  switch#show int f0/0 ;显示端口0的信息
  路由器显示命令:
  router#show run ;显示接口
  router#show interface ;显示接口
  router#show ip route ;显示路由
  touter#show cdp nei ;看邻居
  router#reload ;重新启动
  设置口令:
  router>enable ;进入特权模式
  router#config terminal ;进入全局配置模式
  router(config)#hostname ;设置交换机的主机名
  router(config)#enable secret xxx ;设置特权加密口令为xxx
  router(config)#enable password xxx ;设置特权非密口令为xxx
  router(config)#line console 0 ;进入控制台(Rs232)初始化
  router(config-line)#line vty 0 4 ;进入虚拟终端virtual tty
  router(config-line)#login ;允许登录
  router(config-line)password xx ;设置登录口令xx
  router(config)#(Ctrl+z) ;返回特权模式
  switch#exit ;返回命令
  配置IP地址:
  router(config)#int s0/0 ;进行串serail接口
  router(config-if)#no shutdown ;启动接口
  router(config-if)#clock rate 6400 ;设置时钟
  router(config-if)#ip address 10.1.1.1 255.255.0.0 ;设置IP地址和子网掩码
  router(config-if)#ip add 10.1.1.2 255.255.0.0 second
  router(config-if)#int f0/0.1 ;进入子接口
  router(config-subif.1)#ip address
  router(config-subif.1)#encapsulation dot1q
  router(config)#config-register 0x2142 ;跳过配置文件
  router(config)#config-register 0x2102 ;正常使用配置文件
  router#reload ;重新引导
  复制操作:
  router#copy running-config starup-config ;存配置
  router#copy running-config tftp ;上载
  router#copy startup-config tftp
  router#copy tftp flash: ;特权模式下升级IOS
  router#copy tftp startup-config ;下载配置文件到nvram
  ROM状态:
  Ctrl+Break ;进入ROM监控状态
  rommon>confreg 0x2142 ;跳过配置,26 36 45xx
  rommon>confreg 0x2102 ;使用配置,恢复工作状态
  rommon>reset ;重新引导,等效于重新开机
  rommon>copy xmodem: flash ;从console升级IOS
  IOS:
  rommon>IP_ADDRESS=10.65.1.2
  rommon>IP_SUNNET_MASK=255.255.0.0
  rommon>TFTP_SERVER=10.65.1.1
  rommon>TFTP_FILE=c2600.bin
  rommon>tftpdnld
  rommon>dir flash:
  rommon>boot
  静态路由:
  ip toute
  例:
  router(config)#ip toute 10.1.0.0 255.255.0.0 10.2.1.1
  router(config)#ip route 0.0.0.0 0.0.0.0 1.1.1.2
  动态路由:
  router(config)#ip routing ;启动路由
  router(config)#router rip ;启动RIP路由协议
  router(config-router)#network ;配置范围,有的支持all
  router(config-router)#negihbor ;点对点
  帧中继命令:
  router(config)#frame-relay switching ;使能帧中继交换
  router(config-s0)#encapsulation frame-relay ;使能帧中继
  router(config-s0)#frame-relay intf-type DCE ;DCE端(需要配虚电路)
  touter(config-s0)#farme-relay local-dlci 20 ;配置虚电路号
  基本访问控制列表:
  router(config)#access-list permit|deny
  router(config)#interface ;default:deny any
  router(config-if)#ip access-group in|out ;default:out
  例:
  RB(config)#access-list 4 permit 10.8.1.1
  RB(config)#access-list 4 deny 10.8.1.0 0.0.0.255
  RB(config)#access-list 4 permit 10.8.0.0 0.0.255.255
  RB(config)#access-list 4 deny 10.0.0.0 0.255.255.255
  RB(config)#access-list 4 permit any
  RB(config)#int f0/0
  RB(config-if)#ip access-group 4 in
  扩展访问列表:
  access-list permit|deny icmp [port]
  例1:
  router(config)#access-list 101 deny icmp any 10.64.0.2 0.0.0.0 echo
  router(config)#access-list 101 permit ip any any
  router(config)#int s0/0
  router(config-if)#ip access-group 101 in
  例2:
  router(config)#access-list 102 deny tcp any 10.65.0.2 0.0.0.0 eq 80
  router(config)#access-list 102 permit ip any any
  router(config)#interface s0/1
  router(config-if)#ip access-group 102 out
  router(config)#no access-list 102
  router(config-if)#no ip access-group 101 in
  在路由器上设置SNMP Community Strings:
  router(config)#snmp-server community read-community-string ro
  router(config)#snmp-server community write-community-string rw
  在交换机上设置SNMP Community Strings:
  switch(config)#snmp-server community read-community-strings ro
  switch(config)#snmp-server community write-community-strings rw
  在路由器上配置日志信息(Syslog Message logging):
  router(config)#logging on
  router(config)#logging server-ip-address
  router(config)#logging trap serverity-level
  路由器恢复出厂设置
  erase start-config
  或write erase
  或erase NVROM

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-539149-1-1.html 上篇帖子: Cisco交换机的密码回复 下篇帖子: cisco packet tracer实验案例-重置路由器ENABLE特权密码
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表