2022年思科路由与交换机配置整理

上传人:M****1 文档编号:567421640 上传时间:2024-07-20 格式:PDF 页数:28 大小:305.53KB
返回 下载 相关 举报
2022年思科路由与交换机配置整理_第1页
第1页 / 共28页
2022年思科路由与交换机配置整理_第2页
第2页 / 共28页
2022年思科路由与交换机配置整理_第3页
第3页 / 共28页
2022年思科路由与交换机配置整理_第4页
第4页 / 共28页
2022年思科路由与交换机配置整理_第5页
第5页 / 共28页
点击查看更多>>
资源描述

《2022年思科路由与交换机配置整理》由会员分享,可在线阅读,更多相关《2022年思科路由与交换机配置整理(28页珍藏版)》请在金锄头文库上搜索。

1、CISCO 基本命令集show protocols show mem show ip route show startup-config show running-config show flash show interfaces 二、 基本路由配置命令进入: config terminal/memory/network 配置网络时常采用的命令:copy 和 load 1 标识: hostname 标识名2 启动标识: banner 启动标识3 接口: interface 端口号4 密码: line 0 6 login passwd 口令enable password/secret 口令5 接

2、口:1)配置端口interface 端口号clock rate 时钟速率( 64000 )/* 在串口中配置*/ bandwidth 带宽(缺省 56) /* 在串口中配置*/ media-type 介质类型/* 在以太网口上*/ early-token release /* 在令牌环网口上*/ ring-speed 16 /* 在令牌环网口上*/ no shutdown write memory 2)检验端口show interfaces show controllers 6 配置环境1) 引导方式boot system flash IOS-filename boot system tftp

3、 IOS-filename tftp-address boot system rom 2) 配置 Register 值名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 1 页,共 28 页 - - - - - - - - - config-register 0x2102 7 查看邻居路由show cdp interface show cdp neighbors detail show cdp entry routerA 8 IP Address 配置Ip address 网络地址掩码I

4、p host 主机名address Ip name-se rver 服务器地址 1 服务器地址 2 。Ip domain-lookup nsap Show hosts Ping 主机名 /IP 地址Trace 主机名 /IP 地址三、 IP 路由1 静态路由ip routing ip route 目标网络号掩码 端口号permanent 2 缺省路由ip default-network 网络号3 动态路由1) RIP 配置Router rip Network 网络号Show ip route Show ip protocol Debug ip 2) OSPF 配置Router ospf 进程号

5、Redistribute 其它路由协议Network 端口网络反掩码area 区域号Area 区域号 range 网络号 掩码Area 区域号 default-cost 花销值Ip ospf priority number Ip ospf cost 花销值Show ip ospf database 3) BGP 配置名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 2 页,共 28 页 - - - - - - - - - Router bgp 自治域号Redistribute 其它路由

6、协议Network 网络号/* 自治域内*/ Aggregate-address 网络号 掩码 summary-only 汇总网络Neighbor 相邻网络号remote-as 自治域号/* 自治域间的网络*/ 四、 流量控制1) 被动端口passive interface 端口号2) 缺省路由ip default 网络号 /端口网络3) 静态路由ip route 目标网络号掩码 端口号4)ACL 过滤表(全局上 ) access-list 访问号 1 permit|deny 反掩码号 established access-list 访问号 2 permit|deny IP/TCP协议 源网络

7、目的网络操作符参数(端口上 )access-group 访问号in|out distribute-list 访问号 in|out 端口号4) Null 0 interface Ip route address mask null 0 五、 广义网配置1) PPP Ppp pap sent-usename 封装Ppp chap hostname Ppp chap password 2)X.25 encapsulation x25 dce x25 address x25 map 协议地址/*SVC */ x25 pvc pvc 号 ip 地址x25 地址 /*PVC */ ip switching

8、 x25 route x.121地址 接口 x.121 映射地址2) FrameRelay Frame-relay local-dlci IP网络号Frame-relay map 协议地址Frame-relay lmi-type ansi 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 3 页,共 28 页 - - - - - - - - - 交换机命令全集1.在基于 IOS 的交换机上设置主机名/系统名 : switch(config)# hostname hostname 在基于

