四级网络工程师路由器、交换机、防火墙配置全集

上传人:沈*** 文档编号:142004411 上传时间:2022-08-24 格式:DOC 页数:12 大小:120KB
收藏 版权申诉 举报 下载
四级网络工程师路由器、交换机、防火墙配置全集_第1页
第1页 / 共12页
四级网络工程师路由器、交换机、防火墙配置全集_第2页
第2页 / 共12页
四级网络工程师路由器、交换机、防火墙配置全集_第3页
第3页 / 共12页
资源描述:

《四级网络工程师路由器、交换机、防火墙配置全集》由会员分享,可在线阅读,更多相关《四级网络工程师路由器、交换机、防火墙配置全集(12页珍藏版)》请在装配图网上搜索。

1、四级网络工程师路由器、交换机、防火墙配置全集一、DHCP的配置1、首先要设置排除的IP router(config)# ip dhcp excluded-address 192.168.1.1 192.168.1.99 2、设置IP地址池名称 router(config)# ip dhcp pool 123/test 3、设置地址池的子网及掩码 router(dhcp-config)# network 192.168.1.0 255.255.255.0 or network 192.168.1.0 /24 4、默认网关 router(dhcp-config)# default-router 2

2、01.23.98.1 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 co

3、mmunity 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 i

4、ncluded 视阀名为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) #

5、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 in

6、side 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

7、inside 192.168.0.1 255.255.255.0PIX525(config)# ip address outside 202.113.79.1 255.255.255.2404、指定要进行转换的内部地址:nat 格式:nat(if-name) nat_id local_ip netmask 例:PIX525(config)# nat(inside) 1 192.168.0.1 255.255.255.05、指定外部地址范围(地址池)格式:global(if-name) nat_id ip_address-ip_addressnet_mask global_mask 例:PIX5

8、25(config)# global(outside) 1 202.113.79.1-202.113.79.11 6、设置指向内网和外网的指定路由 route (config)#route(if-name) 0 0 gateway_ip metric例:PIX525(config)# route(outside) 0 0 210.81.20.1 1 7、设置静态路由 static 一对一转换 (config)#static(internal-if-name,external-if-name) outside_ip_address inside_ip_address例:PIX525(config

9、)# static(inside,outside) 202.113.79.4 192.168.0.4 8、允许数据流从安全级别较低的接口流向较高的接口 conduit 格式:(config)#conduit permit|deny global_ip port-port protocol foreign_ipnet_mask例:PIX525(config)# conduit permit tcp host 192.168.0.4 eq www any 允许全部外部主机访问192.168.0.4的www服务。 9、启用、禁止、改变一个服务或协议通过PIX防火墙 fixup PIX525(conf

10、ig)# 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 202.112.49.49 255.255.255.252 Router(config-if)#bandwidth 1000000 Router(config-if)#duplex full

11、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)#encap

12、sulation ppp Router(config-if)#async default ip address 202.112.78.119 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

13、)#description toShenZhen Router(config-if)#bandwidth 2048 典型带宽:2.048M Router(config-if)#ip address 212.112.41.81 255.255.255.252 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 shutdo

14、wn 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 212.92.37.18 255.255.255.252 Router(config-if)#crc 32 Router(config-if)#pos f

15、raming 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 192.167.167.6 255.255.255.255 Router(config-if)#no ip rou

16、te-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、只允许源

17、地址为211.105.130.0 255.255.255.0子网上的主机登陆路由器 (1)全局模式下配置 Router(config)#access-list 10 permit 211.105.130.0 0.0.0.255 (2)配置接口Router(config)#line vty 0 5Router(config-line)#access-class 10 inRouter(config-line)#exit2、只允许源地址为 182.105.130.111 和 222.112.7.56两台主机登陆路由器(1)全局下配置Router(config)#access-list 20 per

18、mit 182.105.130.111Router(config)#access-list 20 permit 222.112.7.56Router(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 10.0.0.0 0.255.255.255 logR

