神州数码配置命令总结

合集下载

[修订]神州数码常用交换机和路由命令集

[修订]神州数码常用交换机和路由命令集

1.在基于IOS的交换机上设置主机名/系统名:switch(config)# hostname hostname在基于CLI的交换机上设置主机名/系统名:switch(enable) set system name name-string2.在基于IOS的交换机上设置登录口令:switch(config)# enable password level 1 password在基于CLI的交换机上设置登录口令:switch(enable) set passwordswitch(enable) set enalbepass3.在基于IOS的交换机上设置远程访问:switch(config)# interface vlan 1switch(config-if)# ip address ip-address netmaskswitch(config-if)# ip default-gateway ip-address在基于CLI的交换机上设置远程访问:switch(enable) set interface sc0 ip-address netmask broadcast-address switch(enable) set interface sc0 vlanswitch(enable) set ip route default gateway4.在基于IOS的交换机上启用和浏览CDP信息:switch(config-if)# cdp enableswitch(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 neighbors[module/port] [vlan|duplex|capabilities|detail] 5.基于IOS1000的交换机的端口描述:switch(config-if)# description description-string基于CLI的交换机的端口描述:switch(enable)set port name module/number description-string6.在基于IOS的交换机上设置端口速度:switch(config-if)# speed{10|100|auto}在基于CLI的交换机上设置端口速度:switch(enable) set port speed moudle/number {10|100|auto}switch(enable) set port speed moudle/number {4|16|auto}7.在基于IOS的交换机上设置以太网的链路模式:switch(config-if)# duplex {auto|full|half}在基于CLI的交换机上设置以太网的链路模式:switch(enable) set port duplex module/number {full|half}8.在基于IOS的交换机上配置静态VLAN:switch# vlan databaseswitch(vlan)# vlan vlan-num name vlaswitch(vlan)# exitswitch# configure teriminalswitch(config)# interface interface module/numberswitch(config-if)# switchport mode accessswitch(config-if)# switchport access vlan vlan-numswitch(config-if)# end在基于CLI的交换机上配置静态VLAN:switch(enable) set vlan vlan-num [name name]switch(enable) set vlan vlan-num mod-num/port-list9. 在基于IOS的交换机上配置VLAN中继线:switch(config)# interface interface mod/portswitch(config-if)# switchport mode trunkswitch(config-if)# switchport trunk encapsulation {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.在基于IOS的交换机上配置VTP管理域:switch# vlan databaseswitch(vlan)# vtp domain domain-name在基于CLI的交换机上配置VTP管理域:switch(enable) set vtp [domain domain-name]11.在基于IOS的交换机上配置VTP 模式:switch# vlan databaseswitch(vlan)# vtp domain domain-nameswitch(vlan)# vtp {sever|cilent|transparent}switch(vlan)# vtp password password在基于CLI的交换机上配置VTP 模式:switch(enable) set vtp [domain domain-name] [mode{ sever|cilent|transparent }][password password]12. 在基于IOS的交换机上配置VTP版本:switch# vlan databaseswitch(vlan)# vtp v2-mode在基于CLI的交换机上配置VTP版本:switch(enable) set vtp v2 enable13. 在基于IOS的交换机上启动VTP剪裁:switch# vlan databaseswitch(vlan)# vtp pruning在基于CL I 的交换机上启动VTP剪裁:switch(enable) set vtp pruning enable14.在基于IOS的交换机上配置以太信道:switch(config-if)# port group group-number [distribution {source|destination}]在基于CLI的交换机上配置以太信道:switch(enable) set port channel moudle/port-range mode{on|off|desirable|auto}15.在基于IOS的交换机上调整根路径成本:switch(config-if)# spanning-tree [vlan vlan-list] cost cost在基于CLI的交换机上调整根路径成本:switch(enable) set spantree portcost moudle/port costswitch(enable) set spantree portvlancost moudle/port [cost cost][vlan-list] 16.在基于IOS的交换机上调整端口ID:switch(config-if)# spanning-tree[vlan vlan-list]port-priority port-priority 在基于CLI的交换机上调整端口ID:switch(enable) set spantree portpri {mldule/port}priorityswitch(enable) set spantree portvlanpri {module/port}priority [vlans] 17. 在基于IOS的交换机上修改STP时钟:switch(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 interval[vlan]switch(enable) set spantree fwddelay delay [vlan]switch(enable) set spantree maxage agingtiame[vlan]18. 在基于IOS的交换机端口上启用或禁用Port Fas1000t 特征: switch(config-if)#spanning-tree portfast在基于CLI的交换机端口上启用或禁用Port Fast 特征:switch(enable) set spantree portfast {module/port}{enable|disable}19. 在基于IOS的交换机端口上启用或禁用UplinkFast 特征:switch(config)# spanning-tree uplinkfast [max-update-rate pkts-per-second]在基于CLI的交换机端口上启用或禁用UplinkFast 特征:switch(enable) set spantree uplinkfast {enable|disable}[rate update-rate] [all-protocols off|on]20. 为了将交换机配置成一个集群的命令交换机,首先要给管理接口分配一个IP地址,然后使用下列命令: switch(config)# cluster enable cluster-name21. 为了从一条中继链路上删除VLAN,可使用下列命令:switch(enable) clear trunk module/port vlan-range22. 用show vtp domain 显示管理域的VTP参数.23. 用show vtp statistics显示管理域的VTP参数.24. 在Catalyst交换机上定义TrBRF的命令如下:switch(enable) set vlan vlan-name [name name] type trbrf bridge bridge-num[stp {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-num26. 在创建好TrBRF VLAN之后,就可以给它分配交换机端口.对于以太网交换,可以采用如下命令给VLAN分配端口:switch(enable) set vlan vlan-num mod-num/port-num27. 命令show spantree显示一个交换机端口的STP状态.28. 配置一个ELAN的LES和BUS,可以使用下列命令:A TM (config)# interface atm number.subint multiointA TM(config-subif)# lane serber-bus ethernet elan-name29. 配置LECS:A TM(config)# lane database database-nameA TM(lane-config-databade)# name elan1-name server-atm-address les1-nsap-address A TM(lane-config-databade)# name elan2-name server-atm-address les2-nsap-addressA TM(lane-config-databade)# name …30. 创建完数据库后,必须在主接口上启动LECS.命令如下:A TM(config)# interface atm numberA TM(config-if)# lane config database database-nameA TM(config-if)# lane config auto-config-atm-address31. 将每个LEC配置到一个不同的A TM子接口上.命令如下:A TM(config)# interface atm number.subint multipointA TM(config)# lane client ethernet vlan-num elan-num32. 用show lane server 显示LES的状态.33. 用show lane bus显示bus的状态.34. 用show lane database显示LECS数据库可内容.35. 用show lane client显示LEC的状态.36. 用show module显示已安装的模块列表.37. 用物理接口建立与VLAN的连接:router# configure terminalrouter(config)# interface media module/portrouter(config-if)# description description-stringrouter(config-if)# ip address ip-addr subnet-maskrouter(config-if)# no shutdown38. 用中继链路来建立与VLAN的连接:router(config)# interface module/port.subinterfacerouter(config-ig)# encapsulation[isl|dotlq] vlan-numberrouter(config-if)# ip address ip-address subnet-mask39. 用LANE 来建立与VLAN的连接:router(config)# interface atm module/portrouter(config-if)# no ip addressrouter(config-if)# atm pvc 1 0 5 qsaalrouter(config-if)# atm pvc 2 0 16 ilnirouter(config-if)# interface atm module/port.subinterface multipointrouter(config-if)# ip address ip-address subnet-maskrouter(config-if)# lane client ethernet elan-numrouter(config-if)# interface atm module/port.subinterface multipointrouter(config-if)# ip address ip-address subnet-namerouter(config-if)# lane client ethernet elan-namerouter(config-if)# …40. 为了在路由处理器上进行动态路由配置,可以用下列IOS命令来进行: router(config)# ip routingrouter(config)# router ip-routing-protocolrouter(config-router)# network ip-network-numberrouter(config-router)# network ip-network-number41. 配置默认路由:switch(enable) set ip route default gateway42. 为一个路由处理器分配VLANID,可在接口模式下使用下列命令:1000router(config)# interface interface numberrouter(config-if)# mls rp vlan-id vlan-id-num43. 在路由处理器启用MLSP:router(config)# mls rp ip44. 为了把一个外置的路由处理器接口和交换机安置在同一个VTP域中:router(config)# interface interface numberrouter(config-if)# mls rp vtp-domain domain-name45. 查看指定的VTP域的信息:router# show mls rp vtp-domain vtp domain name46. 要确定RSM或路由器上的管理接口,可以在接口模式下输入下列命令:router(config-if)#mls rp management-interface47. 要检验MLS-RP的配置情况:router# show mls rp48. 检验特定接口上的MLS配置:router# show mls rp interface interface number49. 为了在MLS-SE上设置流掩码而又不想在任一个路由处理器接口上设置访问列表:set mls flow [destination|destination-source|full]50. 为使MLS和输入访问列表可以兼容,可以在全局模式下使用下列命令:router(config)# mls rp ip input-acl51. 当某个交换机的第3层交换失效时,可在交换机的特权模式下输入下列命令:switch(enable) set mls enable52. 若想改变老化时间的值,可在特权模式下输入以下命令:switch(enable) set mls agingtime agingtime53. 设置快速老化:switch(enable) set mls agingtime fast fastagingtime pkt_threshold54. 确定那些MLS-RP和MLS-SE参与了MLS,可先显示交换机引用列表中的内容再确定:switch(enable) show mls include55. 显示MLS高速缓存记录:switch(enable) show mls entry56. 用命令show in arp显示ARP高速缓存区的内容。