9、 CLI 的交换机上设置主机名/系统名 : switch(enable) set system name name-string 2.在基于 IOS 的交换机上设置登录口令: switch(config)# enable password level 1 password 在基于 CLI 的交换机上设置登录口令: switch(enable) set password switch(enable) set enalbepass 3.在基于 IOS 的交换机上设置远程访问: switch(config)# interface vlan 1 switch(config-if)# ip addres

10、s ip-address netmask switch(config-if)# ip default-gateway ip-address 在基于 CLI 的交换机上设置远程访问: switch(enable) set interface sc0 ip-address netmask broadcast-address switch(enable) set interface sc0 vlan switch(enable) set ip route default gateway 4.在基于 IOS 的交换机上启用和浏览CDP 信息: switch(config-if)# cdp enable

11、 switch(config-if)# no cdp enable 为了查看 Cisco 邻接设备的 CDP 通告信息 : switch# show cdp interface type modle/port switch# show cdp neighbors type module/port detail 在基于 CLI 的交换机上启用和浏览CDP 信息: switch(enable) set cdp enable|disable module/port 为了查看 Cisco 邻接设备的 CDP 通告信息 : switch(enable) show cdp neighborsmodule/

12、port vlan|duplex|capabilities|detail 5.基于 IOS 的交换机的端口描述 : switch(config-if)# description description-string 基于 CLI 的交换机的端口描述: switch(enable)set port name module/number description-string 6.在基于 IOS 的交换机上设置端口速度: switch(config-if)# speed10|100|auto 在基于 CLI 的交换机上设置端口速度: switch(enable) set port speed mou

13、dle/number 10|100|auto 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 4 页,共 28 页 - - - - - - - - - switch(enable) set port speed moudle/number 4|16|auto 7.在基于 IOS 的交换机上设置以太网的链路模式: switch(config-if)# duplex auto|full|half 在基于 CLI 的交换机上设置以太网的链路模式: switch(enable) set po

14、rt duplex module/number full|half 8.在基于 IOS 的交换机上配置静态VLAN: switch# vlan database switch(vlan)# vlan vlan-num name vla switch(vlan)# exit switch# configure teriminal switch(config)# interface interface module/number switch(config-if)# switchport mode access switch(config-if)# switchport access vlan v

15、lan-num switch(config-if)# end 在基于 CLI 的交换机上配置静态VLAN: switch(enable) set vlan vlan-num name name switch(enable) set vlan vlan-num mod-num/port-list 9. 在基于 IOS 的交换机上配置VLAN 中继线 : switch(config)# interface interface mod/port switch(config-if)# switchport mode trunk switch(config-if)# switchport trunk e

16、ncapsulation isl|dotlq switch(config-if)# switchport trunk allowed vlan remove vlan-list switch(config-if)# switchport trunk allowed vlan add vlan-list 在基于 CLI 的交换机上配置VLAN 中继线 : switch(enable) set trunk module/port on|off|desirable|auto|nonegotiate Vlan-range isl|dotlq|dotl0|lane|negotiate 10.在基于 IO

17、S 的交换机上配置VTP 管理域 : switch# vlan database switch(vlan)# vtp domain domain-name 在基于 CLI 的交换机上配置VTP 管理域 : switch(enable) set vtp domain domain-name 11.在基于 IOS 的交换机上配置VTP 模式: switch# vlan database switch(vlan)# vtp domain domain-name switch(vlan)# vtp sever|cilent|transparent switch(vlan)# vtp password

18、password 在基于 CLI 的交换机上配置VTP 模式: 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 5 页,共 28 页 - - - - - - - - - switch(enable) set vtp domain domain-name mode sever|cilent|transparent password password 12. 在基于 IOS 的交换机上配置VTP 版本 : switch# vlan database switch(vlan)# vtp v

19、2-mode 在基于 CLI 的交换机上配置VTP 版本: switch(enable) set vtp v2 enable 13. 在基于 IOS 的交换机上启动VTP 剪裁 : switch# vlan database switch(vlan)# vtp pruning 在基于 CL I 的交换机上启动VTP 剪裁: switch(enable) set vtp pruning enable 14.在基于 IOS 的交换机上配置以太信道: switch(config-if)# port group group-number distribution source|destination