19、outer(config)#access-list 30 deny 192.168.0.0 0.0.255.255Router(config)#access-list 30 deny 127.0.0.0 0.255.255.255Router(config)#access-list 30 deny 172.16.0.0 0.15.255.255Router(config)#access-list 30 permit any(2)配置接口Router(config)#int e0/3Router(config-if)#ip access-group 30 in(二)扩展ACL 两个命令: acc

20、ess-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)

21、 在扩展或是标准访问控制模式下配置过滤规则 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)接口

22、配置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 202.112.60.230 any logRouter(config)#access-list 110 deny ip any host 202.112.60.230 logRouter(config)#acce

23、ss-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协议,只允许162.105.141.0/24和202.38.97.0/24子网的ICMP数据包通过路由器(1)在全局配置模式下Router(config)#access-list 198 permit icmp 162.105.141.0 0.0.0.255

24、 anyRouter(config)#access-list 198 permit icmp 202.38.97.0 0.0.0.255 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)#exi

25、t使用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 inRo

26、uter(config-if)#ip access-group 130 outRouter(config-if)#exit 用名字标识访问控制表的配置方法 1、禁止源地址为非法地址的数据包进入路由器或从路由器输出(1)在全局配置模式下Router(config)#ip access-list standard testRouter(config-std-nacl)#deny 10.0.0.0 0.255.255.255 logRouter(config-std-nacl)#deny 127.0.0.0 0.255.255.255 logRouter(config-std-nacl)#deny

27、192.168.0.0 0.0.255.255Router(config-std-nacl)#deny 172.16.0.0 0.15.255.255Router(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(co

28、nfig)#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)#i

29、p 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 Sw

30、ith-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 o

31、ff (二)建立删除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

32、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、封装VL

33、AN协议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-i

34、f) # 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:

35、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

36、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-PH

37、Y-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)直接链路失

38、效 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,状态直接转换为转发状态 命令格式:span

39、ning-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 spantr

40、ee 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 backbonef

41、ast 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 spa

42、ntree 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 bud

43、ufilter 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 po

44、rtfast 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 159.105.0.0Router(config-router)#network

45、 212.112.7.0Router(config-router)#exitRouter(config)#exit 2、配置被动端口 passive-interface 限出 Router(config)#router ripRouter(config-router)#passive-interface ethernet 0 Router(config-router)#exit 3、配置路由过滤 distribute-list 限入 Router(config)# access-list 10 deny anyRouter(config)# router ripRouter(config-ro

46、uter)# distribute-list 10 in ethernet 0 4、配置管理距离 distance 5、定义邻居路由器 neighbor 单播发送路由信息Router(config)#router ripRouter(config-router)#distance 111Router(config-router)#neighbor 202.172.7.2Router(config-router)#exit十一、OSPF设置 总结: 1、全局模式下,启动OSPF进程 router ospf 2、在路由OSPF配置模式下 network area 3、使用area range定义参

47、与OSPF的子网地址 area range 4、配置由外部引入到OSPF的参数 (1)花费 redistribute metric (2)标记 redistribute tag (3)配置外部引入的路由类型 redistribute connected metric-type 1 subnets 缺省为类型2 5、被动端口、邻居路由配置与RIP相同 1、单个IP地址参与OSPFRouter(config)#router ospf 88Router(config-router)#network 131.107.25.1 0.0.0.0 area 0Router(config-router)#ex

48、itRouter(config)#exit 2、网络地址参与OSPFRouter(config)#router ospf 88Router(config-router)#network 133.181.0.0 0.0.255.255 area 0Router(config-router)#exitRouter(config)#exit 3、使用area range命令定义参与OSPF的子网地址Router(config)#router ospf 88Router(config-router)#area 0 range 212.37.123.0 255.255.255.0Router(confi

49、g-router)#exitRouter(config)#exit 4、被动接口与RIP相同 第三层交换机的被动接口: Router(config)#router ospf 88Router(config-router)#passive-interface vlan 3 5、路由过滤、管理距离配置与RIP相同 6、外部引入花费、标记 Router(config-router)# redistribute metric 100 Router(config-router)# redistibute tag 10 7、外部引入路由类型Router(config)#router ospf 88Router(config-router)#redistribute connected metric-type 1 subnets12

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

copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!