2022年Cisco路由器交换机配置命令详解 .pdf

上传人:C****o 文档编号:32490992 上传时间:2022-08-09 格式:PDF 页数:11 大小:162.78KB
返回 下载 相关 举报
2022年Cisco路由器交换机配置命令详解 .pdf_第1页
第1页 / 共11页
2022年Cisco路由器交换机配置命令详解 .pdf_第2页
第2页 / 共11页
点击查看更多>>
资源描述

《2022年Cisco路由器交换机配置命令详解 .pdf》由会员分享,可在线阅读,更多相关《2022年Cisco路由器交换机配置命令详解 .pdf(11页珍藏版)》请在得力文库 - 分享文档赚钱的网站上搜索。

1、1. 交换机支持的命令:交换机基本状态:switch: ;ROM 状态, 路由器是 rommon hostname ;用户模式hostname# ;特权模式hostname(config)# ;全局配置模式hostname(config-if)# ;接口状态交换机口令设置:switchenable ;进入特权模式switch#config terminal ;进入全局配置模式switch(config)#hostname ;设置交换机的主机名switch(config)#enable secret xxx ;设置特权加密口令switch(config)#enable password xxa

2、;设置特权非密口令switch(config)#line console 0 ;进入控制台口switch(config-line)#line vty 0 4 ;进入虚拟终端switch(config-line)#login ;允许登录switch(config-line)#password xx ;设置登录口令 xx switch#exit ;返回命令交换机 VLAN 设置:名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 1 页,共 11 页 - - - - - - - - - sw

3、itch#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 ;当前端口加入 vlan 2 switch(config-if)#switchport mode trunk ;设置为干线switch(config-if)#switchport trunk allowed vlan 1,2 ;设置允许的 vlan switch(c

4、onfig-if)#switchport trunk encap dot1q ;设置 vlan 中继switch(config)#vtp domain ;设置发 vtp 域名switch(config)#vtp password ;设置发 vtp 密码switch(config)#vtp mode server ;设置发 vtp 模式switch(config)#vtp mode client ;设置发 vtp 模式交换机设置IP 地址:switch(config)#interface vlan 1 ;进入 vlan 1 switch(config-if)#ip address ;设置 IP

5、地址switch(config)#ip default-gateway ;设置默认网关switch#dir flash: ;查看闪存交换机显示命令:switch#write ;保存配置信息名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 2 页,共 11 页 - - - - - - - - - switch#show vtp ;查看 vtp 配置信息switch#show run ;查看当前配置信息switch#show vlan ;查看 vlan 配置信息switch#show in

6、terface ;查看端口信息switch#show int f0/0 ;查看指定端口信息2. 路由器支持的命令:路由器显示命令:router#show run ;显示配置信息router#show interface ;显示接口信息router#show ip route ;显示路由信息router#show cdp nei ;显示邻居信息router#reload ;重新起动路由器口令设置:routerenable ;进入特权模式router#config terminal ;进入全局配置模式router(config)#hostname ;设置交换机的主机名router(config)#

7、enable secret xxx ;设置特权加密口令router(config)#enable password xxb ;设置特权非密口令router(config)#line console 0 ;进入控制台口router(config-line)#line vty 0 4 ;进入虚拟终端名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 3 页,共 11 页 - - - - - - - - - router(config-line)#login ;要求口令验证router(con

8、fig-line)#password xx ;设置登录口令 xx router(config)#(Ctrl+z) ; 返回特权模式router#exit ;返回命令路由器配置:router(config)#int s0/0 ;进入 Serail接口router(config-if)#no shutdown ;激活当前接口router(config-if)#clock rate 64000 ;设置同步时钟router(config-if)#ip address ;设置 IP 地址router(config-if)#ip address second ;设置第二个IP router(config-

9、if)#int f0/0.1 ;进入子接口router(config-subif.1)#ip address ;设置子接口 IP router(config-subif.1)#encapsulation dot1q ;绑定vlan 中继协议router(config)#config-register 0 x2142 ;跳过配置文件router(config)#config-register 0 x2102 ;正常使用配置文件router#reload ;重新引导路由器文件操作:router#copy running-config startup-config ;保存配置名师资料总结 - - -

10、精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 4 页,共 11 页 - - - - - - - - - router#copy running-config tftp ;保存配置到 tftp router#copy startup-config tftp ;开机配置存到 tftp router#copy tftp flash: ;下传文件到 flash router#copy tftp startup-config;下载配置文件ROM 状态:Ctrl+Break ;进入 ROM 监控状态rommoncon

11、freg 0 x2142 ;跳过配置文件rommonconfreg 0 x2102 ;恢复配置文件rommonreset;重新引导rommoncopy xmodem: flash: ;从 console 传输文件rommonIP_ADDRESS=10.65.1.2 ;设置路由器IP rommonIP_SUBNET_MASK=255.255.0.0 ;设置路由器掩码rommonTFTP_SERVER=10.65.1.1 ;指定 TFTP 服务器 IP rommonTFTP_FILE=c2600.bin ;指定下载的文件rommontftpdnld ;从 tftp 下载rommondir flas

12、h: ;查看闪存内容rommonboot ;引导 IOS 静态路由:ip route ;命令格式router(config)#ip route 2.0.0.0 255.0.0.0 1.1.1.2 ;静态路由举例router(config)#ip route 0.0.0.0 0.0.0.0 1.1.1.2 ;名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 5 页,共 11 页 - - - - - - - - - 默认路由举例动态路由:router(config)#ip routing