神州数码路由交换配置命令(全)

神州数码路由交换配置命令(全)

路由sshaaa authentication login ssh localaaa authentication enable default enableenable password 0 123456username admin password 0 123456ip sshd enableip sshd auth-method sship sshd auth-retries 5ip sshd timeout 60TELNETR1_config#aaa authentication login default local R1_config#aaa authentication enable default enable R1_config#enable password 0 ruijieR1_config#line vty 0 4R1_config_line#login authentication defaultR1_config_line#password 0 cisco方法2,不需要经过3A认证R1_config#aaa authentication login default noneR1_config#aaa authentication enable default enable R1_config#enable password 0 ciscoR1_config#line vty 0 4R1_config_line#login authentication defaultCHAP认证单向认证,密码可以不一致R2_config#aaa authentication ppp test localR2_config#username R2 password 0 123456R2_config_s0/2#enc pppR2_config_s0/2#ppp authentication chap testR2_config_s0/2#ppp chap hostname R1R1_config#aaa authentication ppp test localR1_config#username R1 password 0 123456R1_config_s0/1#enc pppR1_config_s0/1#ppp authentication chap testR1_config_s0/1#ppp chap hostname R2pap认证双向认证,密码要求一致R2_config#aaa authentication ppp test localR2_config#username R2 password 0 123456R2_config_s0/2#enc pppR2_config_s0/2#ppp authentication pap testR2_config_s0/2#ppp pap sent-username R1 password 123456R1_config#aaa authentication ppp test localR1_config#username R1 password 0 123456R1_config_s0/1#enc pppR1_config_s0/1#ppp authentication pap testR1_config_s0/1#ppp pap sent-username R2 password 123456FRRouter-A_config_s1/1#encapsulation frame-relay !封装帧中继协议Router-A_config_s1/1#frame-relay local-dlci 17 !设置本地DLCI 号Router-A_config_s1/1# frame-relay intf-type dce !配置FR的DCERouter-A_config_s1/1# frame-relay map 192.168.1.2 pvc 17 broadcast !配置DLCI 与对端IP的映射VrrpInt g0/4vrrp 1 associate 192.168.20.254 255.255.255.0vrrp 1 priority 120 设置优先级,为主vrrp 1 preempt 开启抢占vrrp 1 track interface Serial0/1 30 追踪上行接口,防止上行接口DOWN了,自动降低优先级Int g0/6vrrp 1 associate 192.168.20.254 255.255.255.0vrrp 1 priority 100 设置优先级,为备,默认为100vrrp 1 preempt 开启抢占vrrp 1 track interface Serial0/2 30 追踪上行接口,防止上行接口DOWN了,自动降低优先级RIP 验证,只有V2支持验证interface Serial0/2 接口起验证和配密码ip rip authentication simpleip rip password 123456RIP改单播router ripnei 192.168.1.1RIP定时器router riptimers update 10 更新时间timers exipire 30 失效时间timers hosddown 50 抑制时间ospfrouter os 1net 192.168.1.0 255.255.255.0 ar 0 不能写32位掩码OSPF 虚链路ROUTER OS 2 进程起用AR 1 VI 2.2.2.2 对方ROUTER-IDOSPF 汇总ROUTER OS 2 进程起用ar 0 range 192.168.0.0 255.255.252.0OSPF 验证ROUTER OS 2 明文AR 0 AUTHEN SP 进程给需要验证的区域启用验证INT S0/1IP OS passw 123456 接口配置密码密文router os 2ar 0 authen meint s0/1ip os me 1 md5 123456bgprouter bgp 100no synchronization bgp全互联必须要关闭同步检查nei 192.168.12.1 remot 200 与AS外部路由建立邻居nei 2.2.2.2 remot 100 与AS内部路由建立邻居nei 2.2.2.2 up lo0 改更新接口为环回接口nei 2.2.2.2 next-hop-self 改下一跳为自己net 2.2.2.0 通告路由表里面有的路由ACL路由上面的ACL要写子网掩码,不能写反掩码!!!!!基于时间的ACLtime-range acl 定义一个时间范围periodic weekdays 09:00 to 12:00periodic weekdays 14:00 to 17:00IP access-list extended time 写一个基于时间的acl,调用时间段deny ip 192.168.10.0 255.255.255.0 any time-range aclpermit ip any anyint g0/4 应用到接口ip access-group time inint g0/6ip access-group time in静态NATip route 0.0.0.0 0.0.0.0 192.168.12.2ip nat inside source static 192.168.10.10 192.168.12.1int g0/6ip nat inints0/1ip nat outNAPTip access-list standard NAT 定义要转换的IP网段permit 192.168.10.0 255.255.255.0ip nat pool NAT 192.168.23.10 192.168.23.20 255.255.255.0 创建转换的IP地址池ip nat inside source list NAT pool NAT overload 关联要转换的IP网段和地址池ip route default 192.168.23.3 写一条缺省路由,下一跳为出口网关的下一跳router rip 如果跑路由协议,要把缺省重分发到动态路由redistribute staticinterface Serial0/1 运用到内网接口ip nat insideinterface Serial0/2 运用到外网接口ip nat outsideroute-mapip acce sta acl 定义要匹配的流量per 192.168.20.0 255.255.255.0route-map SHENMA 10 permitma ip add acl 调用ACLset ip next-hop 192.168.12.1 改下一跳int g0/3ip po route-map SHENMA 定义到原接口DHCP给路由接口分配IP,不能是S口!!!R1ip dhcpd enableip dhcpd pool 1network 192.168.12.0 255.255.255.0range 192.168.12.10 192.168.12.20R2interface GigaEthernet0/6ip address dhcp给PC分配IP,底层网络要起路由互通!!!!实验全网起了RIP协议R1ip dhcpd enableip dhcpd pool 2network 192.168.1.0 255.255.255.0range 192.168.1.10 192.168.1.20default-router 192.168.1.1R2ip dhcpd enable 要开启DHCP服务!interface GigaEthernet0/4ip address 192.168.1.1 255.255.255.0ip helper-address 192.168.12.2 设置DHCP服务器IPVPN (GRE)int t0ip add 172.168.10.1 255.255.255.0 给T0配IPt so s0/2 源,路由的出接口t de 192.168.23.3 目的,对端的出接口IP,注意,要可达t key 123456 T0口密码,两端要一致exitip route 192.168.20.0 255.255.255.0 t0 用T0口写一条要到达网段的静态路由int t0ip add 172.168.10.3 255.255.255.0t so s0/1t de 192.168.12.1t key 123456exitip route 192.168.10.0 255.255.255.0 t0VPN (IPSEC)R1crypto ipsec transform-set SHENMA 设置转换集transform-type esp-des esp-md5-hmac 转换集的加密方式ip access-list extended 100 匹配感兴趣流permit ip 192.168.10.0 255.255.255.0 192.168.20.0 255.255.255.0crypto map HAN 10 ipsec-isakmpset peer 192.168.23.3 设置对等体set transform-set SHENMA 关联转换集match address 100 关联感兴趣流interface Serial0/2 进接口调用crypto map HANR3crypto ipsec transform-set SHENMA 设置转换集transform-type esp-des esp-md5-hmac 转换集的加密方式,两端要一致ip access-list extended 100 匹配感兴趣流permit ip 192.168.20.0 255.255.255.0 192.168.10.0 255.255.255.0crypto map HAN 10 ipsec-isakmpset peer 192.168.12.1 设置对等体set transform-set SHENMA 关联转换集match address 100 关联感兴趣流interface Serial0/1 进接口调用crypto map HANVPN (IKE)crypto isakmp key SHENMA 192.168.23.3 255.255.255.0 设置公共用密钥crypto isakmp policy 10 设置IKE策略hash md5au preenc desgroup 1lifetime 86400crypto ipsec transform-set SHENMA 设置转换集transform-type esp-Des esp-Md5-hmacip access-list extended 100 匹配感兴趣流permit ip 192.168.10.0 255.255.255.0 192.168.30.0 255.255.255.0crypto map SHENMA 10 ipsec-isakmp 设置IPSEC加密映射set peer 192.168.23.3set transform-set SHENMAmatch address 100int s0/2 调用到接口crypto map SHENMAQOSint g0/4ip add 192.168.10.1 255.255.255.0no shutip add 192.168.20.1 255.255.255.0no shutint s0/1ip add 192.168.12.1 255.255.255.0phy spe 64000no shutip route 0.0.0.0 0.0.0.0 192.168.12.2ip access-list ex 1 定义ACL抓取流量permit ip 192.168.10.0 255.255.255.0 2.2.2.0 255.255.255.0ip access-list ex 2permit ip 192.168.20.0 255.255.255.0 2.2.2.0 255.255.255.0priority 1 protocol ip high list 1 写一个IP协议的优先列表,调用ACL 1里面的地址,级别为HIGHpriority 1 protocol ip low list 2 写一个IP协议的优先列表,调用ACL 2里面的地址,级别为LOWint s0/1 进接口调用priority 1交换banner motd 系统登录标题telnettelnet-server enable 开启TELNETtelnet-server max-connection 16 最大连接数sshusername ssh password 0 123456ssh-server enable 开启SSHssh-server timeout 60 连接超时时间ssh-server max-connection 16 最大连接数ssh-server authentication-retries 5 重连次数ssh-server host-key create rsa 创建新的主机密钥1,首先要给所有的VLAN配上IPINT VLAN 10IP ADD 192.168.10.1 255.255.255.0NO SHUT2,创建一个VRRP组ROUTER VRRP 10VIRTUAL-IP 192.168.10.254 给虚拟IPINT VLAN 10 关联VLANPRIORITY 120 给优先级(默认100)ENABLE 激活STPSW1spanning-tree 开启STPspanning-tree mode mstp 改为MSTP模式spanning-tree mst configurtaion 配置域name shenma域名revision-level 3 修正级别instance 1 vlan10;20 在实例里面关联VLANinstance2 vlan30;40exitspanning-tree mst 1priority 4096 给实例配置优先级,越小的级别越高spanning-tree mst 2 priority 8192SW2spanning-tree 开启STPspanning-tree mode mstp 改为MSTP模式spanning-tree mst configurtaion 配置域name shenma域名revision-level 3 修正级别instance 1 vlan10;20 在实例里面关联VLANinstance2 vlan30;40exitspanning-tree mst 1priority 8192 给实例配置优先级,越小的级别越高spanning-tree mst 2 priority 4096SW21spanning-tree 开启STPspanning-tree mode mstp 改为MSTP模式spanning-tree mst configurtaion 配置域name shenma域名revision-level 3 修正级别instance 1 vlan10;20 在实例里面关联VLANinstance2 vlan30;40AM端口安全am enableint e1/0/1am portam mac-ip-pool 0000.1111.2222 192.168.10.1端口镜像monitor session 1 source int e1/0/1 bothmonitor session 1 destination int e1/0/15RIPRouter ripNet 192.168.1.0/24Router os 1Net 192.168.1.0 0.0.0.255 ar 0AclFirewall enableIp access-list ex 100Per ip 192.168.1.0 0.0.0.255 192.168.2.0 0.0.0.255单臂路由R1int g0/5no shutinterface GigaEthernet0/5.1encapsulation dot1Q 100ip address 192.168.10.1 255.255.255.0interface GigaEthernet0/5.2encapsulation dot1Q 200ip address 192.168.20.1 255.255.255.0interface GigaEthernet0/5.3encapsulation dot1Q 300ip address 192.168.30.1 255.255.255.0SW1vlan 100\sw int e1/0/1-2vlan 200sw int e1/0/3-4vlan 300sw int e1/0/5-6int e1/0/20sw mo trsw tr all vlan all端口聚合PORT-GROUP 1 创建一个组INT E1/0/17-18 聚合端口要设置为TRUNKSW MO TRSW TR ALL VLAN ALLPORT-GROUP 1 MO ON 设置聚合端口的模式为自动匹配EXITINT PORT-CHANNAL 1 进入聚合端口配置模式,也要设置为TRUNK SW MO TRSW TR ALL VLAN ALLEXITdhcpSERV DHCP 开启DHCP服务IP DHCP POOL VLAN10 创建地址池NETW 192.168.10.0 255.255.255.0def 192.168.10.1le 2dns 8.8.8.8ip dhcp ex 192.168.10.1 192.168.10.10 排除地址范围dhcp 中继serv dhcpip for udp bootint vlan 10ip he 192.168.12.2dhcp snoopingserv dhcp 开启DHCP服务ip dhcp snooping enable 开启DHCP SNOOPING 功能ip dhcp snooping binding enable 开启SNOOPING 绑定功能int e1/0/20ip dhcp snooping trust 设置接口为信任接口,一般是与服务器相连的接口int e1/0/1ip dhcp snooping binding user-control 设置端口自动绑定获取DHCP的地址设置端口手动绑定MAC,VLAN,IP,端口信息(全局模式)ip dhcp snooping binding user 00-11-22-33-44-55 address 192.168.22.22 vlan 1 int e1/0/5ipv66 to 4greipv6 unicast-routing 允许单播路由interface Tunnel0ipv6 enable 开启IPV6ipv6 address 2001:23::1/64tunnel source 192.168.12.1 本端接口地址tunnel destination 192.168.12.2 对端接口地址tunnel mode gre ip 隧道模式改为GREtunnel key 123456 隧道密码,两端一致ipv6 route 3::/64 Tunnel0 写一条下一跳为TUNNEL 0的IPV6静态,不能写默认静态natInternet(config)#ip route 0.0.0.0 0.0.0.0 fa0/1 ipv4网络要可达NA T-PT(config)#ip route 0.0.0.0 0.0.0.0 fa0/1NA T-PT(config)#ipv6 nat prefix 2001:db8:feed::/96 设置一个全局NAT前缀,掩码必须96位NA T-PT(config)#ipv6 nat v4v6 source 10.10.10.2 2001:db8:feed::2 写4 TO 6 地址转换,需要到达的地址都要写, 不需要与本地同一网段NA T-PT(config)#ipv6 nat v4v6 source 192.168.1.10 2001:db8:feed::3NA T-PT(config)#ipv6 nat v6v4 source 2001:db8:cafe:ffff::2 10.10.20.5 写6 to 4 地址转换,需要到达的地址都要写,不需要与本地同一网段int g0/4 调用到接口,进出都要调用ipv6 natint g0/4ipv6 natpatipv4 网络要可达NA T-PT(config)#ipv6 nat prefix 2001:db8:feed::/96 设置一个全局NAT 前缀,掩码必须96位NA T-PT(config)#ipv6 nat v4v6 source 10.10.10.2 2001:db8:feed::2 写4 TO 6 地址转换,需要到达的地址都要写NA T-PT(config)#ipv6 nat v4v6 source 192.168.1.10 2001:db8:feed::3 不需要与本地同一网段NA T-PT(config)#ipv6 access-list cafe 把IPV6要转换的网段匹配出来NA T-PT(config-ipv6-acl)#permit ipv6 2001:db8:cafe::/48 anyNA T-PT(config-ipv6-acl)#exitNA T-PT(config)#ipv6 nat v6v4 pool ipv4 10.10.20.5 10.10.20.6 prefix-length 24 写一个6 TO 4 的NAT地址池,不需要已知网段NA T-PT(config)#ipv6 nat v6v4 source list cafe pool ipv4 overload 把要转换的网段与地址池关联int g0/4ipv6 natint g0/4ipv6 natripingipv6 router rip 100 全局创建RIP实例,名字为100exitinterface GigaEthernet0/4ipv6 enable 开启IPV6ipv6 address 2001::1/64ipv6 rip 100 enable 启动为100的实例需要宣告的接口要设置ospfv3ipv6 router ospf 1 全局创建ospf,进程为1 int g0/6ipv6 enableipv6 address 2001::1/64ipv6 ospf 1 area 0 宣告本接口为area 0 需要宣告的接口要设置。