20、在基于 CLI 的交换机上配置以太信道: switch(enable) set port channel moudle/port-range modeon|off|desirable|auto 15.在基于 IOS 的交换机上调整根路径成本: switch(config-if)# spanning-tree vlan vlan-list cost cost 在基于 CLI 的交换机上调整根路径成本: switch(enable) set spantree portcost moudle/port cost switch(enable) set spantree portvlancost mou

21、dle/port cost costvlan-list 16.在基于 IOS 的交换机上调整端口ID: switch(config-if)# spanning-treevlan vlan-listport-priority port-priority 在基于 CLI 的交换机上调整端口ID: switch(enable) set spantree portpri mldule/portpriority switch(enable) set spantree portvlanpri module/portpriority vlans 17. 在基于 IOS 的交换机上修改STP 时钟 : swi

22、tch(config)# spanning-tree vlan vlan-list hello-time seconds switch(config)# spanning-tree vlan vlan-list forward-time seconds switch(config)# spanning-tree vlan vlan-list max-age seconds 在基于 CLI 的交换机上修改STP 时钟: switch(enable) set spantree hello intervalvlan switch(enable) set spantree fwddelay delay

23、 vlan switch(enable) set spantree maxage agingtiamevlan 18. 在基于 IOS 的交换机端口上启用或禁用Port Fast 特征 : switch(config-if)#spanning-tree portfast 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 6 页,共 28 页 - - - - - - - - - 在基于 CLI 的交换机端口上启用或禁用Port Fast 特征: switch(enable) set sp

24、antree portfast module/portenable|disable 19. 在基于 IOS 的交换机端口上启用或禁用UplinkFast 特征: switch(config)# spanning-tree uplinkfast max-update-rate pkts-per-second 在基于 CLI 的交换机端口上启用或禁用UplinkFast 特征: switch(enable) set spantree uplinkfast enable|disablerate update-rate all-protocols off|on 20. 为了将交换机配置成一个集群的命令

25、交换机,首先要给管理接口分配一个IP 地址,然后使用下列命令 : switch(config)# cluster enable cluster-name 21. 为了从一条中继链路上删除VLAN, 可使用下列命令 : switch(enable) clear trunk module/port vlan-range 22. 用 show vtp domain 显示管理域的VTP 参数. 23. 用 show vtp statistics显示管理域的VTP 参数. 24. 在 Catalyst 交换机上定义TrBRF 的命令如下 : switch(enable) set vlan vlan-na

26、me name name type trbrf bridge bridge-numstp ieee|ibm 25. 在 Catalyst 交换机上定义TrCRF 的命令如下 : switch (enable) set vlan vlan-num name name type trcrf ring hex-ring-num|decring decimal-ring-num parent vlan-num 26. 在创建好 TrBRF VLAN 之后,就可以给它分配交换机端口.对于以太网交换 ,可以采用如下命令给VLAN 分配端口 : switch(enable) set vlan vlan-nu

27、m mod-num/port-num 27. 命令 show spantree显示一个交换机端口的STP 状态. 28. 配置一个 ELAN 的 LES 和 BUS,可以使用下列命令 : ATM (config)# interface atm number.subint multioint ATM(config-subif)# lane serber-bus ethernet elan-name 29. 配置 LECS: ATM(config)# lane database database-name ATM(lane-config-databade)# name elan1-name ser

28、ver-atm-address les1-nsap-address ATM(lane-config-databade)# name elan2-name server-atm-address les2-nsap-address ATM(lane-config- databade)# name 30. 创建完数据库后 ,必须在主接口上启动LECS. 命令如下 : ATM(config)# interface atm number ATM(config-if)# lane config database database-name ATM(config-if)# lane config auto-

29、config-atm-address 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 7 页,共 28 页 - - - - - - - - - 31. 将每个 LEC 配置到一个不同的ATM 子接口上 .命令如下 : ATM(config)# interface atm number.subint multipoint ATM(config)# lane client ethernet vlan-num elan-num 32. 用 show lane server 显示 LES 的

30、状态 . 33. 用 show lane bus显示 bus 的状态 . 34. 用 show lane database显示 LECS 数据库可内容 . 35. 用 show lane client显示 LEC 的状态 . 36. 用 show module显示已安装的模块列表. 37. 用物理接口建立与VLAN 的连接 : router# configure terminal router(config)# interface media module/port router(config-if)# description description-string router(config-

