上一篇文章中,我们讲述了双防火墙的基础配置,也就是利用心跳线配置防火墙的HRP,发生故障的时候,自动切换。 由于核心交换机还没配置完成,所以也不便测试,今天这篇文章会完结,所以后面会有故障测试的截图。 照顾到没看上一篇文章的读者,还是要把拓扑图贴一下,便于文章的阅读。 重申一下,上图中,AR1代表运营商双出口网络,事实上并不存在这台设备;并且,银行也并没有采用PPPOE链路,只是为了顺便展示一下PPPOE的配置而已。 两台华为的防火墙,fw1为主,fw2为备;两台华为核心交换机,没有采用堆叠技术,而是采用VRRP技术进行配置。 一、核心交换机的基础配置[SW1]int Eth-Trunk 12 [SW1-Eth-Trunk12]mode lacp-static //两台核心交换机配置eth-trunk,并且设定聚合模式 [SW1-Eth-Trunk12]trunkport GigabitEthernet 0/0/2 to 0/0/3 [SW1-Eth-Trunk12]q [SW1]vlan batch 10 20 100 //创建VLAN [SW1]port-group group-member Eth-Trunk 12 GigabitEthernet 0/0/1 g0/0/4 g0/0/5 [SW1-port-group]p l t //网络设备之间的连接接口配置为trunk模式 [SW1-port-group]p t a v a //允许所有VLAN通过 [SW1-port-group]quit [SW1]int g0/0/6 [SW1-GigabitEthernet0/0/6]p l a //6口和7口配置为access模式,并且划在VLAN100内 [SW1-GigabitEthernet0/0/6]p d v 100 [SW1-GigabitEthernet0/0/6]q [SW1]int g0/0/7 [SW1-GigabitEthernet0/0/7]p l a [SW1-GigabitEthernet0/0/7]p d v 100 [SW1-GigabitEthernet0/0/7]q 核心2的配置,基本上差不多,就不再重复了,下面两台接入层的交换机,也很简单 二、接入交换机的基础配置[SW3]vlan batch 10 20 100 [SW3]port-group group-member e0/0/1 e0/0/2 [SW3-port-group]p l t [SW3-port-group]p t a v a [SW3-port-group]q [SW3]int e0/0/3 [SW3-Ethernet0/0/3]p l a [SW3-Ethernet0/0/3]p d v 10 [SW3-Ethernet0/0/3]q [SW4]vlan batch 10 20 100 [SW4]port-group group-member e0/0/1 e0/0/2 [SW4-port-group]p l t [SW4-port-group]p t a v a [SW4-port-group]q [SW4]port-group group-member e0/0/3 e0/0/4 [SW4-port-group]p l a [SW4-port-group]p d v 20 [SW4-port-group]q 三、交换机配置MSTP和VRRP[SW1]stp mode mstp //切换为mstp模式,应该是默认值,稳妥起见,还是输入一遍吧 [SW1]stp region-configuration [SW1-mst-region]region-name huawei [SW1-mst-region]revision-level 1 [SW1-mst-region]instance 1 vlan 10 100 //sw1主要跑vlan10和vlan100的数据流量 [SW1-mst-region]instance 2 vlan 20 [SW1-mst-region]ac region-configuration [SW1-mst-region]quit [SW1]stp instance 1 root primary [SW1]stp instance 2 root secondary [SW1]int g0/0/6 //6和7接口是连接电脑和服务器,所以设置为边缘端口,加快STP收敛 [SW1-GigabitEthernet0/0/6]stp edged-port enable [SW1-GigabitEthernet0/0/6]int g0/0/7 [SW1-GigabitEthernet0/0/7]stp edged-port enable [SW1-GigabitEthernet0/0/7]q MSTP配完了,紧接着配置VRRP [SW1]int vlan 10 [SW1-Vlanif10]ip add 192.168.10.1 24 [SW1-Vlanif10]vrrp vrid 1 virtual-ip 192.168.10.254 [SW1-Vlanif10]vrrp vrid 1 priority 120 [SW1-Vlanif10]quit [SW1]int vlan 20 [SW1-Vlanif20]ip add 192.168.20.1 24 [SW1-Vlanif20]vrrp vrid 2 virtual-ip 192.168.20.254 [SW1-Vlanif20]q 继续配置DHCP Server [SW1]dhcp enable [SW1]ip pool VLAN10 [SW1-ip-pool-vlan10]network 192.168.10.0 mask 24 [SW1-ip-pool-vlan10]excluded-ip-address 192.168.10.1 192.168.10.10 [SW1-ip-pool-vlan10]gateway-list 192.168.10.254 [SW1-ip-pool-vlan10]dns-list 114.114.114.114 [SW1-ip-pool-vlan10]q [SW1]int Vlanif 10 [SW1-Vlanif10]dhcp select global [SW1-Vlanif10]q [SW1]ip pool VLAN20 [SW1-ip-pool-vlan20]network 192.168.20.0 mask 24 [SW1-ip-pool-vlan20]excluded-ip-address 192.168.20.1 192.168.20.10 [SW1-ip-pool-vlan20]gateway-list 192.168.20.254 [SW1-ip-pool-vlan20]dns-list 114.114.114.114 [SW1-ip-pool-vlan20]q [SW1]int vlan 20 [SW1-Vlanif20]dhcp select global [SW1-Vlanif20]q [SW2]stp region-configuration [SW2-mst-region] region-name huawei [SW2-mst-region] revision-level 1 [SW2-mst-region] instance 1 vlan 10 100 [SW2-mst-region] instance 2 vlan 20 [SW2-mst-region] active region-configuration [SW2]stp instance 1 root secondary [SW2]stp instance 2 root primary //sw2主要跑vlan20的数据流量 [SW2]int vlan 10 [SW2-Vlanif10]ip address 192.168.10.2 24 [SW2-Vlanif10]vrrp vrid 1 virtual-ip 192.168.10.254 [SW2-Vlanif10]q [SW2]int vlan 20 [SW2-Vlanif20]ip address 192.168.20.2 24 [SW2-Vlanif20]vrrp vrid 2 virtual-ip 192.168.20.254 [SW2-Vlanif20]vrrp vrid 2 priority 120 [SW2-Vlanif20]q [SW2]ip pool vlan10 [SW2-ip-pool-vlan10] gateway-list 192.168.10.254 [SW2-ip-pool-vlan10] network 192.168.10.0 mask 255.255.255.0 [SW2-ip-pool-vlan10] excluded-ip-address 192.168.10.1 192.168.10.10 [SW2-ip-pool-vlan10] dns-list 114.114.114.114 [SW2]ip pool vlan20 [SW2-ip-pool-vlan20] gateway-list 192.168.20.254 [SW2-ip-pool-vlan20] network 192.168.20.0 mask 255.255.255.0 [SW2-ip-pool-vlan20] excluded-ip-address 192.168.20.1 192.168.20.10 [SW2-ip-pool-vlan20] dns-list 114.114.114.114 [SW2-ip-pool-vlan20]q [SW2]dhcp enable [SW2]int vlan 10 [SW2-Vlanif10]dhcp se gl [SW2-Vlanif10]q [SW2]int vlan 20 [SW2-Vlanif20]dhcp se gl [SW2-Vlanif20]q 两台核心交换机上都配置了DHCP,你们猜会不会有地址池冲突?会不会有DHCP服务冲突? 不仅是两台核心,下面的接入层交换机,也要做相应的配置 [SW3]stp region-configuration [SW3-mst-region] region-name huawei [SW3-mst-region] revision-level 1 [SW3-mst-region] instance 1 vlan 10 100 [SW3-mst-region] instance 2 vlan 20 [SW3-mst-region] active region-configuration [SW3]int e0/0/3 [SW3-Ethernet0/0/3]stp ed enable [SW3-Ethernet0/0/3]q [SW4]stp region-configuration [SW4-mst-region] region-name huawei [SW4-mst-region] revision-level 1 [SW4-mst-region] instance 1 vlan 10 100 [SW4-mst-region] instance 2 vlan 20 [SW4-mst-region] active region-configuration [SW4]int e0/0/3 [SW4-Ethernet0/0/3]stp edged-port enable [SW4-Ethernet0/0/3]q [SW4]int e0/0/4 [SW4-Ethernet0/0/4]stp edged-port enable [SW4-Ethernet0/0/4]q 一顿操作猛如虎,PC拿到IP; 四、与防火墙对接的配置:[SW1]vlan 111 [SW1-vlan111]q [SW1]int Vlanif 111 [SW1-Vlanif111]ip add 172.16.111.1 24 [SW1-Vlanif111]quit [SW1]ospf router-id 172.1.1.1 [SW1-ospf-1]area 0 [SW1-ospf-1-area-0.0.0.0]net 192.168.10.1 0.0.0.0 [SW1-ospf-1-area-0.0.0.0]net 192.168.20.1 0.0.0.0 [SW1-ospf-1-area-0.0.0.0]net 172.16.111.1 0.0.0.0 [SW1-ospf-1-area-0.0.0.0]q [SW2]vlan 112 [SW2-vlan112]q [SW2]int vlan 112 [SW2-Vlanif112]ip add 172.16.112.2 24 [SW2-Vlanif112]q [SW2]ospf router-id 172.16.112.2 [SW2-ospf-1]area 0 [SW2-ospf-1-area-0.0.0.0]network 192.168.10.2 0.0.0.0 [SW2-ospf-1-area-0.0.0.0]network 192.168.20.2 0.0.0.0 [SW2-ospf-1-area-0.0.0.0]net 172.16.112.2 0.0.0.0 [SW2-ospf-1-area-0.0.0.0]q 上一篇文章中,两台防火墙也配置了OSPF,现在OSPF能跑起来了: 这时候,PC1和PC2是无法访问PC3和Server1的,因为PC3和Server1在VLAN10里面,而VLAN10的网关是防火墙的VRRP IP,有些人会问,VLAN10的网关为什么不放在交换机的VRRP上呢? 因为,服务器更需要安全防护,所以访问服务器必须经过防火墙先生的同意和监管,嘿嘿。 所以,我们需要配置相应的安全策略才行。 security-policy rule name in2server //创建安全策略,名称自己知道意义就行 source-zone trust //源安全区域:trust destination-zone dmz //目的安全区域:dmz destination-address 192.168.100.0 mask 255.255.255.0 //目标地址 service ftp //FTP服务 service http //HTTP服务 service icmp //Ping服务 action permit //行为:允许 这条安全策略的意思是:允许trust区域内的电脑访问DMZ区域内的服务器,但仅限于http、ftp,ping只是为了测试而已,加不加无所谓,先测试一下吧。 Client1能够访问Server1上面的HTTP服务了,紧接着再来一条上网的策略吧: security-policy rule name internet source-zone dmz local trust //local是指防火墙本身,要不要允许连接互联网,那就见仁见智了 destination-zone untrust //互联网肯定是untrust区域 action permit 想上互联网,只有安全策略还不行,还要配置NAT策略: nat-policy rule name internet source-zone trust action source-nat easy-ip 配置完成,来模拟一下防火墙故障,看看VRRP是否会自动切换,直接在模拟器中“停止”FW1,PC1上tracert检查出路径: 从上图中可以看到,FW1故障之前,PC1是走PPPOE拨号的宽带出去的,FW1故障掉线后,PC1就从固定IP的链路出去了。 再来看防火墙的VRRP状态吧: FW2已经接替FW1,成为VLAN100的Master设备,说明防火墙VRRP配置正确,及时响应,没有影响PC上网; 再看一下交换机的VRRP,因为FW1的故障,核心交换机的VRRP也会感知,从而切换Master角色: 虽然只是FW1挂了,核心1在正常工作中,但是由于链路down了,所以,此刻的核心2还是独自承担了所有,VLAN10和VLAN20的数量流量全部走核心2了。 至此,双防火墙+双核心交换机的配置基本上完成,后面就是一些细节上的调整和完善了。
|
|