




已阅读5页,还剩7页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
四级网络工程师路由器、交换机、防火墙配置全集一、DHCP的配置1、首先要设置排除的IP router(config)# ip dhcp excluded-address 9 2、设置IP地址池名称 router(config)# ip dhcp pool 123/test 3、设置地址池的子网及掩码 router(dhcp-config)# network or network /24 4、默认网关 router(dhcp-config)# default-router 5、设置地址池域名 router(dhcp-config)# domain-name 6、设置地址池租用时间 router(dhcp-config)# lease 0 8 30 7、取消地址冲突记录日志 router(dhcp-config)# no ip dhcp conflict logging router(config)#二、SNMP配置 1、创建或修改对团体的访问控制 (config)# snmp-server community CommName view ViewName ro|rw ACL_no 例:(1)(config) # snmp-server community public ro 4(2)(config) # snmp-server community admin view part rw 访问mib库的范围由视阀part决定2、创建或修改一个视阀 (config)# snmp-server view include|exclude 对象标识及子树,是这个视阀包含(included)或排除(excluded)的MIB库对象的标识符。例:(1)(config) # snmp-server view part mib-2 included 全部MIB2库(2)(config) # snmp-server view ext system included 视阀名为ext包含system snmp-server view ext cisco included 和cisco的所有对象 3、设置路由器的snmp代理具有发通知的功能 (config)# snmp-server enable traps 通知类型| 4、在某个接口的配置模式下,指定当该接口断开或连接时需向管理站发出通知 (config-if)# snmp traps link-status 5、设置接收通知的管理站 (config)# snmp-server host traps|informs version 1|2c udp-port 例:(1)(config) # snmp-server enable traps(2)(config) # snmp-server host public三、路由的NAT配置 1、设置内网端口 (config-if)# ip nat inside 2、设置外网端口(config-if)# ip nat outside四、防火墙的配置 PIX525 基本配置命令:nameif, interface, ip address, nat, global, route, static, conduit, fixup 1、配置防火墙接口的名字并指定安全级 nameifPIX525(config)# nameif ethernet0 inside security100PIX525(config)# nameif ethernet1 outside security0PIX525(config)# nameif dmz security50 2、配置以太网接口参数 interfacePIX525(config)# interface ethernet0 autoPIX525(config)# interface ethernet1 100fullPIX525(config)# interface ethernet0 shutdown3、配置网卡IP地址 ip addressPIX525(config)# ip address inside PIX525(config)# ip address outside 404、指定要进行转换的内部地址:nat 格式:nat(if-name) nat_id local_ip netmask 例:PIX525(config)# nat(inside) 1 5、指定外部地址范围(地址池)格式:global(if-name) nat_id ip_address-ip_addressnet_mask global_mask 例:PIX525(config)# global(outside) 1 -1 6、设置指向内网和外网的指定路由 route (config)#route(if-name) 0 0 gateway_ip metric例:PIX525(config)# route(outside) 0 0 1 7、设置静态路由 static 一对一转换 (config)#static(internal-if-name,external-if-name) outside_ip_address inside_ip_address例:PIX525(config)# static(inside,outside) 8、允许数据流从安全级别较低的接口流向较高的接口 conduit 格式:(config)#conduit permit|deny global_ip port-port protocol foreign_ipnet_mask例:PIX525(config)# conduit permit tcp host eq www any 允许全部外部主机访问的www服务。 9、启用、禁止、改变一个服务或协议通过PIX防火墙 fixup PIX525(config)# fixup protocol http 80 启用http,端口80PIX525(config)# no fixup protocol smtp 禁用smtp协议五、路由电口配置 Router(config)#int g0/1 Router(config-if)#description To-BeijingWaiGuoYuXueYuan Router(config-if)#ip address 9 52 Router(config-if)#bandwidth 1000000 Router(config-if)#duplex full Router(config-if)#no ip directed-broadcast Router(config-if)#no ip proxy-arp Router(config-if)#no shutdown Router(config-if)#exitRouter(config)#exit六、路由广域网配置 1、配置异步串行口(modem) Router(config)#int a1 Router(config-if)#description To-ISP Router(config-if)#ip unnumbered ethernet 0 Router(config-if)#encapsulation ppp Router(config-if)#async default ip address 19 Router(config-if)#async dynamic routing Router(config-if)#async mode interactive Router(config-if)#no shutdown Router(config-if)#exitRouter(config)#exit 2、配置调整同步串行口(DDN专线、FR、卫星、微波) Router(config)#int serial 0/3/0 Router(config-if)#description toShenZhen Router(config-if)#bandwidth 2048 典型带宽:2.048M Router(config-if)#ip address 1 52 Router(config-if)#encapsulation ppp (sdlc is default ;frame-relay) Router(config-if)#no ip directed-broadcast Router(config-if)#no ip proxy-arp Router(config-if)#no shutdown Router(config-if)#exitRouter(config)#exit 3、配置POS口(155M,622M,2.5G,10G) Router(config)#interface POS 0/3 Router(config-if)#description to-TianjinUniversity Router(config-if)#bandwidth 2500000 Router(config-if)#ip address 8 52 Router(config-if)#crc 32 Router(config-if)#pos framing sdh /sonet Router(config-if)#no ip directed-broadcast Router(config-if)#pos flag s1 s0 2 /0 Router(config-if)#no shutdown Router(config-if)#exitRouter(config)#exit 4、配置loopback Router(config)#int loopback 0 Router(config-if)#ip address 55 Router(config-if)#no ip route-cache Router(config-if)#no ip mroute-cache Router(config-if)#exit Router(config)#exit Router#七、ACL总结: 标准ACL:199, 13001999扩展ACL:100199,20002699应用line vty接口时使用 access-class 其他接口时使用 ip access-group 定义ACL有两个命令:access-list ip access-listaccess-list 只能用ACL号ip access-list 可以用ACL号、名字标识 (一)标准访问控制列表 1、只允许源地址为 子网上的主机登陆路由器 (1)全局模式下配置 Router(config)#access-list 10 permit 55 (2)配置接口Router(config)#line vty 0 5Router(config-line)#access-class 10 inRouter(config-line)#exit2、只允许源地址为 11 和 6两台主机登陆路由器(1)全局下配置Router(config)#access-list 20 permit 11Router(config)#access-list 20 permit 6Router(config)#access-list 20 deny any (2)配置接口Router(config)#line vty 0 5Router(config-line)#access-class 20 inRouter(config-line)#exit 3、禁止源地址为非法地址的数据包进入路由或从路由输出(1)全局下配置Router(config)#access-list 30 deny 55 logRouter(config)#access-list 30 deny 55Router(config)#access-list 30 deny 55Router(config)#access-list 30 deny 55Router(config)#access-list 30 permit any(2)配置接口Router(config)#int e0/3Router(config-if)#ip access-group 30 in(二)扩展ACL 两个命令: access-list和 ip access-list 1、access-list命令格式 access-list access-list-number permit|deny protocol source wildcard-mask destination wildcard-mark operator operandprotocol: ip、icmp、tcp、udpoperator: gt、lt、eq、neq operand: 端口号 2、ip access-list命令格式 1) ip access-list standard|extend access-list-number|name 2) 在扩展或是标准访问控制模式下配置过滤规则 permit|deny protocol source wildcard-mask destination wildcard-mask operator operand 3、配置端口用 ip access-group使用access-list命令: 1、拒绝转发所有IP地址进出的,端口号为1434的UDP协议数据包。(1)在全局配置模式下Router(config)#access-list 130 deny udp any any eq 1434Router(config)#access-list 130 permit ip any any(2)接口配置Router(config)#int e0/2Router(config-if)#ip access-group 130 inRouter(config-if)#ip access-group 130 outRouter(config-if)#exit 2、封禁某一台主机(1)在全局配置模式下Router(config)#access-list 110 deny ip host 30 any logRouter(config)#access-list 110 deny ip any host 30 logRouter(config)#access-list 110 permit ip any any(2)接口配置Router(config)#int e0/3Router(config-if)#ip access-group 110 inRouter(config-if)#ip access-group 110 outRouter(config-if)#exit 3、封禁ICMP协议,只允许/24和/24子网的ICMP数据包通过路由器(1)在全局配置模式下Router(config)#access-list 198 permit icmp 55 anyRouter(config)#access-list 198 permit icmp 55 anyRouter(config)#access-list 198 deny icmp any anyRouter(config)#access-list 198 permit ip any any(2)接口配置Router(config)#int e0/2Router(config-if)#ip access-group 198 inRouter(config-if)#ip access-group 198 outRouter(config-if)#exit使用ip access-list命令: 1、拒绝转发所有IP地址进与出方向的,端口号为1434的UDP协议数据包。(1)在全局配置模式下Router(config)#ip access-list extended 130Router(config-ext-nacl)#deny udp any any eq 1434Router(config-ext-nacl)#permit ip any anyRouter(config-ext-nacl)#exit(2)接口配置Router(config)#int f0/0Router(config-if)#ip access-group 130 inRouter(config-if)#ip access-group 130 outRouter(config-if)#exit 用名字标识访问控制表的配置方法 1、禁止源地址为非法地址的数据包进入路由器或从路由器输出(1)在全局配置模式下Router(config)#ip access-list standard testRouter(config-std-nacl)#deny 55 logRouter(config-std-nacl)#deny 55 logRouter(config-std-nacl)#deny 55Router(config-std-nacl)#deny 55Router(config-std-nacl)#permit any(2)接口配置Router(config)#int f0/0Router(config-if)#ip access-group test inRouter(config-if)#ip access-group test outRouter(config-if)#exit 2、禁止端口号为1434的UDP数据包和端口号为4444的TCP数据包(1)在全局配置模式下Router(config)#ip access-list extended block1434Router(config-ext-nacl)#deny udp any any eq 1434Router(config-ext-nacl)#deny tcp any any eq 4444Router(config-ext-nacl)#permit ip any anyRouter(config-ext-nacl)#exit(2)接口配置 Router(config)#int f0/0Router(config-if)#ip access-group block1434 inRouter(config-if)#ip access-group block1434 outRouter(config-if)#exit八、交换机VLAN配置(一)VTP协议配置(中继协议、干道协议)(二)建立、删除VLAN(三)为交换机端口分配VLAN(四)VLAN Trunk配置(一)VTP协议配置(中继协议、干道协议) 1、配置VTP域名 3548 Swith-PHY-3548 (config) # vtp domain pku 2、配置VTP工作模式 Swith-PHY-3548 (config) # vtp mode server Swith-PHY-3548 (config) # vtp mode client Swith-PHY-3548 (config) # vtp mode transparent 1、配置VTP域名 6500 Swith-PHY-6500 (enable) # set vtp domain pku 2、配置VTP工作模式 Swith-PHY-6500 (enable) # set vtp mode server Swith-PHY-6500 (enable) # set vtp mode client Swith-PHY-6500 (enable) # set vtp mode transparent Swith-PHY-6500 (enable) # set vtp mode off (二)建立删除VLAN3548:Swith-PHY-3548 (config) # vlan dataSwith-PHY-3548 (config-vlan) # vlan 100 name vlan00100Swith-PHY-3548 (config-vlan) # no vlan 100 6509: Swith-PHY-6500 (enable) # set vlan 999 name vlan999 Swith-PHY-6500 (enable) # clear vlan 999(三)为交换机端口分配VLAN3548: Swith-PHY-3548 (config) # int f0/24 Swith-PHY-3548 (config-if) # switchport mode access Swith-PHY-3548 (config-if) # switchport access vlan 248 6509:Swith-PHY-6500 (enable) # set vlan 25 5/20 (四)VLAN Trunk的配置3548:1、进入端口配置模式Swith-PHY-3548 (config) # int f0/242、配置VLAN Trunk模式Swith-PHY-3548 (config-if) # switchport mode trunk3、封装VLAN协议Swith-PHY-3548 (config-if) # switchport trunk encapsulation islSwith-PHY-3548 (config-if) # switchport trunk encapsulation dot1qSwith-PHY-3548 (config-if) # switchport trunk encapsulation negotiate P4、设置允许中继的VLANSwith-PHY-3548 (config-if) # switchport trunk allowed vlan 2Swith-PHY-3548 (config-if) # switchport trunk allowed vlan 10,20Swith-PHY-3548 (config-if) # switchport trunk allowed vlan 30-40Swith-PHY-3548 (config-if) # switchport trunk allowed vlan allSwith-PHY-3548 (config-if) # switchport trunk allowed vlan except 100-10006509:1、配置VLAN Trunk模式、封装VLAN协议 set trunk mode: on off type: dot1q isleq. 设置端口5/20为VLAN Trunk模式,封装dot1q协议Swith-PHY-6500 (enable) # set trunk 5/20 on dot1q2、设置允许中继的VLAN set trunk vlan eq. 在端口5/20的允许VLAN列表中添加30-42号VLAN Swith-PHY-6500 (enable) # set trunk 5/20 vlan 30-42从端口中删除VLANclear trunk 从端口5/20的允许vlan列表中删除3-36号VLANSwith-PHY-6500 (enable) # clear trunk 5/20 3-36九、交换机STP配置 总结:1STP 1 SubNet = 1 VLAN (一)35481、打开、关闭STP 命令格式:spanning-tree vlan no spanning-tree vlan eg. Swith-PHY-3548 (config) # spanning-tree vlan 3 Swith-PHY-3548 (config) # no spanning-tree vlan 32、配置根网桥和备份根网桥 命令格式:spanning-tree vlan root primaryspanning-tree vlan root secondary eg.Swith-PHY-3548 (config) # spanning-tree vlan 3 root primary Swith-PHY-3548 (config) # spanning-tree vlan 3 root secondary3、配置生成树优先级 命令格式:spanning-tree vlan priority 4096+ eg.Swith-PHY-3548 (config) # spanning-tree vlan 3 priority 8192 4、配置生成树可选功能(1)间接链路失效 backbonefast 命令格式:spanning-tree backbonefast(2)直接链路失效 uplinkfast (0-32000 packets/s) 命令格式:spanning-tree uplinkfast spanning-tree uplinkfast max-update-rate (3)端口跳过侦听和学习状态,直接从阻塞状态进入转发状态 portfast 命令格式:spanning-tree portfast default eg.Swith-PHY-3548 (config) # spanning-tree portfast default (4)配置BPDUFilter 在指定端口停止发送BPDU,不处理进入的BPDU,状态直接转换为转发状态 命令格式:spanning-tree portfast bpdufilter default eg.Swith-PHY-3548 (config) # spanning-tree portfast budpfilter default (二)65091、打开、关闭STP 命令格式:set spantree enable set spantree disable eg. Switch-phy-6509(enable)# set spantree enable 3 Switch-phy-6509(enable)# set spantree disable 32、配置根网桥和备份根网桥 命令格式:set spantree root set spantree root secondary eg. Switch-phy-6509(enable)# set spantree root 1,200-204 Switch-phy-6509(enable)# set spantree root secondary 1,200-2043、配置生成树优先级 命令格式:set spantree priority eg. Switch-phy-6509(enable)# set spantree priority 81924、配置生成树可选功能(1)backbonefast 格式:set spantree backbonefast enableset spantree backbonefast disable eg. Switch-phy-6509(enable)# set spantree backbonefast enable(2)uplinkfast 格式:set spantree uplinkfast enableset spantree uplinkfast enable rate 单位:packets/100ms 默认:15 eg. Switch-phy-6509(enable)# set spantree uplinkfast enable rate 40(3)portfast 格式:set spantree portfast enableset spantree portfast disableset spantree portfast defaulteg. Switch-phy-6509(enable)# set spantree portfast 3/2 enable(4)BPDU filter格式:set spantree portfast budufilter enableset spantree portfast budufilter disableset spantree portfast budufilter enableset spantree portfast budufilter disableset spantree portfast budufilter default eg. Switch-phy-6509(enable)# set spantree portfast bpdufilter enable Switch-phy-6509(enable)# set spantree portfast bpdufilter disable Switch-phy-6509(enable)# set spantree portfast bpdufilter 3/5 enable Switch-phy-6509(enable)# set spantree portfast bpdufilter 3/5 disable Switch-phy-6509(enable)# set spantree portfast bpdufilter 3/5 default十、RIP设置 路由设置通式 ip route 注意是下一跳路由器,不是本路由器对应端口RIP协议的特性:(1)周期性30s (2)交换全部的路由(full routing) (3)交换对象全部邻居1、基本配置 Router(config)#router ripRouter(config-router)#network Router(config-router)#network Router(config-router)#exitRouter(config)#exit 2、配置被动端口 passive-interface 限
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 英文口语面试题库及答案
- 银行有关人力试题及答案
- 银行信贷试题及答案
- 语言专业期末试题及答案
- 建筑专业试题及答案
- 遥感专业面试题目及答案
- 文职专业课试题及答案
- 航运专业笔试题及答案
- 金融专业硕士试题及答案
- 湖南省三湘名卷2025年中考历史教学最后一卷(含答案)
- 愿你慢慢长大
- HND商务文化和策略
- 马克思主义政治经济学概论
- 小班-社会语言-懂礼貌的好宝宝-课件(互动版)
- 一次性竹质餐具(刀、叉、匙)通用技术要求 DB43-T 2648-2023
- 健身理论与指导课件
- 驾驶员从业资格证电子版
- 西北农林《工程水文学》课后习题
- 朝天区东溪河大桥建设工程(主引道)行洪论证与河势稳定评价报告
- 国土空间规划概述课件
- 中国历史简介
评论
0/150
提交评论