31、if)# ip address ip-addr subnet-mask router(config-if)# no shutdown 38. 用中继链路来建立与VLAN 的连接 : router(config)# interface module/port.subinterface router(config-ig)# encapsulationisl|dotlq vlan-number router(config-if)# ip address ip-address subnet-mask 39. 用 LANE 来建立与 VLAN 的连接 : router(config)# interfac

32、e atm module/port router(config-if)# no ip address router(config-if)# atm pvc 1 0 5 qsaal router(config-if)# atm pvc 2 0 16 ilni router(config-if)# interface atm module/port.subinterface multipoint router(config-if)# ip address ip-address subnet-mask router(config-if)# lane client ethernet elan-num

33、router(config-if)# interface atm module/port.subinterface multipoint router(config-if)# ip address ip-address subnet-name router(config-if)# lane client ethernet elan-name router(config- if)# 40. 为了在路由处理器上进行动态路由配置,可以用下列 IOS 命令来进行 : router(config)# ip routing router(config)# router ip-routing-protoco

34、l router(config-router)# network ip-network-number router(config-router)# network ip-network-number 41. 配置默认路由 : switch(enable) set ip route default gateway 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 8 页,共 28 页 - - - - - - - - - 42. 为一个路由处理器分配VLANID, 可在接口模式下使用下列命

35、令: router(config)# interface interface number router(config-if)# mls rp vlan-id vlan-id-num 43. 在路由处理器启用MLSP: router(config)# mls rp ip 44. 为了把一个外置的路由处理器接口和交换机安置在同一个VTP 域中: router(config)# interface interface number router(config-if)# mls rp vtp-domain domain-name 45. 查看指定的 VTP 域的信息 : router# show m

36、ls rp vtp-domain vtp domain name 46. 要确定 RSM 或路由器上的管理接口,可以在接口模式下输入下列命令: router(config-if)#mls rp management-interface 47. 要检验 MLS-RP 的配置情况:router# show mls rp 48. 检验特定接口上的MLS 配置:router# show mls rp interface interface number 49. 为了在 MLS-SE 上设置流掩码而又不想在任一个路由处理器接口上设置访问列表:set mls flow destination|destin

37、ation-source|full 50. 为使 MLS 和输入访问列表可以兼容,可以在全局模式下使用下列命令:router(config)# mls rp ip input-acl 51. 当某个交换机的第3 层交换失效时,可在交换机的特权模式下输入下列命令:switch(enable) set mls enable 52. 若想改变老化时间的值,可在特权模式下输入以下命令:switch(enable) set mls agingtime agingtime 53. 设置快速老化:switch(enable) set mls agingtime fast fastagingtime pkt_

38、threshold 54. 确定那些 MLS-RP 和 MLS-SE 参与了 MLS,可先显示交换机引用列表中的内容再确定:switch(enable) show mls include 55. 显示 MLS 高速缓存记录:switch(enable) show mls entry 56. 用命令 show in arp 显示 ARP 高速缓存区的内容。57. 要把路由器配置为HSRP 备份组的成员,可以在接口配置模式下使用下面的命令:router(config-if)# standby group-number ip ip-address 58. 为了使一个路由器重新恢复转发路由器的角色,在

39、接口配置模式下:名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 9 页,共 28 页 - - - - - - - - - router(config-if)# standy group-number preempt 59. 访问时间和保持时间参数是可配置的:router(config-if)# standy group-number timers hellotime holdtime 60. 配置 HSRP 跟踪:router(config-if)# standy group-num

40、ber track type-number interface-priority 61. 要显示 HSRP 路由器的状态:router# show standby type-number group brief 62. 用命令 show ip igmp 确定当选的查询器。63. 启动 IP 组播路由选择:router(config)# ip muticast-routing 64. 启动接口上的PIM:dalllasr1(config-if)# ip pim dense-mode|sparse-mode|sparse-dense-mode 65. 启动稀疏 -稠密模式下的PIM:router#