神州数码交换机路由器命令

神州数码交换机路由器命令

神州数码交换机路由器命令神州数码交换机路由器命令交换机配置命令switch>en (enable)进入特权用户模式switch # conf (config) 进入全局配置模式switch (config)# int e0/0/1 进入接口配置模式switch (config)# int vlan 1 进入VLAN配置模式switch (config)# host (hostname) 配置交换机名称switch (config)# enable password 1234 配置交换机密码switch (config)# enable password 8 1234 配置交换机密码(加密)switch (config)# vlan 10 创建vlanswitch (config)# int vlan 10switch (config-If-Vlan10)# ip address 172.16.10.1 255.255.255.0 配置VLAN地址生成树技术Switch (config)# spanning-tree 启用全局生成树(默认mstp生成树技术)switch (config)# spanning-tree mode stp/rstp/mstp 生成树技术switch (config)# spanning-tree mst 0 port-priority 4096 设置交换机的优先级默认32768Switch# sh sp (show spanning-tree) 查看生成树交换机Web管理switch (config)# ip http serverswitch (config)# web-user admin password 0 1234 用户名和密码(命令要全写)交换机T elnet管理switch (config) # ip http serverswitch (config)# telnet-user admin password 0 1234 用户名和密码(命令要全写)清空交换机配置switch# set def (default)恢复出厂配置switch# wr (write)保存配置switch# rel (reload)重启交换机链路聚合(不需启动生成树)switchA(config)# port-group 1switchA(config)# int e0/0/1-2switchA(config-port-range)# port-group 1 mode on/active 手动配置/自动配置switchA(config)# no port-group 1 删除组1switchB(config) # port-group 2switchB(config) # int e0/0/3-4switchB(config-port-range) # port-group 2 mode on/active switchA(config) # no port-group 2 删除组2交换机MAC与IP绑定switch (config)# am enable 启用全局am功能switch (config)# int e0/0/1switch (config_if_ethernet0/0/1)# am port 打开端口am功能switch (config_if_ethernet0/0/1)# am mac-ip-pool 00-A0-D1-D1-07-FF 192.168.1.101交换机DHCP服务器配置switch (config)# service dhcp 启用DHCPswitch (config)# ip dhcp pool poolA 定义地址池poolAswitch (dhcp-poolA- config)# network-address 192.168.1.0 24switch (dhcp-poolA- config)# lease 3 租期3天switch (dhcp-poolA- config)# default-router 192.168.1.1 网关switch (dhcp-poolA- config)# dns-server 60.191.244.5 DNS服务器ACL访问控制列表switchA(config)# ip access-list standard test 命名标准IP访问列表switchA(config-std-nacl-test)# deny 192.168.100.0 0.0.0.255 反子网掩码switchA(config-std-nacl-test)# deny 192.168.200.0 0.0.0.0switchA(config) # firewall enable 开启ACL功能switchA(config)# firewall default permit/deny 默认permit允许switchA(config)# int e0/0/1switchA(config-if-interface0/0/1) # ip access-group test in/outswitchA(config) # ip access-list standard 10 数字标准IP访问列表配置时间范围switchA(config)#time-range worktimeswitchA(config-time-range)#absolute-periodic weekdays 09:00:00 to 18:00:00路由器配置命令Router>ena 进入特权用户模式 Router# conf 进入全局配置模式Router_config# int f0/0Router_config_f0/0# ip address 10.1.1.1 255.255.255.0 配置路由器端口地址清空路由器配置Router# del (delete)删除启动配置文件Router# reb (reboot) 重启路由器静态路由Router_config# ip route 10.1.2.0 (目标网段) 255.255.255.0(子网掩码) 10.1.1.1 (转发地址)默认静态路由Router_config# ip route 0.0.0.0 (目标网段) 0.0.0.0(子网掩码)10.1.1.1 (转发地址)RIP动态路由Router_config# router rip 启用RIP路由Router_config_rip# version 2 RIP路由版本号 2Router_config_rip# network 10.1.1.0 255.255.255.0Router_config_rip# network 10.1.2.0 255.255.255.0 与路由器相连的网段OSPF动态路由Router_config# router ospf 1 启动ospf进程,进程号为1Router_config_ospf1# network 10.1.1.0 255.255.255.0 area 0 网段、子网掩码和区域号Router_config_ospf1# network 10.1.2.0 255.255.255.0 area 0 第一个区域(即主干区域)区域号为 0Router# show ip route 查看路由。

