神州数码路由器及交换机配置命令_第1页
神州数码路由器及交换机配置命令_第2页
神州数码路由器及交换机配置命令_第3页
神州数码路由器及交换机配置命令_第4页
神州数码路由器及交换机配置命令_第5页
已阅读5页,还剩2页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、神州数码交换机配置命令交换机基本状态: hostname> ;用户模式 hostname# ;特权模式 hostname(config)# ;全局配置模式 hostname(config-if)# ;接口状态 交换机口令设置: switch>enable ;进入特权模式 switch#config terminal ;进入全局配置模式 switch(config)#hostname ;设置交换机的主机名 switch(config)#enable secret xxx ;设置特权加密口令

2、60;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 ;返回命令 交换机VLAN设置: switch#vlan database ;进入VLAN设置 

3、;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(config-if

4、)#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-

5、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配置信息 switch#show interface ;查看端口信息 switch#show int f0/0 ;查看

6、指定端口信息完了最最要的一步。要记得保存设置俄,保存命令:switch(config)#copy running-config startup-config解决交换机无法远程管理的经典三招 1、检查线路连接状态2、检查端口工作状态:“display cpu” 如果发现某块板卡的CPU消耗率达到50%以上,那么对应板卡上的某个交换端口可能不停地受到大容量数据的冲击3、检查病毒攻击状态接着在交换机后台管理系统的DOS命令行状态下,执行字符串命令“dis dia”,来对交换机系统的各个交换端口进行全面扫描,扫描结束后这些结果信息会被自动捕获保存到先前设置的文本文件中;打开目标文本文件,仔细

7、检查其中是否存在地址冲突的提示信息,要是发现有这样的提示信息时,那就说明局域网中存在ARP病毒。为了找到ARP病毒源头,我们可以在交换机的命令行状态下执行“dis mac”字符串命令,从其后的结果界面中找到发生地址冲突的MAC地址对应的交换端口以及所在子交换机的IP地址;下面以系统管理员权限登录进入目标子交换机系统,将该系统切换进入全局配置状态,之后再进入目标交换端口的视图配置状态,在该状态下执行“shutdown”命令,将目标交换端口暂时关闭,以便禁止ARP病毒通过该交换端口影响整个局域网;最后,我们可以查看网管记录,找到连接到故障交换端口的客户端计算机,要求该计算机用户必须及时杀毒,确保能

8、够将ARP病毒及时清除干净;在清除干净ARP病毒后,再在对应交换端口的视图模式配置状态下,执行“undo shutdown”字符串命令,将目标交换端口重新启用起来,这么一来我们就能成功解决由ARP病毒引起的无法远程管理交换机故障现象了第一部分:交换机配置:1.       基本配置:开启SSH服务:debug ssh-server设置特权模式密码:enable password 8 <password>   注释:8为加密的密码设置退出特权模式超时时间:exec-timeout &l

9、t;minutes > <seconds>                            Switch(config)#exec-timeout 5 30(退出时间为5分30秒)更改主机名:hostname 主机名设置主机名与IP地址的映射关系:Switch(config)#ip h

10、ost beijing (beijing为主机)开启web配置服务:Switch(config)#ip http serve显示帮户信息的语言类型:language chinese|english使用密码验证:login使用本地用户密码验证:Switch(config)#login local设置用户在 console上进入一般用户配置模式时的口令:Switch(config)#password 8 test热启动交换机:reload加密系统密码:service password-encryption恢复交换机出厂配置:set default保存当前配置:wri

11、te配置交换机作为 Telnet 服务器允许登录的 Telnet 客户端的安全 IP 地址:Switch(config)#telnet-server securityip 1设置Telnet 客户端的用户名及口令:Switch(config)#telnet-user Antony password 0 switch打开交换机的 SSH服务器功能:Switch(config)#ssh-server enable设置SSH客户端的用户名及口令:Switch(config)#ssh-user swi