13、;启动路由转发router(config)#router rip ;启动 RIP 路由协议。router(config-router)#network ;设置发布路由router(config-router)#negihbor ;点对点帧中继用。帧中继命令:router(config)#frame-relay switching ;使能帧中继交换router(config-s0)#encapsulation frame-relay ;使能帧中继router(config-s0)#fram-relay lmi-type cisco ;设置管理类型router(config-s0)#frame-r

14、elay intf-type DCE ;设置为 DCE router(config-s0)#frame-relay dlci 16 ;router(config-s0)#frame-relay local-dlci 20 ;设置虚电路号router(config-s0)#frame-relay interface-dlci 16 ;router(config)#log-adjacency-changes ;记录邻接变化router(config)#int s0/0.1 point-to-point ;设置子接口点对点router#show frame pvc ;显示永久虚电路router#sh

15、ow frame map ;显示映射名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 6 页,共 11 页 - - - - - - - - - 基本访问控制列表:router(config)#access-list permit|deny router(config)#interface ;default:deny any router(config-if)#ip access-group in|out ;default:out 例 1:router(config)#access-li

16、st 4 permit 10.8.1.1 router(config)#access-list 4 deny 10.8.1.0 0.0.0.255 router(config)#access-list 4 permit 10.8.0.0 0.0.255.255 router(config)#access-list 4 deny 10.0.0.0 0.255.255.255 router(config)#access-list 4 permit any router(config)#int f0/0 router(config-if)#ip access-group 4 in 扩展访问控制列表:

17、access-list permit|deny icmp type access-list permit|deny tcp port 例 3: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 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 7 页,共 11

18、 页 - - - - - - - - - router(config-if)#ip access-group 101 in 例 3: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 r

19、outer(config-if)#no ip access-group 101 in 路由器的 nat 配置Router(config-if)#ip nat inside ;当前接口指定为内部接口Router(config-if)#ip nat outside ;当前接口指定为外部接口Router(config)#ip nat inside source static p port Router(config)#ip nat inside source static 10.65.1.2 60.1.1.1 Router(config)#ip nat inside source static tc

20、p 10.65.1.3 80 60.1.1.1 80 Router(config)#ip nat pool p1 60.1.1.1 60.1.1.20 255.255.255.0 Router(config)#ip nat inside source list 1 pool p1 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 8 页,共 11 页 - - - - - - - - - Router(config)#ip nat inside destination list 2 po

21、ol p2 Router(config)#ip nat inside source list 2 interface s0/0 overload Router(config)#ip nat pool p2 10.65.1.2 10.65.1.4 255.255.255.0 type rotary Router#show ip nat translation rotary 参数是轮流的意思, 地址池中的 IP 轮流与 NAT分配的地址匹配。overload 参数用于 PAT 将内部 IP 映射到一个公网 IP 不同的端口上。外部网关协议配置:routerA(config)#router bgp

22、100 routerA(config-router)#network 19.0.0.0 routerA(config-router)#neighbor 8.1.1.2 remote-as 200 配置 PPP验证:RouterA(config)#username password RouterA(config)#int s0 RouterA(config-if)#ppp authentication chap|pap 3PIX 防火墙命令Pix525(config)#nameif ethernet0 outside security0 ;命名接口和级别名师资料总结 - - -精品资料欢迎下载

23、- - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 9 页,共 11 页 - - - - - - - - - Pix525(config)#interface ethernet0 auto ;设置接口方式Pix525(config)#interface ethernet1 100full ;设置接口方式Pix525(config)#interface ethernet1 100full shutdown Pix525(config)#ip address inside 192.168.0.1 255.255.255.0 Pix5

24、25(config)#ip address outside 133.0.0.1 255.255.255.252 Pix525(config)#global (if_name) natid ip-ip ;定义公网 IP 区间Pix525(config)#global (outside) 1 7.0.0.1-7.0.0.15 ;例句Pix525(config)#global (outside) 1 133.0.0.1 ;例句Pix525(config)#no global (outside) 1 133.0.0.1 ;去掉设置Pix525(config)#nat (if_name) nat_id

25、local_ip netmark Pix525(config)#nat (inside) 1 0 0 内网所有主机 (0 代表 0.0.0.0)可以访问 global 1 指定的外网。Pix525(config)#nat (inside) 1 172.16.5.0 255.255.0.0 内网 172.16.5.0/16网段的主机可以访问global 1指定的外网。Pix525(config)#route if_name 0 0 gateway_ip metric ;命令格式Pix525(config)#route outside 0 0 133.0.0.1 1 ;例句Pix525(confi

26、g)#route inside 10.1.0.0 255.255.0.0 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 10 页,共 11 页 - - - - - - - - - 10.8.0.1 1 ;例句Pix525(config)#static (inside, outside) 133.0.0.1 192.168.0.8 表示内部 ip 地址 192.168.0.8 ,访问外部时被翻译成133.0.0.1全局地址。Pix525(config)#static (dmz, outside) 133.0.0.1 172.16.0.8 中间区域 ip 地址 172.16.0.8 ,访问外部时被翻译成133.0.0.1全局地址。名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 11 页,共 11 页 - - - - - - - - -

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 教育专区 > 高考资料

本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知得利文库网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

工信部备案号:黑ICP备15003705号-8 |  经营许可证:黑B2-20190332号 |   黑公网安备:91230400333293403D

© 2020-2023 www.deliwenku.com 得利文库. All Rights Reserved 黑龙江转换宝科技有限公司 

黑龙江省互联网违法和不良信息举报
举报电话:0468-3380021 邮箱:hgswwxb@163.com