神州数码SW配置,命令

神州数码SW配置,命令

神州数码SW配置,命令1、1、公司内部人员不会配置IP地址,在SWA上配置DHCP 服务,为PCC与PCB分配IP地址,PCC的地址段为192.168.10.0/24网段,PCB的地址段为192.168.11.0/24网段。

SWA:SWA(config)#service dhcp //启用dhcp服务SWA(config)#ip dhcp pool PC // 定义一个地址池SWA(dhcp-pc-config)#network-address 192.168.10.0 24 //地址段SWA(dhcp-pc-config)#lease 0 8 0 //租用时间8小时SWA(dhcp-pc-config)#default-router 192.168.10.254 //设置默认网关SWA(config)#int vlan 1SWA(config-if-vlan1)#ip address 192.168.10.1 255.255.255.0 //需和地址池同一网段SWA(config)#service dhcp //启用dhcp服务SWA(config)#ip dhcp pool PB // 定义一个地址池SWA(dhcp-pc-config)#network-address 192.168.20.0 24 //地址段SWA(dhcp-pc-config)#lease 0 3 0 //租用时间3小时SWA(dhcp-pc-config)#default-router 192.168.20.254 //设置默认网关2、由于内网用户不会设置IP地址,在内网接入层交换机SWB上设置DHCP服务,方便内网用户的使用。

