欢迎来到天天文库
浏览记录
ID:37513325
大小:76.00 KB
页数:20页
时间:2019-05-24
《CISCO交换机和路由器基本配置》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、一CISCO交换机和路由器基本配置交换机的配置1用户模式switch>2进入特权模式switch>enable 3进入全局配置模式,全局模式的配置对整个交换机生效.switch#configterminal switch(config)#4进入接口模式,配置只对当前的接口生效switch(config)#interfacef0/1 switch(config-if)#进入line模式,这个模式主要用来对控制台做相应的配置5switch(config)#lineconsole0switch(config-
2、line)6配置主机名switch(config)#hostname主机名7配置使能口令switch(config)#enablepassword密码8配置加密使能口令switch(config)#enablesecret密码9配置ip地址switch(config)#interfacevlan1switch(config)#ip addip地址子网掩码switch(config)#noshutdown10配置交换机的网关switch(config)#ipdefault-gatewayip地址11保存配置s
3、witch#copyruning-configstartup-configswitch#write12清空配置switch#erasestartup-config13清空接口配置switch(config)#interfacef0/1switch(config-if)#defaultinterfacef0/114清空交换机密码(1)关闭电源.(2)开启电源,并且按住交换机的mode键,当交换机进入.........................................................
4、....... flash_init load_helper bootswitch:(3)在switch后执行flash_init命令switch:flash-init(4)在查看flash中的文件switch:dirflash:/(5)把config.text文件后缀名改了就可以,并且重新启动.(交换机重启后不会在读取配置文件了)switch:renameflash:config.textconfig.oldswitch:boot(6)启动后进入特权模式查看flash里面的文件,并且
5、把config.text文件改回来.并且把flash里面的文件复制到内存中switch#renameflash:config.oldflash:config.textswitch#copystartup-configrunning-config15创建vlan2switch(config)#vlan216删除vlan2switch(config)#novlan217把端口f0/5到10添加到vlan2switch(config)#interfacerangef0/5-10switch(config)#swit
6、chportaccessvlan218将f0/1设置成中trunkswitch(config)#interfacef0/1switch(config)#switchportmodetrunk19将f0/1设置成期望型或自动型switch(config)#switchportdynamicdesirable/auto20如果不需要trunk传送vlan2的数据,可以将vlan2从trunk中删除.switch(config)#interfacef*/* (trunk接口)switch(cofnig-if)#s
7、witchprottrunkallowedvlanremovevlan221也可以添加vlan2switch(config)#interfacef*/* (trunk接口)switch(config)#switchprottrunkallowedvlanaddvlan2二交换机的查看命令switch#showmac-address-table 查看本机的mac地址表switch#showcdpneighbors 列出与本设备相连的cisco设备switch#showrunning-config查看交换
8、机的配置switch#showvlanbrief 查看vlan的详细信息switch#show Internet trunk可以查看生成树协议三路由器配置命令1配置默认路由route(config)#iproute0.0.0.00.0.0.0下一跳2配置静态路由route(config)#iproute目的ip子网掩码下一跳3对所有密码进行加密route(config)#enable pa
此文档下载收益归作者所有