已阅读5页,还剩11页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
第一部分 交换机配置一、基础配置1、模式进入Switch Switchen Switch#configSwitch(Config)#interface ethernet 0/22、配置交换机主机名 命令:hostname 3、配置交换机IP地址Switch(Config)#interface vlan 1 Switch(Config-If-Vlan1)#ip address 51 Switch(Config-If-Vlan1)#no shut4、为交换机设置Telnet授权用户和口令:登录到Telnet的配置界面,需要输入正确的用户名和口令,否则交换机将拒绝该Telnet用户的访问。该项措施是为了保护交换机免受非授权用户的非法操作。若交换机没有设置授权Telnet用户,则任何用户都无法进入交换机的Telnet配置界面。因此在允许Telnet方式配置管理交换机时,必须在Console的全局配置模式下使用命令username privilege password (0 | 7) 为交换机设置Telnet授权用户和口令并使用命令authentication line vty login local打开本地验证方式,其中privilege选项必须存在且为15。例:SwitchenableSwitch#configSwitch(config)#username test privilege 15 password 0 testSwitch(config)#authentication line vty login localSwitch(Config)#telnet-user test password 0 testSwitch (Config)#telnet-server enable:/启动远程服务功能 5、配置允许Telnet管理交换机的地址限制(单独IP或IP地址段)(1)限制单个IP允许Telnet登录交换机switch(config)#authentication security ip (2)限制允许IP地址段Telnet登录交换机switch(config)#access-list 1 permit 55 switch(config)#authentication ip access-class 1 in5、为交换机设置Web授权用户和口令:web-user password 0|7 例:Switch(Config)#web-user admin password 0 digital 6、设置系统日期和时钟:clock set 7、设置退出特权用户配置模式超时时间exec timeout /单位为分钟,取值范围为03008、保存配置:write9、显示系统当前的时钟:Switch#show clock10、指定登录用户的身份是管理级还是访问级Enable level visitor|admin 11、指定登录配置模式的密码:Enable password level visitor|admin 12、配置交换机的用户名密码:username admin privilege 15 password 0 admin00013、配置enable密码为ddd:enable password 0 ddd level 1514、配置登录时认证:authentication line vty login local15、设置端口的速率和双工模式(接口配置模式下)命令: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 (2)命名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 (3)、打开端口:Switch(config-if)#no shutdown5、设置各主机IP地址、子网掩码、网关 注意:(1)各主机IP地址应与其所在的VLAN在同一网段。 (2)/24中的“24”表示子网掩码为3个255。 (3)主机所在的VLAN的子接口地址就是主机的网关。五、端口安全配置1、启用和禁用端口安全功能: 启用:Switch(config-if)# switchport port-security 禁用:Switch(config-if)# no switchport port-security2、设置接口上安全地址的最大个数(1128) 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 参数:代表每秒钟允许通过的广播数据报的个数,取值范围为1262143。七、端口聚合 1、创建port group:Switch(Config)#port-group 1 /数字范围1-16 2、把物理端口加入组:Switch(Config-Ethernet0/0/1)#port-group 1 mode on3、进入port-channel 配置模式:Switch(Config)#interface port-channel 1 4、修改链路模式:switchport mode trunk第二部分 路由器配置一、路由器基本配置1、进入特权模式:Routeren2、进入全局配置模式:Router#config 3、定义路由器的名字为DCR :Router(Config)#hostname DCR 4、特权用户的口令:DCR (Config)#enable password 1234565、启动远程服务功能:DCR (Config)#telnet-server enable6、配置远程用户的口令:DCR (Config)#telnet admin password 7 admin7、配置时钟频率:Router(Config-Serial2/0)#physical-layer speed 640008、配置用户登录路由器时认证:aaa authentication login default local line enable9、配置进入特权模式时认证:aaa authentication enable default enable10、配置路由器的用户名密码:username admin password 0 admin00011、配置进入特权模式密码:enable password 0 admin000 level 15二、静态路由配置1、命令:ip route | 为路由优先级,取值范围为1255,preference的值越小优先级越高。Router(config)#ip route 2、默认路由 ip route | 三、单臂路由1、打开端口:2、进入子接口配置IP地址,并封装dot1q协议到对应的VLAN。Router_config#interface f0/0.1Router(config_f0/0.1)#ip address Router(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 Router(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 缺省情况下,路由器不引入其它路由。值指定以多大的路由权值引入路由,不指定则按缺省路由权值(default-metric)引入,取值范围116。Router(config-router-rip)#redistribute ospf metric 52、OSPF协议(1)启动OSPF协议(必须) Router(Config)#router ospf(2)配置运行OSPF路由器的ID号(可选)router id 为路由器ID号,以IP地址表示,点分十进制格式。缺省情况下,不配置路由器ID号,OSPF运行时从各接口的IP地址中选一个作为路由器ID号。Router(config)#router id (3)配置运行OSPF的网络范围(可选) network area Router(Config-Router-Ospf)#network 55 area 1(4)配置接口所属的域(必须) ip ospf enable area 要在某一个接口上运行OSPF协议,必须首先指定该接口属于一个区域。此命令用来在接口配置所属域。为该接口所属区域的区域号。缺省情况下,接口不配置成属于某个区域。Router(Config-Serial2/0)#ip ospf enable area 1(5)配置OSPF引入路由参数配置引入外部路由的缺省参数(缺省类型、缺省标记值、缺省代价值、缺省时间间隔和缺省数量上限)缺省类型:default redistribute type 1 | 2 Router(Config-Router-Ospf)# default redistribute type 1 缺省标记值:default redistribute tag /范围12147483647Router(Config-Router-Ospf)# default redistribute tag 0x80000001 缺省代价值:default redistribute cost /范围165535Router(Config-Router-Ospf)# default redistribute cost 10 缺省时间间隔:default redistribute interval /范围165535Router(Config-Router-Ospf)# default redistribute interval 3 缺省数量上限:default redistribute limit /范围165535Router(Config-Router-Ospf)# default redistribute limit 100配置在OSPF中引入其它协议的路由(路由重分发)redistribute ospfase connected | static | rip type 1 | 2 tag metric connected表示引入直连路由作为外部路由信息,static表示引入静态路由作为外部路由信息,rip表示引入RIP协议发现路由作为外部路由信息;type指定路由的代价类型,1和2分别表示第一类外部路由和第二类外部路由;tag指定路由的标记,为路由的标记值,取值范围12147483648;metric指定路由的代价,为路由的代价值,取值范围116777215。缺省情况下,OSPF不引入外部路由。Router(Config-Router-Ospf)#redistribute ospfase rip type 1 tag 3 metric 203、策略路由 新建源网络访问控制列表 Router(config)#ip access-list net1Router(config)# permit 55 设置路由表 Router(config)#route-map pbr /建立路由表,名字为PBR Router(config-route-map)#Match ip address net1 /配置匹配该路由表的网络 Router(config-route-map)#Match length 150 1500 /设置报文的长度范围 Router(config-route-map)#Set ip next-hop /下一跳地址 应用到接口 Router(config)#int g0/4 Router(config)#ip policy route-map pbr五、网络地址转换1. 设置指定接口作为网络地址转换的限定接口:ip nat inside|outside Router#config Router(config)#interface ethernet 0 Router(config-ethernet0)#ip nat inside2. 配置静态NAT/NAPT映射NAT:ip nat inside source static Router(config)#ip nat inside static source NAPT: Router(config)#ip nat inside source static tcp 1024 1024Router(config)#ip nat inside source static udp 1024 10243. 配置动态NAT/NAPT映射(1)配置允许进行地址转换的内部私有地址;Router(config)#access-list 1 permit 55(2)配置动态NAT地址转换使用的外部公有地址的地址池; Router(config)#ip nat pool pool-1 0 netmask (3)建立内部私有地址与地址池或NAT外部接口的映射关系 Router(config)#ip nat inside source list 1 pool pool-1 overload六、PPP协议配置PPP(Point-to-Point Protocol)协议是为在点到点链路上传输数据包而设计的,它是在点到点链路上承载网络层数据包的一种链路层协议。PPP协议可以承载多种网络层协议数据包,如IP和IPX,并提供PAP、CHAP、MS-CHAP三种安全认证方式,以防止未经许可的非法用户访问。PPP支持串口同步和异步两种模式。PPP配置,需先在接口做好基础配置(接口IP,时钟频率等。)1、PAP:验证方建立数据库,被验证方发送相同用户名密码。(1)验证方:建立用户名、密码:Router(config)#user dcr password 0 aa进入接口,封装PPP:Router(config-serial2/0)#encapsulation ppp选择验证方式PAP:Router(config-serial2/0)#ppp authentication pap(2)被验证方:进入接口,封装PPP:Router(config-serial2/0)#encapsulation ppp发送对方的用户名密码:Router(config-serial2/0)#ppp pap sent-username dcr password 0 aa2、CHAP:发送的用户名必须是对方主机名,双方发送的密码要一致。(1)验证方:建立用户名、密码:Router(config)#user RB password aa进入接口,封装PPP:Router(config-serial2/0)#encapsulation ppp选择验证方式CHAP:Router(config-serial2/0)#ppp authentication chap(2)被验证方:建立用户名密码:Router(config)#user RA password aa进入接口,封装PPP:Router(config-serial2/0)#encapsulation ppp注意:神州数码设备配置必须开启AAA本地认证。 Router(config)# aaa authentication ppp default local第三部分 其它配置一、MSTP配置(MSTP是基于STP或RSTP的,因此在配置前应开启任一模式)1、开启生成树 命令:spanning-tree2、设置交换机运行生成树的模式 命令:spanning-tree mode mstp|stp3、进入MSTP域配置模式 命令:spanning-tree mst configuration4、为域命名(域配置模式) 命令:name 5、将实例应用到VLAN(域配置模式) 命令:instance vlan 6、设置实例的优先级(在全局模式配置) 命令:spanning-tree mst priority 7、设置当前端口指定实例的优先级值(端口配置模式下) 命令:spanning-tree mst port-priority 二、ACL配置(一)、标准的ACL access-list 10 deny | permit | any-source | host-source (二)、命名标准ACL1、命名ip access-list standard acb2、制定规则deny | permit | any-source | host-source 3、应用到接口ip access-group 名称 in/out(三)、扩展的ACLaccess-list 102 deny | permit 协议类型 | any-source | host-source | any-destination | host-destination precedence tostime-range(四)、命名扩展ACL1、命名ip access-list extended acb2、制定规则no deny | permit 协议类型 | any-source | host-source | any-destination | host-destination precedence tostime-range3、应用到接口(五)、MAC命名扩展ACL1、命名:mac-ip-access-list extended 2、制定规则deny|permitany-source-mac|host-source-mac|any-destination-mac|host-destination-mac|例:在SW3的3号接口上,要求mac为00-FF-51-FD-AE-15的主机不能访问行政部的主机MAC地址为:E0-94-67-05-5D-84,其余主机正常访问。mac-ip-access-list extended aaa deny host-source-mac 00-FF-51-FD-AE-15 host-destination-mac E0-94-67-05-5D-843、应用到接口 ip access-group 名称 in/out(六)、制定时间范围1、命名no time-range 2、一周之内的循环时间no absolute-periodicMonday|Tuesday|Wednesday|Thursday|Friday|Saturday|SundaytoMonday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday 或noperiodicMonday+Tuesday+Wednesday+Thursday+Friday+Saturday+Sunday|daily| weekdays | weekend to 3、绝对时间范围noabsolute start end 三、DHCP 配置1、创建地址池 命令:ip dhcp pool 2、配置地址可分配的范围及其它参数 (1)配置地址可分配范围 命令:network-address | (2)配置地址池租用期限 命令:lease | infinite (3)配置DHCP客户机的缺省网关 命令:default-router (4)配置DHCP客户机的DNS服务器地址 命令:dns-server (5)配置WINS服务器的地址 命令:netbios-name-server (6)配置DHCP客户机的节点类型 命令:netbios-node-type b-node|h-node|m-node|p-node| (7)配置WWW服务器的地址 命令:option ascii | hex | ipaddress (8)排除某个地址或地址范围不用于动态分配 命令:ip dhcp excluded-address (9)配置DHCP客户机的域名 命令:domain-name (10) 打开DHCP服务器Ping方式检测地址冲突的功能命令:ip dhcp conflict ping-detection enable3、启用DHCP服务 命令:service dhcp4、DHCP手工分配(1)、创建地址池 命令:ip dhcp pool (2)、绑定IP与MAC A.命令:host | B.命令:hardware-address Ethernet | IEEE802|(3)、client-name 5、DHCP Snooping(1)、开启 DHCP Snooping 命令:ip dhcp snooping enable(2)、设置信任端口 (1)进入端口 (2)设置信任端口 命令:ip dhcp snooping trust(3)、设置自动防御动作 命令:ip dhcp snooping action shutdown|blackhole recovery 四、ARP配置1、配置静态ARP 表项Switch(Config-Vlan1)#arp 00-03-0f-f0-12-342、ARP GUARD添加 ARP GUARD 地址: arp-guard ip 3、防ARP 扫描1) 启动防ARP 扫描功能SwitchA(config)#anti-arpscan enable2)配置信任/超级信任端口 SwitchA (Config-If-Ethernet0/0/2)#anti-arpscan trust port /信任端口SwitchA (Config-If-Ethernet0/0/19)#anti-arpscan trust supertrust-port /超级信任3)配置信任IP SwitchA(config)#anti-arpscan trust ip 00 4) 配置自动恢复时间 Switch(Config)#anti-arpscan recovery enable /先在交换机上启动自动恢复功能 SwitchA(config)#anti-arpscan recovery time 36004、设置基于端口的防ARP 扫描的接收ARP 报文的阈值 Switch(Config)#anti-arpscan port-based threshold 205、设置基于IP 的防ARP 扫描的接收ARP 报文的阈值 Switch(Config)#anti-arpscan port-based threshold 66、显示ARP 映射表:Switch#sh arp五VRRP配置(一)在三层交换机上配置VRRP1、进入要配置的接口(端口或虚拟子接口)2、进入VRRP协义配置模式(两个设备的编号要一致) DG5950(config)# router vrrp 13、配置虚拟网关DG5950(config-router)#virtual-ip 54 /虚拟网关,两边必须一致4、设置优先级DG5950 (config-router)#priority 2005、配置抢占模式(可选) DG5950(config-router)# preempt-mode true6、启动VRRP DG5950(config-router)#enable 7、查看VRRP Ruijie# show vrrp brief(二)在路由器上配置VRRP1、进入要配置的子接口并配置虚拟子接口IP,封装到指定VLAN。(单臂)RB_config#interface GigaEthernet0/3.10 RB_config-if#ip address 54 RB_config-if#encapsulation dot1Q 102、配置置虚拟网关 RB_config-if#vrrp 10 associate 50 3、配置优先级 RB_config-if#vrrp 10 priority 1504、配置抢占模式(可选) RB_config-if#vrrp 10 preempt5、配置要监听的上行端口 RB_config-if#vrrp 10 track interface GigaEthernet0/4 30六 802.1XSwitch(Config)#interface vlan 1 /创建VLANSwitch(Config-if-vlan1)#ip address /配置IP地址Switch(Config-if-vlan1)#exit Switch(Config)#radius-server authentication host /配置认证服务器地址Switch(Config)#radius-server accounting host /配置计费服务器地址Switch(Config)#radius-server key test /配置RADIUS 认证密钥Switch(Config)#aaa enable /开启交换机的aaa认证功能Switch(Config)#aaa-accounting enable /开启交换机的计费功能Switch(Config)#dot1x enable /打开交换机全局的802.1x 功能Switch(Config)#interface ethernet 0/0/2 /进入端口Switch(Config-Ethernet0/0/1)#dot1x enable /打开交换机端口的802.1x 功能Switch(Config-Ethernet0/0/1)#dot1x port-method macbased /接口的接入方式为macbasedSwitch(Config-Ethernet0/0/1)#dot1x port-control auto /接口的控制方式为autoSwitch(Config-Ethernet0/0/1)#exit七NTP配置例:客服端Switch(config)#ntp enable /开启NTP功能Switch(config)#ntp server 1 /配置时间服务器地址Switch(config)#ntp server 1 /配置时间服务器地址八端口镜像设置1、指定镜像源端口:Switch(Config)#monitor session source interface e 端口列表tx,rx,bothrx为镜像源 端口接收的流量;tx为镜像从源端口发出的流量;both为源端口入和出的流量。2、指定镜像目的端口; Switch(Config)#monitor session destination interface 例:S4600-28P-SI(config)#monitor session 1 source interface e1/0/1S4600-28P-SI(config)#monitor session 1 destination interface e1/0/3九Qos(一) 路由器的Qos网络组件处理接收通信量溢出的一个方法是:使用队列算法对通信按照优先次序排在输出链接上。一般有:FIFO,PQ(Priority Queuing),CQ(Custom Queuing),SFQ(Fair Queuing)以及WFQ(Weighted Fair Queuing)。1. PQ(Priority Queuing)配置任务序列 1) 定义特定的访问控制列表(如果要用到它们的话) 2) 创建优先级列表 priority-list protocol high | medium | normal | low 或:priority-list interface high | medium | normal | low *任何不匹配优先级队列中任何一行的流量将被放入到缺省队列中。对于优先级队列,如果没有定义,缺省队列是normal。下面的命令用于安排一个缺省队列: priority-list default high | medium |normal |low*为了给每一个优先级队列指定所能够容纳的最大数据包个数,可以在全局配置模式下使用下面的命令: priority-list queue-limit 3) 把优先级列表应用到接口上 priority-group 4) 配置接口上的驱动队列长度 (可选项)serial queue 取值可为2、4、8和16配置示范:配置串口1的驱动队列长度为4。Router(config)#interface serial 2/0Router(config-serial2/0)#serial queue 45) 验证队列过程(可选项)show queuing priority例:Router(config)#queue-list 1 protocol ip 1 tcp 23 放入到高优先级队列Router(config)#priority-list 1 interface ethernet 0 high /接口0的流量都被放入到高优先级Router(config)#priority-list 1 protocol ip middle /IP流量被放入到medium队列中Router(config)#priority-list 1 protocol ipx middle /IPX流量被放入到medium队列中Router(config)#priority-list 1 default low /缺省队列是LOWRouter(config)#priority-list 1 queue-limit 10 40 60 90 /high,middle,normal,low的10,40,60,902. CQ(Custom Queuing)配置任务序列 1) 定义特定的访问控制列表(如果要用到它们的话) 2) 创建自定义队列 queue-list protocol *使用如下命令,可以指定任何经过一特定接口进入路由器的数据流到一特定队列: queue-list interface 3) 指定自定义队列的最大容量 queue-list queue limit 使用以下命令能改变字节总数阈值: queue-list queue byte-count 4) 把自定义队列应用到接
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 浙江国企招聘-2025杭州上城区城市建设投资集团有限公司下属子公司公开招聘工作人员12人历年真题汇编及答案解析(夺冠)
- 2026年注册岩土工程师考试题库200道附参考答案【满分必刷】
- 2026水利部黄河水利委员会事业单位招聘高校毕业生265人模拟试卷带答案解析
- 2026年网络预约出租汽车驾驶员从业资格考试题库及答案【网校专用】
- 2025广东工贸职业技术学院招聘事业编制工作人员11人备考题库附答案解析
- 2026重庆气象部门事业单位招聘应届生3人(一)历年真题汇编带答案解析
- 2025西安藤信学校、西安藤信高级中学招聘历年真题库附答案解析
- 2025山东潍坊市技师学院招聘高层次、高技能人才10人备考公基题库附答案解析
- 2025海南三亚市第二人民医院第三次(考核)招聘员额制人员29人(第1号)笔试模拟试卷附答案解析
- 萍乡市人民医院2025年公开招聘编外人员(第三批)历年真题库附答案解析
- 第9章 钢中的回火转变
- 门诊病历管理规定
- 腹直肌分离康复(产后康复课件PPT)
- 携手共育 静待花开 家长会课件
- 酒驾处罚书格式(标准版)
- 六年级上册音乐课件-《今天是你的生日》人音版
- 总承包人用于本工程施工的机械设备表
- 《地理科学导论》第6章基本原理
- 供货、安装、调试、验收方案
- 土地整理平整工程外观质量评定项目表
- 2021年注册消防工程师继续教育题库
评论
0/150
提交评论