其中PCC用户会设置IP地址,所以PCC使用静态IP地址。

设置网段为:192.XX.20.0/24网段。

SWB:SWB(config)#service dhcp //启用dhcp服务SWB(config)#ip dhcp pool PB // 定义一个地址池SWB(dhcp-pc-config)#network-address 192.168.20.0 24 //地址段SWB(dhcp-pc-config)#lease 0 3 0 //租用时间3小时SWB(dhcp-pc-config)#default-router 192.168.20.254 //设置默认网关SWB(config)#int vlan 1SWB(config-if-vlan1)#ip address 192.168.20.254 255.255.255.03、为保证内网终端安全,要求内网所有用户的MAC地址与接入交换机SWB接口进行绑定,至少使用两种方法进行绑定。

神州数码设备配置总结.doc

神州数码设备配置总结.doc

神州数码设备配置总结交换机实验交换机的堆叠实验:3526s没有堆叠配置但堆叠的个数为不能超过8台交换机.而3926s堆叠个数不能超过9台。

堆叠(stack)协议是一种交换机管理技术,可将物理上的若干台交换机堆叠在一起,逻辑上当成一台交换机进行管理。

根据交换机之间连接方式的不同,堆叠交换机有三种配置方式:1.simplex方式:一台交换机的TX端口和另一台交换机的RX端口之间通过单向数据线连接,从而形成一个单向链路环。