12、tch password 0 switch通过DHCP 方式获取 IP 地址。Switch(config)#interface vlan 1Switch(Config-if-Vlan1)#ip dhcp-client enableSwitch(Config-if-Vlan1)#exit交换机 Switch1 端口 1 同交换机 Switch2 端口 1 用线相连,将该两个端口设置为强制100Mbit/s  速率,半双工模式。Switch1(config)#inter

13、face ethernet1/1Switch1(Config-If-Ethernet1/1)#speed-duplex force100-halfSwitch2(config)#interface ethernet1/1Switch2(Config-If-Ethernet1/1)#speed-duplex force100-half配置名称为 test的隔离组。Switch>enableSwitch#configSwitch(config)#isolate-port group test打开LACP调试开关。Switch#debug lacp新建一个 port gro

14、up,并且采用默认的流量分担方式。Switch (config)#port-group 1删除一个 port groupSwitch (config)#no port-group 1在 Ethernet1/1 端口模式下,将本端口以 active 模式加入port-group 1。Switch (Config-If-Ethernet1/1)#port-group 1 mode active删除端口 1 动态MAC。Switch#clear port-security dynamic interface Ethernet 1/

15、1使能端口 1 的MAC 地址绑定功能。Switch(config)#interface Ethernet 1/1Switch(Config-If-Ethernet1/1)#switchport port-security将端口 1 的MAC地址转化为静态安全 MAC 地址。Switch(config)#interface Ethernet 1/1Switch(Config-If-Ethernet1/1)#switchport port-security convert添加MAC 00-03-0F-FE-2E-D3 

16、;到端口 1Switch(config)#interface Ethernet 1/1Switch(Config-If-Ethernet1/1)#switchport port-security mac-address 00-03-0F-FE-2E-D3设置端口 1 安全MAC 地址上限为 4。Switch(config)#interface Ethernet 1/1Switch(Config-If-Ethernet1/1)#switchport port-security maximum 4设置端口 1 的违背模式为

17、60;shutdown。Switch(config)#interface Ethernet 1/1Switch(Config-If-Ethernet1/1)#switchport port-security violation shutdown 生成树配置:配置VLAN1-10;100-110 与 Instance 1的映射关系。Switch(config)#spanning-tree mst configurationSwitch(Config-Mstp-Region)#instance 1 vlan 1-10;100-110配置修正数值为 2000。

18、Switch(config)#spanning-tree mst configurationSwitch(Config-Mstp-Region)# revision-level 2000开启和关闭生成树Switch(config)#spanning-treeSwitch(config)#interface ethernet 1/2Switch(Config-If-Ethernet1/2)#no spanning-tree设置交换机运行 STP模式。Switch(config)#spanning-tree mode stp在端口 1/2 设置实例 1

19、60;的端口优先级为 32。Switch(config)#interface ethernet 1/2Switch(Config-If-Ethernet1/2)#spanning-tree mst 1 port-priority 32配置交换机实例 2 的优先级为 4096。Switch(config)#spanning-tree mst 2 priority 4096 访问控制列表配置:使能在 Tuesday到 Saturday内的 9:15:30到 12:30:00时间段内配置生效Switch(con

20、fig)#time-range dc_timerSwitch(Config-Time-Range-dc_timer)#absolute-periodic tuesday 9:15:30 to saturday 12:30:00使能在 Monday、Wednesday、Friday和 Sunday四天内的 14:30:00到 16:45:00 时间段配置生效Switch (Config-Time-Range-dc_timer)#periodic  monday wednesday friday sunday 14:30:00

21、to16:45:00 创建编号为110的数字扩展访问列表。拒绝icmp报文通过,允许目的地址为目的端口为 32 的udp 包通过。Switch(config)#access-list 110 deny icmp any-source any-destinationSwitch(config)#access-list 110 permit udp any-source host-destination d-port 32 创建一条编号为 20的数字标准 IP访问列表,允许源地址为&

22、#160;/24 的数据包通过,拒绝其余源地址为 /16 的数据包通过。Switch(config)#access-list 20 permit 55Switch(config)#access-list 20 deny 55 允许源 MAC 地址为 00-00-XX-XX-00-01 的数据包通过,拒绝源地址为00-00-00-XX-00-ab 的数据包通过。Switch(config)# access-l