41、 ip multicast-routing router# interface type number router# ip pim sparse-dense-mode 66. 核实 PIM 的配置:dallasr1# show ip pim interfacetype number count 67. 显示 PIM 邻居: dallasr1# show ip neighbor type number 68. 为了配置 RP 的地址,命令如下:dallasr1# ip pim rp-address ip-address group-access-list-numberoverride 69.

42、选择一个默认的RP:dallasr1# ip pim rp-address 通告 RP 和它所服务的组范围:dallasr1# ip pim send-rp-announce type number scope ttl group-list access-list-number 为管理范围组通告RP 的地址:dallasr1# ip pim send-rp-announce ethernet0 scope 16 group-list1 dallasr1# access-list 1 permit 266.0.0.0 0.255.255.255 设定一个 RP 映像代理:dallasr1# ip

43、 pim send-rp-discovery scope ttl 核实组到 RP 的映像:dallasr1# show ip pim rp mapping dallasr1# show ip pim rp group-name|group-address mapping 70. 在路由器接口上用命令ip multicast ttl-threshold ttl-value设定 TTL 阀值:dallasr1(config-if)# ip multicast ttl-threshold ttl-value 71. 用 show ip pim neighbor显示 PIM 邻居表。名师资料总结 -

44、- -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 10 页,共 28 页 - - - - - - - - - 72. 显示组播通信路由表中的各条记录:dallasr1show ip mroute group-name|group-addressscouresummarycountactive kbps 73. 要记录一个路由器接受和发送的全部IP 组播包:dallasr1 #debug ip mpacket detail access-listgroup 74. 要在 CISCO 路由器上配置CGMP

45、:dallasr1(config-if)# ip cgmp 75.配置一个组播路由器,使之加入某一个特定的组播组:dallasr1(config-if)# ip igmp join-group group-address 76. 关闭 CGMP :dallasr1(config-if)# no ip cgmp 77. 启动交换机上的CGMP :dallasr1(enable) set cgmp enable 78. 核实 Catalyst 交换机上 CGMP 的配置情况:catalystla1(enable) show config set prompt catalystla1 set int

46、erface sc0 192.168.1.1 255.255.255.0 set cgmp enable 79. CGMP 离开的设置:Dallas_SW(enable) set cgmp leave 80. 在 Cisco 设备上修改控制端口密码:R1(config)# line console 0 R1(config-line)# login R1(config-line)# password Lisbon R1(config)# enable password Lilbao R1(config)# login local R1(config)# username student pass

47、word cisco 81. 在 Cisco 设备上设置控制台及vty 端口的会话超时:R1(config)# line console 0 R1(config-line)# exec-timeout 5 10 R1(config)# line vty 0 4 R1(config-line)# exec-timeout 5 2 82. 在 Cisco 设备上设定特权级:R1(config)# privilege configure level 3 username R1(config)# privilege configure level 3 copy run start R1(config)

48、# privilege configure level 3 ping R1(config)# privilege configure level 3 show run R1(config)# enable secret level 3 cisco 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 11 页,共 28 页 - - - - - - - - - 83. 使用命令 privilege 可定义在该特权级下使用的命令:router(config)# privilege mode l

49、evel level command 84. 设定用户特权级:router(c onfig)# enable secret level 3 dallas router(config)# enable secret san-fran router(config)# username student password cisco 85. 标志设置与显示:R1(config)# banner motd unauthorized access will be prosecuted! 86. 设置 vty 访问:R1(config)# access-list 1 permit 192.168.2.5 R

50、1(config)# line vty 0 4 R1(config)# access-class 1 in 87. 配置 HTTP 访问:Router3(config)# access-list 1 permit 192.168.10.7 Router3(config)# ip http sever Router3(config)# ip http access-class 1 Router3(config)# ip http authentication local Router3(config)# username student password cisco 88. 要启用 HTTP 访

51、问,请键入以下命令:switch(config)# ip http sever 89. 在基于 set 命令的交换机上用setCL1 启动和核实端口安全:switch(enable) set port security mod_num/port_numenable mac address switch(enable) show port mod_num/port_num 在基于 CiscoIOS 命令的交换机上启动和核实端口安全:switch(config-if)# port secure mac-mac-count maximum-MAC-count switch# show mac-add