simplex方式形成的堆叠组,每台交换机只需要一个全双工端口用于堆叠交换机之间的通讯。

缺点是容错性较差,任何一条链路出现故障,都会造成堆叠组瘫痪。

图 6-1 simplex方式2.duplex方式:交换机之间通过双向数据线连接形成双向两路环。

duplex方式形成的堆叠组,每台交换机必须两个全双工端口用于堆叠交换机之间的通讯。

为避免形成数据环,堆叠协议把其中一条数据链路作为冗余链路,并设置为PASSIVE状态。

Duplex堆叠方式具有较好的容错性,如果一条数据链路出现故障,堆叠协议可以启用冗余链路进行通讯,从而可以保持堆叠组稳定运行。

为节约级联端口,也可以取消冗余链路,而把交换机链接成为线形。

图 6-2 duplex方式3.chassis方式:以一台高性能交换机作为MASTER形成星形。

Chassis堆叠方式,任一两台交换机之间进行通讯,都必需经过MASTER交换机。

MASTER交换机必须是一台处理能力较强的高性能交换机,否则容易形成通讯瓶颈。

3926s的堆叠配置:图 6-3 chassis方式DCS-3926S支持duplex堆叠方式,下面我们就来看一下如何配置交换机堆叠。

目前,DCS-3926S支持duplex堆叠方式。

堆叠交换机启动后,首先运行MDP(MasterDiscovery Protocol)选举一台交换机作为MASTER,其它交换机作为SLAVE。

MASTER负责管理所有SLAVE交换机,并负责为每台SLAVE分配一个ID号,MASTER的ID为0。

神州数码路由器配置相关命令

神州数码路由器配置相关命令

一、路由器工作模式:用户模式:Router>特权模式:Router #全局配置模式:Router (config)#接口配置模式:Router (config-if)#路由配置模式:Router(config-router)#Line配置模式:Router(config-line)#二、路由器口令设置:Router>enable;进入特权模式Router#configterminal;进入全局配置模式Router(config)#hostname xxx;设置路由器的主机名Router(config)#enable secret level 15 0 xxx ;设置特权明文加密口令xxx Router (config)#enable password xxx;设置特权非密口令Router(config)#line console 0;进入控制台口Router(config-line)#line vty 0 4;进入虚拟终端Router(config-line)#login;允许登录Router(config-line)#password xx ;设置登录口令xxRouter#exit;返回命令三、路由器VLAN设置:配置WAN接口选择接口:Router(config)#i nterface s0/0/0配置IP地址Router(config-if)#ip address 192.168.10.1 255.255.255.0设置时钟频率:Router(config-if)#clock rate 64000(另一端无需配置)启用端口:Router(config-if)#no shutdown四、路由协议设置:静态路由:Router(config)#ip route network 目标网络网络掩码下一跳IP Router(config)#ip route 192.168.1.0 255.255.255.0 10.1.1.1默认路由:Router(config)#ip route 0.0.0.0 0.0.0.0 10.1.1.1开启RIP协议:Router(config)#router rip指定版本协议:Router(config-router)#version 2声明直连网络号:Router(config-router)#network 直连网段Router(config-router)#network 192.168.1.0开启进程号为1的ospf协议:Router(config)#router ospf1声明直连网络号Router(config-router)#network直连网段反掩码area区域号Router(config-router)#network 192.168.1.0 0.0.0.255 area 0查看路由表:Router#showip route配置路由访问控制命令格式:Router(config)#access-list 列表号permit源IP地址反掩码配置允许:Router(config)#access-list 1 permit 192.168.10.1 0.0.0.255配置拒绝访问:Router(config)# access-list 1 deny 192.168.20.0 0.0.0.255配置允许其他:Router(config)#access-list 1 permit any端口绑定命令:进入相应端口:Router(config)#interface fa0/1配置列表防止位置:Router(config-if)#ip access-group 1 outRouter(config-if)#配置路由DHCP服务开启dhcp服务:Router(config)#service dhcp设置地址池:Router(config)#ipdhcp pool 172.16.12.0设置网段:Router(dhcp-config)#network 172.16.12.0 255.255.255.0设置默认网关:Router(dhcp-config)#default-router 172.16.12.200Router(dhcp-config)#exit设置排除地址:Router(config)#ipdhcp excluded-address 172.16.12.151 172.16.12.254 进入网关端口:Router(config)#interface g0/0设置网关IP:Router(config-if)#i p address 172.16.12.200 255.255.255.0配置路由NAT静态NATRouter1(config)#ipnat inside source static 192.168.11.2 200.200.200.3Router1(config)#interface fa0/0Router1(config-if)#ipnat insideRouter1(config)#interface Serial0/0/0Router1(config-if)#ipnat outside动态NATRouter1(config)#ipnat pool NAT 200.200.200.3 200.200.200.4 network 255.255.255.0//定义内部全局IP地址池NAT Router1(config)#access-list 1 permit 192.168.11.00.0.0.255 //定义可转换内部本地IP地址Router1(config)#ipnat inside source list 1 pool NAT //配置动态NAT映射Router1(config)#interface fa0/0 //定义内部接口Router1(config-if)#ipnat insideRouter1(config)#interface Serial0/0/0 //定义外部接口Router1(config-if)#ipnatoutsideRouter1(config-if)#no shutdown路由器显示命令:Router#dir Flash: ;查看闪存Router#write;保存配置信息Router#show run;查看当前配置信息Router#show ip access-list //查看ACL配置信息Router#clean ipnat translation //清除动态NA T转换列表信息Route#show ipnat statistics //查看NA T转换统计信息Route#clean ipnat statistics //清除NA T转换统计信息完了最最要的一步。

