cisco技术

switch> 用户模式   
switch>enable
switch# 特权模式(进入这个模式enable 简写en)
特权模式,查看设备配置信息 show 命令
Switch(config)# interface f0/1 进入接口模式配置
Switch(config-if)#可对 f0/1 进行配置
end 直接返回到特权模式


技巧:
Switch(config)#no ip domain-lookup 取消域名查询
在全局配置设置以上命令,用于防止出错时终端被占用。
? 在你不知道输入什么的时候 就输入? 有提示信息
ctrl+shift+6 取消域名查询


局域网 lan 虚拟   Virtual
Virtual Local Area Network 虚拟局域网
简称:vlan


创建vlan在特权模式中
switch#> vlan databases
switch#> vlan 100 名称为100
switch#> vlan 200 名称为200
进入到全局配置中
Switch(config)#vlan 300
Switch(config)#vlan 400
两种没有区别都一样


加入vlan的操作
Switch(config)#interface f0/1 进入的这个接口
Switch(config-if)#switchport access vlan 100


查看vlan
Switch(config-if)# do show vlan brief (显示简要的vlan信息)
switch#show vlan
Switch(config)# do show vlan (在全局配置中要查看,前面加个do)


进入特权模式需要密码操作名字是:
全局设置模式里面(明文密码)
switch>enable
switch#>configure terminal
Switch(config)#enable password 123
show runing-config(查看密码)
Switch(config)#enable secret 123(密码)(设置密文密码)
Switch(config)#no enable password (去掉那个名文的密码)


设置telnet远程登陆|修改密码变成密文的
vty(虚拟控制台)
Switch(config)#line vty 0 4(虚拟控制台线路0到4,差不多有五个人可以telnet链接我这台交换机)
Switch(config-line)#password 123 (telnet的密码)
Switch(config-line)# login (让通过密码验证的用户可以登录我这台交换机上,) login local  (设置远程登录使用本地用户名和密码)
Switch(config)#service password-encryption (telnet密码加密) telnet 23端口

 


设置交换机的ip地址
Switch(config-if)#interface vlan 1(进入vlan中设置ip)
Switch(config-if)#ip address 192.168.10.1 255.255.255.0(设置ip地址,跟网段)
Switch(config-if)#no shutdown(不关闭的)


保存配置文件
Switch#copy runing-config startup-config(把当前的配置文件保存下来,下次开机自动读取)


修改主机名字
Switch(config)#hostname sw1 (设置交换机的主机名称)


————二层交换机操作————
两口进行trunk操作
Switch(config)#interface f0/3
Switch(config-if)#switchport mode trunk(两个交换机都需要同时设置需要trunk的口)


————三层交换机操作————
两口进行trunk操作
Switch(config)#interface f0/3
Switch(config-if)#switchport trunk encapsulation dot1q
Switch(config-if)#switchport mode trunk


    
vtp技术
设置一台交换机,其它的都会变成一样,这种技术叫做vtp
Switch#configure terminal
Switch(config)#interface f0/2
Switch(config-if)#switchport mode trunk (两台交换机都需要进行trunk)
Switch(config)#vtp domain cjk (给domain起一个cjk的名字)(创建vtp域)
Switch(config)#vlan 100(测试)
Switch(config)#vlan 200(测试)


———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————    
osi七层模型干什么的(Open System Interconnect 简称OSI)
答案:开放系统互连参考模型,是国际标准化组织(ISO)和国际电报电话咨询委员会(CCITT)联合制定的开放系统互连参考模型,为开放式互连信息系统提供了一种功能结构的框架。
它从低到高分别是:物理层、数据链路层、网络层、传输层、会话层、表示层和应用层。