52、ress-table security type module/port 90. 用命令 access-list 在标准通信量过滤表中创建一条记录:Router(config)# access-list access-list-number permit|deny source-address source-address 91. 用命令 access-list 在扩展通信量过滤表中创建一条记录:Router(config)# access-list access-list-number permit|denyprotocol|protocol-keywordsource source-wil

53、dcard|anydestination destination-wildcard|anyprotocol-specific optionslog 92. 对于带内路由更新,配置路由更新的最基本的命令格式是:R1(config-router)#distribute-list access-list-number|name in type number 93. 对于带外路由更新,配置路由更新的最基本的命令格式是:名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 12 页,共 28 页 -

54、 - - - - - - - - R1(config-router)#distribute-list access-list-number|name out interface-name routing-process| autonomous-system-number 94. set snmp命令选项:set snmp community read-only|ready-write|read-write-allcommunity_string 95. set snmp trap 命令格式如下:set snmp trap enable|disable all|moudle|classis|br

55、idge|repeater| auth|vtp|ippermit|vmps|config|entity|stpx set snmp trap rvcr_addr rcvr_community 96. 启用 SNMP chassis 陷阱: Console(enable) set snmp trap enable chassis 97. 启用所有 SNMP chassis 陷阱: Console(enable) set snmp trap enable 98. 禁用 SNMP chassis 陷阱: Console(enable) set snmp trap disable chassis 99

56、. 给 SNMP 陷阱接收表加一条记录:Console(enable) set snmp trap 192.122.173.42 public 100. show snmp 输出结果。101. 命令 set snmp rmon enable 的输出结果。102. 显示 SPAN 信息:思科路由器交换机配置命令大全1. 交换机支持的命令:交换机基本状态:switch: ;ROM 状态,路由器 是 rommon hostname ;用户模式hostname# ;特权模式hostname(config)# ;全局配置模式hostname(config-if)# ;接口状态交换机口令设置:switch

57、enable ;进入特权模式switch#config terminal ;进入全局配置模式名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 13 页,共 28 页 - - - - - - - - - switch(config)#hostname ;设置交换机的主机名switch(config)#enable secret xxx ;设置特权 加密 口令switch(config)#enable password xxa ;设置特权非密口令switch(config)#line co

58、nsole 0 ;进入控制台口switch(config-line)#line vty 0 4 ;进入虚拟终端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)

59、#switchport access vlan 2 ;当前端口加入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 ;设置发vtp 密码switch(config)#vtp

60、 mode server ;设置发vtp 模式switch(config)#vtp mode client ;设置发vtp 模式交换机设置IP 地址:switch(config)#interface vlan 1 ;进入 vlan 1 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 14 页,共 28 页 - - - - - - - - - switch(config-if)#ip address ;设置 IP 地址switch(config)#ip default-gateway

61、;设置默认网关switch#dir flash: ;查看闪存交换机显示命令:switch#write ;保存配置信息switch#show vtp ;查看 vtp 配置信息switch#show run ;查看当前配置信息switch#show vlan ;查看 vlan配置信息switch#show interface ;查看端口信息switch#show int f0/0 ;查看指定端口信息2. 路由器支持的命令:路由器显示命令:router#show run ;显示配置信息router#show interface ;显示接口信息router#show ip route ;显示路由信息r

62、outer#show cdp nei ;显示邻居信息router#reload ;重新起动路由器口令设置:routerenable ;进入特权模式router#config terminal ;进入全局配置模式router(config)#hostname ;设置交换机的主机名router(config)#enable secret xxx ;设置特权加密口令router(config)#enable password xxb ;设置特权非密口令router(config)#line console 0 ;进入控制台口router(config-line)#line vty 0 4 ;进入虚拟

63、终端名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 15 页,共 28 页 - - - - - - - - - router(config-line)#login ;要求口令验证router(config-line)#password xx ;设置登录口令xx router(config)#(Ctrl+z) ; 返回特权模式router#exit ;返回命令路由器配置:router(config)#int s0/0 ;进入 Serail接口router(config-if)#no s