神州数码路由和交换器命令

神州数码路由和交换器命令

1. 计算机命令:PCA login: root ;使用root用户password: linux ;口令是linux# shutdown -h now ;同init 0 关机# logout# login# ifconfig ;显示IP地址# ifconfig eth0 <ip address> netmask <netmask> ;设置IP地址# ifconfig eht0 <ip address> netmask <netmask> down ;删除IP地址# route add 0.0.0.0 gw <ip># route del 0.0.0.0 gw <ip># route add default gw <ip> ;设置网关# route del default gw <ip> ;删除网关# route ;显示网关# ping <ip># telnet <ip>2. 交换机支持的命令:交换机基本状态:switch: ;交换机的ROM状态rommon> ;路由器的ROM状态hostname> ;用户模式hostname# ;特权模式hostname(config)# ;全局配置模式hostname(config-if)# ;界面状态交换机口令设置:switch>enable ;进入特权模式switch#config terminal ;进入全局配置模式switch(config)#hostname <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 ;返回命令交换机VLAN设置:switch#vlan database ;进入VLAN设置switch(vlan)#vlan 2 ;建VLAN 2switch(vlan)#no vlan 2 ;删vlan 2switch(config)#int f0/1 ;进入埠1switch(config-if)#switchport access vlan 2 ;当前埠加入vlan 2switch(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 <name> ;设置发vtp域名switch(config)#vtp password <word> ;设置发vtp密码switch(config)#vtp mode server ;设置发vtp模式switch(config)#vtp mode client ;设置发vtp模式交换机设置IP地址:switch(config)#interface vlan 1 ;进入vlan 1switch(config-if)#ip address <IP> <mask> ;设置IP地址switch(config)#ip default-gateway <IP> ;设置默认网关switch#dir flash: ;查看闪存交换机显示命令:switch#write ;保存配置信息switch#show vtp ;查看vtp配置信息switch#show run ;查看当前配置信息switch#show vlan ;查看vlan配置信息switch#show interface ;查看端口信息switch#show int f0/0 ;查看指定端口信息3. 路由器支持的命令:路由器显示命令:router#show run ;显示配置信息router#show interface ;显示接口信息router#show ip route ;显示路由信息router#show cdp nei ;显示邻居信息router#reload ;重新起动路由器口令设置:router>enable ;进入特权模式router#config terminal ;进入全局配置模式router(config)#hostname <hostname> ;设置交换机的主机名router(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 ;返回命令路由器配置:router(config)#int s0/0 ;进入Serail界面router(config-if)#no shutdown ;启动当前接口router(config-if)#clock rate 64000 ;设置同步时钟router(config-if)#ip address <ip> <netmask> ;设置IP地址router(config-if)#ip address <ip> <netmask> second ;设置第二个IP router(config-if)#int f0/0.1 ;进入子界面router(config-subif.1)#ip address <ip> <netmask> ;设置子界面IP router(config-subif.1)#encapsulation dot1q <n> ;绑定vlan中继协议router(config)#config-register 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 ;下载配置文件ROM状态:Ctrl+Break ;进入ROM监控状态rommon>confreg 0x2142 ;跳过配置文件rommon>confreg 0x2102 ;恢复配置文件rommon>reset ;重新引导rommon>copy xmodem:<sname> flash:<dname> ;从console传输文件rommon>IP_ADDRESS=10.65.1.2 ;设置路由器IP rommon>IP_SUBNET_MASK=255.255.0.0 ;设置路由器屏蔽rommon>TFTP_SERVER=10.65.1.1 ;指定TFTP服务器IP rommon>TFTP_FILE=c2600.bin ;指定下载的檔rommon>tftpdnld ;从tftp下载rommon>dir flash: ;查看闪存内容rommon>boot ;引导IOS静态路由:ip route <ip-address> <subnet-mask> <gateway> ;命令格式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 ;默认路由举例动态路由:router(config)#ip routing ;启动路由转发router(config)#router rip ;启动RIP路由协定。

神州数码SW配置,命令

神州数码SW配置,命令
SWA(dhcp-pc-config)#network-address 192.168.20.0 24 //地址段
SWA(dhcp-pc-config)#lease 0 3 0 //租用时间3小时
SWA(dhcp-pc-config)#default-router 192.168.20.254 //设置默认网关
RS(config-time-range-1)#periodic daily 09:00:00 to 18:00:00 //定义范围
RS(config)#ip access-list extended nointernet //配置拓展ACL
RS(config-ip-ext-nacl-nointernet)#deny ip host-source 192.168.10.1 any-destination time-range 1 //配置在9点到18点范围内拒绝来自PCC到外网的所有数据
SWB(config)#int vlan 1
SWB(config-if-vlan1)#ip address 192.168.20.254 255.255.255.0
3、 为保证内网终端安全,要求内网所有用户的MAC地址与接入交换机SWB接口进行绑定,至少使用两种方法进行绑定。
SWB:
SWB(config)#interface ethernet 0/0/5 //进入接口模式
SWB(config)#interface ethernet 0/0/9-15 //进入端口配置模式
SWB(config-if-port-range)#anti-arpscan trust port //设置为ARP信任端口
11、 为了内网安全,在SWB上将PCC,PCB的IP,MAC绑定
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