7/应用层 (Application)[??pl?'ke??(?)n][爱泼累count神]
    协议有:HTTP FTP TFTP SMTP SNMP DNS TELNET HTTPS POP3 DHCP
    
6/表示层(Presentation Layer) [prez(?)n'te??(?)n][泼神忒神 烈儿]
    数据的表示、安全、压缩。(在五层模型里面已经合并到了应用层)
    格式有,JPEG、ASCll、DECOIC、加密格式等 加密 解密 转码 解码
    
5/会话层(Session Layer)
    建立、管理、终止会话。(在五层模型里面已经合并到了应用层)
    对应主机进程,指本地主机与远程主机正在进行的会话
    
4/传输层 (Transport) [tr?n'sp??t; trɑ?n-][穿丝破t]
    定义传输数据的协议端口号,以及流控和差错校验。
    协议有:TCP UDP,数据包一旦离开网卡即进入网络传输层
    
3/网络层 (Network)
    进行逻辑地址寻址,实现不同网络之间的路径选择。封装ip地址
    协议有:ICMP IGMP IP(IPV4 IPV6) ARP RARP
    
2/数据链路层 (Link)
    建立逻辑连接、进行硬件地址寻址、差错校验[2]  等功能。(由底层网络定义协议)封装mac地址  ARP广播
    将比特组合成字节进而组合成帧,用MAC地址访问介质,错误发现但不能纠正。

1/物理层(Physical Layer)['f?z?k(?)l] [飞c口]
    建立、维护、断开物理连接。(由底层网络定义协议)

———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————  
cisco技术命令

cisco交换机一直vty有人占用怎么踢掉
#sh line                查看登陆情况
r#clear line vty [对应数字]    踢掉对应线路号
tty: 登陆类型
vty:telnet方式登陆的
con:colsole连接登陆的    



    cisco交换机常用命令

   switch>enable 进入特权模式

  switch#config terminal 进入全局配置模式

  switch(config)#hostname 设置交换机的主机名

  switch(config)#enable secret xxx 设置特权加密口令

  switch(config)#enable password xxa 设置特权非密口令

  使用Telnet远程式管理

  switch(config)#interface vlan 1 进入vlan 1

  switch(config-if)#ip address 设置IP地址

  switch(config-if)#ip default-gateway 设置默认网关

  switch(config)#line vty 0 4 进入虚拟终端

  switch(config-line)#login local 允许本地用户登录

  switch(config-line)#password xx 设置登录口令

  switch#exit 返回命令

  控制台口令

  switch(config)#line console 0 进入控制台口
  switch(config)#login 允许登陆
  switch(config-line)#login local 允许本地用户登录

  switch(config-line)#password xx 设置登录口令

  switch#exit 返回命令

  基本接口配置

  switch(config)#interface f0/1 进入f0/1接口

  switch(config-if)#duplex full 配置全双工模式

  switch(config-if)#speed 100 配置速率

  switch(config-if)#description to ***** 接口描述

  switch(config)#ip domain-name ***.com 设置或名服务器

  switch(config)#mac-address-table aging-time 设置mac表超时时间

  switch#write 保存配置信息

  switch#copy running-config startup-config 保存当前配置nvram

  switch#erase startup-config 清除配置文件

  交换机VLAN设置:

  switch#vlan database 进入VLAN设置

  switch(vlan)#vlan 2 建VLAN 2

  switch(vlan)#name 名字 建VLAN 2的名称

  switch(vlan)#no vlan 2 删vlan 2

  注:删除vlan时原属于此vlan的端口处于非激活状态,直到重新分配为止

  switch(config)#int f0/1 进入端口1

  switch(config-if)#switchport mode access 当前端口工作莫试

  switch(config-if)#switchport access vlan 2 当前端口加入vlan 2

  switch(config-if)#switchport mode trunk 设置为干线

  switch(config-if)#switchport trunk encapsulation dot1q 设置vlan 中继协议

  switch(config-if)#no switchport mode 或 ( switchport mode access) 禁用干线

  switch(config-if)#switchport trunk allowed vlan add 1,2 ;从Trunk中添加vlans

  switch(config-if)#switchport trunk allowed vlan remove 1,2 ;从Trunk中删除vlans

  switch(config-if)#switchport trunk pruning vlan remove 1,2 ;从Trunk中关闭局部修剪

  以太网通道配置

  switch(config)#interface range fasternet0/1 - 2 将fasternet0/1和0/2 口捆绑 (成双不成单)

  switch(config-if)#channel-group 1 mode on 配置以太通道模式

  switch(config-if)#port-channel load-balance {dst-mac | src-mac}在链路间实现负载均衡

  switch#show etherchannel 1 summary 查看通道信息

  switch#show etherchannel load-balance 查看通道信息

  vtp配置

  switch(config)#vtp domain 设置vtp域名

  switch(config)#vtp password 设置vtp密码

  switch(config)#vtp mode server 设置vtp服务器模式

  switch(config)#vtp mode client 设置vtp客户机模式

  switch(config)#vtp mode transparent 设置vtp 透明模式

  switch(config)#vtp version 设置vtp版本

  switch(config)#vtp pruning 启用vtp修解

  switch(config)#no vtp pruning 关闭vtp修解

  注:要想从vtp中减少一台交换机只需将该交换机vtp 名更改

  生成树stp:

  switch(config)#spanning-tree vlan 启用stp生成树(基于vlan)

  switch(config)#spanning-tree vlan root primary 指定根交换机(基于vlan)

  switch(config)#spanning-tree vlan root secondary 指定备用根交换机(基于vlan)

  switch(config)#spanning-tree vlan priority 指定交换机优先级(基于vlan)

  switch(config)#no spanning-tree vlan priority 将交换机的优先级恢复默认值(基于vlan)

  switch(config-if)#spanning-tree vlan cost 指定端口成本(起用trunk的端口模式下)

  switch(config-if)#spanning-tree vlan port-prioty 指定交换机端口优先级(基于vlan)

  switch(config-if)#spanning-tree portfast 配置速端口(连接终端设备的端口状态)如pc机

  switch(config)#spanning-tree uplinkfast 配置上行速端口

  注:在配置上行速端口前要先将基于vlan上的网桥优先级,网桥成本恢复默认值。起用了该命令后在进行优先级更改,

  switch(config)#spanning-tree vlan hello-time 配置交换机hello时间(基于vlan)

  switch(config)#spanning-tree vlan forward-time 修改转发延迟计时器(基于vlan)

  switch(config)#spanning-tree vlan max-time 修改最大老化时间(基于vlan)

  注:vlan为可选参数,当没有该参数时将修改所有vlan网桥的优先级及所有的vlan端口成本

  switch#show spanning-tree summery 检测vlan生成树配置

  switch#show spanning-tree vlan detail 浏览详细生成树配置信息

  switch#show spanning-tree interface detail 浏览详细生成树端口配置信息

  交换机显示命令:

  switch#show vtp status 查看vtp配置信息

  switch#show running-config 查看当前配置信息

  switch#show vlan 查看vlan配置信息

  switch#show interface 查看端口信息

  switch#show int f0/0 查看指定端口信息

  switch#dir flash: 查看闪存

  switch#show version 查看当前版本信息

  switch#show mac-address-table aging-time 查看mac超时时间

  switch#show cdp cisco设备发现协议 (可以查看聆接设备)

  switch#show cdp traffic 杳看接收和发送的cdp包统计信息

  switch#show cdp neighbors 查看与该设备相邻的cisco设备

  switch#show interface f0/1 switchport 查看有关switchport的配置

  switch#show cdp neighbors 查看与该设备相邻的cisco设备



  二:路由器


 查看配置信息用show命令,该命令可以在用户模式和特权模式下执行,且在特权模式下看到的信息比用户模式多。show命令很多,常用的有:

  1、查看运行配置文件:

  Router#show running-config

  运行配置文件running-config位于路由器的RAM中,存放的是路由器当前使用的配置信息。

  2、查看启动配置文件:

  Router#show startup-config

  启动配置文件startup-config位于路由器的NVRAM中,可以长期保存。它在启动路由器时装入RAM,成为running-config。

  3、查看路由器的版本信息:

  Router#show version

  4、查看路由器的接口状态:

  Router#show ip interface brief

  如果接口状态标识为“Down”,表示此接口未激活,如果标识为“Up”,表示此接口已经激活。

  5、查看路由表:

  Router#show ip route

  通过路由表可以看出该路由器已经识别的网络。

  6、查看NAT翻译情况:

  Router#show ip nat translation

 

posted on 2019-09-10 09:48  I我非柠檬为何心酸I  阅读(242)  评论(0编辑  收藏  举报