23、ist 700 permit 00-00-00-00-00-01 00-00-FF-FF-00-00Switch(config)# access-list 700 deny   00-00-00-00-00-ab 00-00-00-FF-00-00 允许源地址为 /24 的数据包通过,拒绝其余源地址为 /16 的数据包通过。Switch(config)# ip access-list standard ipFlowSwitch(Config-Std-Nacl-ipFlow)# per

24、mit 55Switch(Config-Std-Nacl-ipFlow)# deny 55  二层交换机配置:1.基本配置:enable 进入特权模式            config 禁进入全局配置模式            hostname

25、60;更改设备名称1.使用TFTP上传文件:show flashcopy startup-config t0/sw1-config012.配置telnet服务:telnet-server enabletelnet-user admin password 0 admintelnet-server secu   指定特定的IP远程登录3.http登录:ip http serverweb-user dcnu password 0 dcnu指定登录用户名和密码4.交换机vlan的配置:vlan 10switchport inte

26、rface ethernet 0/0/1-105.端口镜像:monitor session 1 source interface ethernet 0/0/1;10;24monitor session 1 destination interface ethernet 0/0/236.端口MAC地址绑定:sw port-securitysw port-security mac-address 00-0B-CD-4A-23-AF查看mac地址表:show mac-address-table7.AM实现端口IP和MAC地址绑定:am enableam mac-ip-pool mac地址 I

27、P地址8.生成树配置:开启和关闭生成树:span no span针对特定端口开启和关闭生成树:int e0/0/1  span/no spanmstp配置:span mstp config         name dcnu         instance 1 vlan 10         instanc

28、e 2 vlan 20指定优先级:span mstp 1 priority 4096            span mstp 2 priority 61440指定特定端口的优先级:int e0/0/1                      span ms

29、tp 1 port-poriority 16                      span mstp 2 port-poriority 240 三层交换机DHCP和中继的配置:1.DHCP配置:vlan 10            vlan 2

30、0            int vlan 10            ip add             int vlan 20     

31、;       ip add             service dhcp            ip dhcp pool 1         &

32、#160;  network-address 24            default-router             ip dhcp pool 2           

33、60;network-address 24            default-router  2.DHCP中继:ip forward-protocol udp bootps            int vlan 10       

34、;     ip help             ip route 路由器配置:1.ospf路由器配置:router ospf 100network area 0接口权值配置:ip ospf cost 值路由重分发:redistribute ospf 区域号 r

35、edistribute rip 下面的配置在路由器A和B之间配置一条 virtua link。路由器 A(router-id: )上的配置:!router ospf 100network area 1    area 1 virtual-link 路由器 B(router-id: )上的配置: router ospf 100network 255.2

36、55.255.0 area 1    area 1 virtual-link 策略路由配置:创建ACL:ip access-list standard net1 permit 55创建router-map:router-map               router-map pbr 10 permit   

37、            match ip addess net1 set ip next-hop 9绑定在进入的接口上:interface fastethernet 0/0                    ip policy route-map pbr

38、60;RouterA配置:Router>enableRouter#confRouter_config#hostname RouterARouterA_config#username RouterB password 1234            设置账号密码RouterA_config#int s0/1RouterA_config_s0/1#ip address RouterA_config_s0/1#encapsul

39、ation ppp                     封装PPP协议RouterA_config_s0/1#ppp authentication chap                 设置验证方式RouterA

40、_config_s0/1#ppp chap hostname RouterA             设置发给对方验证的账号RouterA_config_s0/1#physical-layer speed 64000              设置DCE时钟频率RouterA_config_s0/1#no shutRouterA

41、_config_s0/1#exitRouterA_config#aaa authentication ppp default local            配置aaa的ppp认证方法表RouterB配置:Router>enableRouter#confRouter_config#hostname RouterBRouterB_config#username RouterA password 1234            设置账号密码RouterB_config#int s0/1RouterB_config_s0/1#ip address RouterB_config_s0/1#encapsulation ppp   &#

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论