64、hutdown ;激活当前接口router(config-if)#clock rate 64000 ;设置同步时钟router(config-if)#ip address ;设置 IP 地址router(config-if)#ip address second ;设置第二个IP router(config-if)#int f0/0.1 ;进入子接口router(config-subif.1)#ip address ;设置子接口IP router(config-subif.1)#encapsulation dot1q ;绑定 vlan中继协议router(config)#config-regis

65、ter 0x2142 ;跳过配置文件router(config)#config-register 0x2102 ;正常使用配置文件router#reload ;重新引导路由器文件操作:router#copy running-config startup-config ;保存配置router#copy running-config tftp ;保存配置到tftp router#copy startup-config tftp ;开机配置存到tftp router#copy tftp flash: ;下传文件到flash router#copy tftp startup-config;下载配置文件

66、ROM 状态:Ctrl+Break ;进入 ROM 监控状态名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 16 页,共 28 页 - - - - - - - - - rommonconfreg 0x2142 ;跳过配置文件rommonconfreg 0x2102 ;恢复配置文件rommonreset;重新引导rommoncopy xmodem: flash: ;从 console传输文件rommonIP_ADDRESS=10.65.1.2 ;设置路由器IP rommonIP_SUB

67、NET_MASK=255.255.0.0 ;设置路由器掩码rommonTFTP_SERVER=10.65.1.1 ;指定 TFTP 服务器 IP rommonTFTP_FILE=c2600.bin ;指定下载的文件rommontftpdnld ;从 tftp 下载rommondir flash: ;查看闪存内容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 ;

68、默认路由举例动态路由:router(config)#ip routing ;启动路由转发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 c

69、isco;设置管理类型router(config-s0)#frame-relay intf-type DCE ;设置为DCE 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 17 页,共 28 页 - - - - - - - - - router(config-s0)#frame-relay dlci 16 ;router(config-s0)#frame-relay local-dlci 20 ;设置虚电路号router(config-s0)#frame-relay interfa

70、ce-dlci 16 ;router(config)#log-adjacency-changes ;记录邻接变化router(config)#int s0/0.1 point-to-point ;设置子接口点对点router#show frame pvc ;显示永久虚电路router#show frame map ;显示映射基本 访问控制 列表:router(config)#access-list permit|deny router(config)#interface ;default:deny any router(config-if)#ip access-group in|out ;de

71、fault: Out例 1:router(config)#access-list 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(con

72、fig-if)#ip access-group 4 in 扩展访问控制列表:access-list permit|deny icmp type access-list permit|deny tcp port 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 18 页,共 28 页 - - - - - - - - - 例 3:router(config)#access-list 101 deny icmp any 10.64.0.2 0.0.0.0 echo router(config

73、)#access-list 101 permit ip any any router(config)#int s0/0 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删除访问控制例

74、表: router(config)#no access-list 102 router(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(c

75、onfig)#ip nat inside source static tcp 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 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 19 页,共 28 页 - - - - - - - - - Router(confi

76、g)#ip nat inside destination list 2 pool 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 不同的端口上。外部

77、网关 协议 配置:routerA(config)#router bgp 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|pap3PIX 防火墙命令Pix525(config)#nameif ethernet0 outside secu

78、rity0 ;命名接口和级别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 Pix525(config)#ip address outside 133.0.0.1 255.255.255.252Pix525(config)#glob

79、al (if_name) natid ip-ip ;定义公网 IP 区间名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 20 页,共 28 页 - - - - - - - - - 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 ;去掉设置P

80、ix525(config)#nat (if_name) nat_id 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 outsid

81、e 0 0 133.0.0.1 1 ;例句Pix525(config)#route inside 10.1.0.0 255.255.0.0 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全局地址。帧中继命

82、令:router(config)#frame-relay switching ;使能帧中继交换router(config-s0)#encapsulation frame-relay ;使能帧中继router(config-s0)#fram-relay lmi-type cisco ;设置管理类型router(config-s0)#frame-relay intf-type DCE ;设置为 DCE router(config-s0)#frame-relay dlci 16 ;router(config-s0)#frame-relay local-dlci 20 ;设置虚电路号名师资料总结 -

83、- -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 21 页,共 28 页 - - - - - - - - - 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#show frame map ;显示映

84、射基本访问控制列表: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-list 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

85、.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 扩展访问控制列表: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

86、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 例 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 a