第一部分交换机配置一、基础配置1、模式进入Switch>Switch>enSwitch#configSwitch(Config)#interface ethernet 0/22、配置交换机主机名命令:hostname <主机名>3、配置交换机IP地址Switch(Config)#interface vlan 1Switch(Config-If-Vlan1)#ip address 10.1.128.251 255.255.255.0Switch(Config-If-Vlan1)#no shut4、为交换机设置Telnet授权用户和口令:telnet-user <用户名>password {0|7} <密码>例:Switch(Config)#telnet-user test password 0 test5、为交换机设置Web授权用户和口令:web-user <用户名>password {0|7} <密码>例:Switch(Config)#web-user admin password 0 digital6、设置系统日期和时钟:clock set <HH:MM:SS> <YYYY/MM/DD>7、设置退出特权用户配置模式超时时间exec timeout <minutes > //单位为分钟,取值范围为0~3008、保存配置:write9、显示系统当前的时钟:Switch#show clock10、指定登录用户的身份是管理级还是访问级Enable [level {visitor|admin} [<密码>]]11、指定登录配置模式的密码:Enable password level {visitor|admin}12、设置端口的速率和双工模式(接口配置模式下)命令:speed-duplex {auto | force10-half | force10-full | force100-half | force100-full | {{force1g-half | force1g-full} [nonegotiate [master | slave]] } }no speed-duplex二、单交换机VLAN划分1、VLAN基本配置(1)新建VLAN:vlan <vlan-id>(2)命名VLAN:name <vlan-name>(3)为VLAN 分配交换机端口Switch(Config-If-Vlan1)#switchport interface Ethernet 0/2(4)设置Trunk 端口允许通过VLAN:Switch(Config-ethernet0/0/5)#switchport trunk allowed vlan 1;3;5-202、划分VLAN:(1)进入相应端口:Switch(config)#interface Ethernet 0/2(2)修改模式:Switch(Config-ethernet0/0/5)switchport mode access(3)划分VLAN:Switch(Config-ethernet0/0/5)#switchport access vlan 4三、跨交换机VLAN划分(两台交换机作相同操作)1、新建VLAN2、划分VLAN3、修改链路模式(1)进入相应端口:Switch(config)#interface Ethernet 0/1(2)修改模式:Switch(config-if)#switchport mode trunk四、VLAN间主机的通信1、新建VLAN2、划分VLAN3、修改链路模式(1)进入相应端口:Switch(config)#interface Ethernet 0/1(2)修改模式:Switch(config-if)#switchport mode trunk注意:如果是三层交换机,在修改模式先封装802.1协议:Switch(config-if)#switchport trunk encapsulation dot1q4、建立VLAN子接口(1)、进入VLAN接口模式:Switch(config)#interface vlan 2(2)、设置VLAN子接口地址:Switch(config-if)#ip address 192.168.0.1 255.255.255.0(3)、打开端口:Switch(config-if)#no shutdown5、设置各主机IP地址、子网掩码、网关注意:(1)各主机IP地址应与其所在的VLAN在同一网段。

(2)192.168.0.1/24中的“24”表示子网掩码为3个255。

(3)主机所在的VLAN的子接口地址就是主机的网关。

五、端口安全配置1、启用和禁用端口安全功能:启用:Switch(config-if)# switchport port-security禁用:Switch(config-if)# no switchport port-security2、设置接口上安全地址的最大个数(1~128)Switch(config-if)#switchport port-security maximum 13、设置处理违例的方式Switch(config-if)#switchport port-security violation shutdown4、手工配置接口上的安全地址Switch(config-if)#switchport port-security mac-address 00d0.d373.B0605、查看安全配置:Switch#show port-security六、设置广播风暴抑制功能Switch(Config)#broadcast-suppression <packets>参数:<packets>代表每秒钟允许通过的广播数据报的个数,取值范围为1~262143。

七、端口聚合1、创建port group:Switch(Config)#port-group 1//数字范围1-162、把物理端口加入组:Switch(Config-Ethernet0/0/1)#port-group 1 mode active3、进入port-channel 配置模式:Switch(Config)#interface port-channel 1第二部分路由器配置一、路由器基本配置1、基础配置Router>en //进入特权模式Router#config //进入全局配置模式Router(Config)#hostname DCR //定义路由器的名字为DCRDCR (Config)#enable password //特权用户的口令Current password:出厂配置无特权用户的口令Newpassword:****** //输入口令,如“123456”Confirmnewpassword:****** //确认口令。

DCR (Config)#telnet admin password 7 admin //配置远程用户的口令Router(Config-Serial2/0)#physical-layer speed 64000//配置时钟频率二、静态路由配置1、命令:ip route <目的IP> <子网掩码> {<接口名称>|<下一跳IP地址>} [<路由优先级>]<preference>为路由优先级,取值范围为1~255,preference的值越小优先级越高。

Router(config)#ip route 1.1.1.0 255.255.255.0 2.1.1.12、默认路由ip route 0.0.0.0 0.0.0.0{<接口名称>|<下一跳IP地址>} [<路由优先级>]三、单臂路由1、打开端口:2、进入子接口配置IP地址,并封装dot1q协议到对应的VLAN。

Router_config#interface f0/0.1Router(config_f0/0.1)#ip address 192.168.100.1 255.255.255.0Router(config_f0/0.1)#encapsulation dot1Q 100 //封装dot1Q到VLAN 100Route(config_f0/0.1)#exitRouter_config#interface f0/0.2Router(config_f0/0.2)#ip address 192.168.200.1 255.255.255.0Router(config_f0/0.2)#encapsulation dot1Q 200 //封装dot1Q到VLAN 200Router(config_f0/0.2)#exit四、动态路由协义配置1、RIP协议在DCR路由器上运行RIP路由协议的基本配置很简单,通常只需打开RIP开关、使能发送和接收RIP数据报,即按RIP缺省配置发送和接收RIP数据报(DCR路由器缺省发送RIP-II接收RIP-I和RIP-II)(1)启动RIP协议:Router(config)#router rip(2)配置RIP协义版本:Router(config-router-rip)#version 2(3)配置接口使能发送/接收RIP数据报Router(config-serial2/0)#ip rip work(4)配置引入路由(缺省路由权值、配置RIP中引入其它协议的路由)❶缺省路由权值:Router(config-router-rip)#default-metric 3 //权值可设1-16❷路由重分发:redistribute { static | ospf } [ metric <value> ]缺省情况下,路由器不引入其它路由。

<value>值指定以多大的路由权值引入路由,不指定则按缺省路由权值(default-metric)引入,取值范围1~16。

Router(config-router-rip)#redistribute ospf metric 52、OSPF协议(1)启动OSPF协议(必须)Router(Config)#router ospf(2)配置运行OSPF路由器的ID号(可选)router id <router_id><router_id>为路由器ID号,以IP地址表示,点分十进制格式。

相关文档
最新文档