欢迎来到天天文库
浏览记录
ID:40888138
大小:15.16 KB
页数:5页
时间:2019-08-09
《路由交换命令总结》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、路由交换命令总结 「基础配置」 进入console口进行本地配置用户模式xx>enablen特权模式xx#configureterminal全局配置模式xx(config)#interface[f
2、s]n/m进入接口配置模式xx(config-if)# 进入(子)接口模式后配置IP(config-if)#ipaddrA.B.C.D子网掩码激活接口(config-if)#noshutdown配置速度(config-if)#speed{auto
3、10
4、100}配置接口工作模式(config-if)#duplex{auto
5、half
6、f
7、ull}配置时钟(串行口DCE端) (config-if)#clockraten反向操作(删除配置) no+命令在换回接口上配多个ip(config-if)#ipaddrA.B.C.D子网掩码(config-if)#ipaddrA.B.C.D子网掩码secondary查看所有配置#showrunning-config 路由器关闭路由功能充当主机(config)#noiprouting为路由器设置网关(config)#ipdefault-gatewayip地址 改机器名字(config)#hostnameyy控制线路超时(conf
8、ig)#linen(config-line)#exec-timeout00关闭域名解析功能(config)#noipdomain-lookup开启路由器http功能(config)#iphttpserver(config)#usernamexxxpasswordyyy(config)#usernamexxxsecretyyy(config)#enablesecretyyy启用密码加密服务(config)#servicepassword-encryptionyyy开启路由器https功能(config)#iphttpsecure-serv
9、er开启路由器远程登录功能(config)#linevty04(config)#loginlocal或者(config)#nologin(config)#enablen登录时使用命令telnetA.B.C.D 「交换机」 查看mac地址表#showmac-address-table绑定静态mac地址(config)#mac-address-tablestaticH.H.Hvlanninterfacefx/x#showarp在主机上使用arp-a查看arp信息开启交换机端口安全(防止连接主机恶意发送随机mac填满mac地址表) (c
10、onifg)#switchportport-security(conifg)#switchport? #showport-securityintfx/x恢复(config)#errdisablerecovery 为交换机vlan1配置管理ip(conifg)#intvlan1(config-if)#ipaddrA.B.C.D子网掩码(config-if)#noshut 「交换机vlan」 查看vlan#showvlan-switch或是#showvlan创建vlan#vlandatabase(vlan)#vlann将端口加入到v
11、lan中(config-if)#switchportaccessvlann给允许多个vlan的接口打trunk(config-if)#switchportmodetrunk 「单臂路由vlan」 路由器上配置子接口实现不同vlan之间通信,先必须激活其父接口,另外IP不允许重复(config)#interfacefx/x.x(config-subif)#encapsulationdot1qvlan-id(config-subif)#ipaddrA.C.D.E子网掩码(config-subif)#noshut 「使用三层交换机交换虚
12、拟接口」 交换机上配置虚拟交换接口实现不同vlan之间通信,先必须在交换机上添加对应vlan(config)#intvlann(config-if)#ipaddrA.B.C.D子网掩码(config-if)#noshut在删除时,务必先删除交换虚拟接口,再删对应vlan 「VTP」 配置VTP模式#vlandatabase(vlan)#vtp{server
13、client
14、transparent}只有域名和密码完全一样的路由器之间才能同步vlan信息(vlan)#vtpdomain<域名>(vlan)#vtppassword<密码>
15、打开VTP裁剪(vlan)#vtppruning退出激活(vlan)#exit 「端口聚合」 创建R1(config)#interfaceport-channel1(config-if)#switchp
此文档下载收益归作者所有