87、ccess-group 102 out 删除访问控制例表 : 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 22 页,共 28 页 - - - - - - - - - router(config)#no access-list 102 router(config-if)#no ip access-group 101 in 路由器的 nat配置Router(config-if)#ip nat inside ;当前接口指定为内部接口Router(config-if)#ip nat ou

88、tside ;当前接口指定为外部接口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 tcp 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

89、 list 1 pool p1 Router(config)#ip nat inside destination list 2 pool 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参数用于 P

90、AT 将内部 IP 映射到一个公网IP 不同的端口上。外部网关协议配置:routerA(config)#router bgp 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 名师资料总结 - - -精品资料欢迎下载 - - -

91、 - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 23 页,共 28 页 - - - - - - - - - 3PIX 防火墙命令Pix525(config)#nameif ethernet0 outside security0 ;命名接口和级别Pix525(config)#interface ethernet0 auto ;设置接口方式Pix525(config)#interface ethernet1 100full ;设置接口方式Pix525(config)#interface ethernet1 100full shutdown

92、 Pix525(config)#ip address inside 192.168.0.1 255.255.255.0 Pix525(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

93、 (outside) 1 133.0.0.1 ;去掉设置Pix525(config)#nat (if_name) nat_id 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 ;命令

94、格式Pix525(config)#route outside 0 0 133.0.0.1 1 ;例句Pix525(config)#route inside 10.1.0.0 255.255.0.0 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,

95、访问外部时被翻译成133.0.0.1名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 24 页,共 28 页 - - - - - - - - - 全局地址。. 交换机支持的命令:交换机基本状态:switch: ;ROM状态,路由器是rommon hostname ;用户模式hostname# ;特权模式hostname(config)# ;全局配置模式hostname(config-if)# ;接口状态交换机口令设置:switchenable ;进入特权模式switch#config

96、terminal ;进入全局配置模式switch(config)#hostname ;设置交换机的主机名switch(config)#enable secret xxx ;设置特权加密口令switch(config)#enable password xxa ;设置特权非密口令switch(config)#line console 0 ;进入控制台口switch(config-line)#line vty 0 4 ;进入虚拟终端switch(config-line)#login ;允许登录switch(config-line)#password xx ;设置登录口令xx switch#exit

97、;返回命令交换机 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 ;当前端口加入 vlan 2 switch(config-if)#switchport mode trunk ;设置为干线switch(config-if)#switchport trunk allowed vlan 1,2 ;

98、设置允许的vlan switch(config-if)#switchport trunk encap dot1q ;设置 vlan 中继switch(config)#vtp domain ;设置发vtp域名switch(config)#vtp password ;设置发vtp密码名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 25 页,共 28 页 - - - - - - - - - switch(config)#vtp mode server ;设置发vtp模式switch(con

99、fig)#vtp mode client ;设置发vtp模式交换机设置 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 ;查看 vtp配置信息switch#show run ;查看当前配置信息switch#show vlan ;查看 vlan配置信息swit

100、ch#show interface ;查看端口信息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 ;设置交换机的主机名route

101、r(config)#enable secret xxx ;设置特权加密口令router(config)#enable password xxb ;设置特权非密口令router(config)#line console 0 ;进入控制台口router(config-line)#line vty 0 4 ;进入虚拟终端router(config-line)#login ;要求口令验证router(config-line)#password xx ;设置登录口令xx router(config)#(Ctrl+z) ; 返回特权模式router#exit ;返回命令名师资料总结 - - -精品资料欢迎

102、下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 26 页,共 28 页 - - - - - - - - - 路由器配置: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 rout

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

104、#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 监控状态rommonconfreg 0x2142 ;跳过配置文件rommonconfreg 0x2102 ;恢复配置文件rommonreset;重新引导rommoncopy xmodem: flash: ;从 console 传输文件ro

105、mmonIP_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 flash: ;查看闪存内容rommonboot ;引导 IOS 静态路由:ip route ;命令格式router(config)#ip route 2.0.0.0 255.0.0.0 1.1.1.2 ;静态路由举例名师资

106、料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 27 页,共 28 页 - - - - - - - - - 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 ;设置发布路由名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 28 页,共 28 页 - - - - - - - - -

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 建筑/环境 > 施工组织

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号