一、组网需求
在不改变现有网络拓扑前提下,将防火墙NGFW以透明模式部署到网络中,放在路由器和交换机之间,防火墙为透明模式,对内网网段192.168.1.0/24的上网进行4~7层的安全防护。
二、拓扑图

三、配置要点
1、Internet_R路由器的基础配置
2、将防火墙配置为透明模式并开启网管
3、配置安全策略允许内网PC访问互联网
四、配置步骤
1、Internet_R路由器的基础配置
hostname Internet_R
!
interface Ethernet0/0
ip address 192.168.1.99 255.255.255.0
no shutdown
ip nat inside
!
interface Ethernet0/1
ip address 202.100.1.179 255.255.255.0
no shutdown
ip nat outside
!
ip route 0.0.0.0 0.0.0.0 202.100.1.192
!
access-list 101 permit ip any any
ip nat inside source list 101 interface Ethernet0/1 overload
2、将防火墙配置为透明模式并开启网管
进入设备命令行(CLI)中进行配置,将模式修改为"透明模式"同时为设备配置好管理地址和网关。
FortiGate-VM64-KVM # config system global
FortiGate-VM64-KVM (global) # set hostname FortiGate_Transparent
FortiGate_Transparent (global) # set timezone 55
FortiGate_Transparent (global) # set language simch
FortiGate-VM64-KVM (global) # end
FortiGate_Transparent #
FortiGate_Transparent # config system settings
FortiGate_Transparent (settings) # set opmode transparent // 修改FGT的运行模式为透明模式,默认为NAT路由模式。,注意切换透明模式防火墙需要防火墙没有相关接口、策略、路由等配置。
FortiGate_Transparent (settings) # set manageip 192.168.1.100 255.255.255.0 // 配置可以管理防火墙的本地IP和网关,以便HTTP/SSH管理防火墙及防火墙的服务更新。
FortiGate_Transparent (settings) # set gateway 192.168.1.99
FortiGate_Transparent (settings) # end
Changing to TP mode
FortiGate_Transparent # execute ping 192.168.1.99
PING 192.168.1.99 (192.168.1.99): 56 data bytes
64 bytes from 192.168.1.99: icmp_seq=0 ttl=255 time=0.7 ms
64 bytes from 192.168.1.99: icmp_seq=1 ttl=255 time=0.9 ms
64 bytes from 192.168.1.99: icmp_seq=2 ttl=255 time=0.8 ms
64 bytes from 192.168.1.99: icmp_seq=3 ttl=255 time=0.9 ms
64 bytes from 192.168.1.99: icmp_seq=4 ttl=255 time=0.7 ms
--- 192.168.1.99 ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max = 0.7/0.8/0.9 ms
FortiGate_Transparent #
FortiGate_Transparent # get system status
Version: FortiGate-VM64-KVM v6.2.0,build0866,190328 (GA)
Virus-DB: 1.00000(2018-04-09 18:07)
Extended DB: 1.00000(2018-04-09 18:07)
Extreme DB: 1.00000(2018-04-09 18:07)
IPS-DB: 6.00741(2015-12-01 02:30)
IPS-ETDB: 0.00000(2001-01-01 00:00)
APP-DB: 6.00741(2015-12-01 02:30)
INDUSTRIAL-DB: 6.00741(2015-12-01 02:30)
Serial-Number: FGVM01TM19000127
IPS Malicious URL Database: 1.00001(2015-01-01 01:01)
Botnet DB: 1.00000(2012-05-28 22:51)
License Status: Warning
License Expires: 2020-01-14
Log hard disk: Not available
Hostname: FortiGate_Transparent
Operation Mode: Transparent
Current virtual domain: root
Max number of virtual domains: 10
Virtual domains status: 0 in NAT mode, 1 in TP mode
Virtual domain configuration: disable
FIPS-CC mode: disable
Current HA mode: standalone
Branch point: 0866
Release Version Information: GA
FortiOS x86-64: Yes
System time: Mon Jul 1 12:48:30 2019
注意:透明模式下,所有的接口都无法写入IP地址,整机只有一个设备IP地址。当需要从某个接口管理设备时,需在命令行下开启相应接口的管理权限!
例如需要通过内网PC管理FortiGate:

没有开启Port2网管协议之前:
(MGMT1或MGMT2口默认有管理权限),以要通过port1(LAN)接口管理设备为例,开启port1(LAN)管理FGT的命令如下:
FortiGate_Transparent # config system interface
FortiGate_Transparent (interface) # edit port1
FortiGate_Transparent (port1) # set allowaccess https http ping ssh // 允许网管协议从Port1接口通过https/http/SSH/Ping访问透明模式的FortiGate
FortiGate_Transparent (port1) # end
FortiGate_Transparent #
3、配置安全策略允许内网PC访问互联网
默认情况下透明模式的FortiGate没有开启任何策略,此时TCP/UDP/ICMP的流量是全部不通的:

例如默认FGT没有策略的情况下,内网PC访问网关和互联网资源都是被Drop的:

如果需要想要IPV4业务可以通的话,则需要配置相应的安全策略:

建议先给接口一个别名,这样配置策略的时候可以很清楚的知道接口的位置和功能:
注意:建议在不需要的情况下关闭接口配置下的“设备探测”(Device detection)功能,该功能用于MAC地址厂商设备信息识别及MAC地址过滤,会消耗较多的设备资源。



然后再配置安全策略:



五、验证效果
然后再次使用内网PC测试业务:

测试下载一个病毒测试文件(测试网址:http://www.eicar.org/ 里面的download网址:http://2016.eicar.org/85-0-Download.html):


查看UTM日志:

如果是下载HTTPS的网址的病毒,由于数据被HTTPS加密,如需要检测需要开启SSL深度检测,需要在策略中调用SSL深度检测同时开启代理模式:

测试HTTPS加密的AV文件下载:




查看对应的UTM日志:

透明模式的策略和路由模式的策略使用起来几乎一样,没有太多的特别之处。