Asymmetric Routing and Other FortiGate Layer 2 Instalation Issues
Asymmetric Routing and Other FortiGate Layer 2 Instalation Issues
Asymmetric Routing and Other FortiGate Layer 2 Instalation Issues
Asymmetric routing and other FortiGate layer-2 installation issues Technical Note
Document Version: Second Release
Publication Date: September 28, 2004
Description: This document provides information about FortiGate Antivirus Firewall
Transparent Mode installation issues. Subject areas include asymmetric routing,
stateful inspection, networks loops, spanning tree protocol, ARP forwarding, and
using VLANs and virtual domains with Layer-2 switches with global MAC
addresses.
Source: The original version of this document was written by Bill Cormier for the Fortinet
Sales Certification Lab. More information has been added in response to user
comments.
Product: FortiOS v2.80
Document Number: 01-28005-0113-20040928
Fortinet Inc.
© Copyright 2004 Fortinet Inc. All rights reserved.
No part of this publication including text, examples, diagrams or illustrations may be reproduced,
transmitted, or translated in any form or by any means, electronic, mechanical, manual, optical or
otherwise, for any purpose, without prior written permission of Fortinet Inc.
Asymmetric routing and other FortiGate layer-2 installation issues Technical Note
Trademarks
Products mentioned in this document are trademarks or registered trademarks of their respective holders.
Regulatory Compliance
FCC Class A Part 15 CSA/CUS
Send information about errors or omissions in this document or any Fortinet technical documentation to
[email protected].
Table of Contents
Transparent Mode............................................................................................................... 5
How it works.................................................................................................................... 5
Configuration requirements............................................................................................. 5
Considerations ................................................................................................................ 6
Solutions ......................................................................................................................... 7
Other Asymmetric routing cases ................................................................................... 10
Other Layer 2 Considerations ........................................................................................... 13
Network Loops .............................................................................................................. 14
Spanning Tree Protocol ................................................................................................ 14
Other Layer 2 Protocols ................................................................................................ 14
Layer-2 switches with global MAC addresses and ARP forwarding ............................. 15
Check your settings ...................................................................................................... 16
Conclusion .................................................................................................................... 16
Transparent Mode
FortiGate units can be configured to operate in either NAT/Route or Transparent
mode.
In NAT/Route mode, the FortiGate unit is a Layer 3 device. This means that each of its
interfaces is associated with a different IP subnet and that it appears to other devices
as a router. This is how a firewall is normally deployed.
In Transparent mode, the FortiGate unit does not change the Layer 3 topology. This
means that all of its interfaces are on the same IP subnet and that it appears to other
devices as a bridge. Typically, the FortiGate unit is deployed in Transparent mode
when it is intended to provide antivirus and content filtering behind an existing firewall
solution.
A FortiGate unit in Transparent mode can also perform firewalling. Even though it
takes no part in the Layer 3 topology, it can examine Layer 3 header information and
make decisions on whether to block or pass traffic.
How it works
In Transparent mode, the FortiGate unit acts invisible to the IP network. Similar to a
network bridge, all of the FortiGate interfaces must be on the same subnet. In order to
perform antivirus and content filtering, it performs IP packet filtering and forwarding.
After applying firewall filtering rules called policies, the FortiGate unit assembles
packets into content and scans for viruses and attacks, and filters out banned content
from email and web traffic. The FortiGate unit then forwards packets in their original
format.
Configuration requirements
Although a unit operating in Transparent mode does not alter the Layer 3 topology, it
still requires basic configuration to operate as a node on the IP network. As a
minimum, the unit must be configured with an IP address and subnet mask. These are
used for management access and to allow the unit to receive antivirus and IPS
signature file updates. Also, the unit must have sufficient route information to reach:
• the management station (such as a browser, telnet, SSH or SNMP management
system),
• the FortiProtect Network servers,
• the DNS server(s).
A static route is required whenever the FortiGate unit connects to a router to reach a
destination. If all of the destinations are located on the external network, you may be
required to enter only a single default route. If, however, the network topology is more
complex, you may be required to enter one or more static routes in addition to the
default route.
Considerations
In complex designs there may be more than just a default route out of the local
network. In these cases it may become more difficult to place the FortiGate unit into
the network in order to properly forward the traffic. If placed in the wrong position, an
asymmetrical routing circumstance may cause some traffic to be blocked.
Consider the following network diagram.
Internet
Router
NAT Firewall
CONSOLE 1 2 3 4 / HA
FortiGate
SYN/ACK
Esc Enter
SYN
SYN/ACK
SYN
192.168.1.0 SYN
SYN/ACK
Router Router
10.1.1.0 172.16.1.0
Client B Client C
In this network, a problem may occur where sessions from Client A work well getting
to both the Intranet (internal) Web server and the Internet (external) web servers, and
sessions from Client B or Client C can get to the Internet just fine, but can not get to
the Intranet Web Server.
This is shown more clearly by the colored dotted lines. For Client A, which resides on
the same subnet as the Intranet server, the green line shows that traffic going both to
and from the server stays on the same subnet and therefore never passes through the
FortiGate unit. Also for Client C, the dark blue lines, traffic going out to the Internet is
symmetrical because both the send and receive traffic passes through the FortiGate
unit’s stateful packet inspection firewall. This works fine.
For Client B, the red line shows that traffic originates from the Client and passes
through a router to get to the destination server. However, the server, not normally
aware of other networks that are not directly connected, will pass the responses up to
its default router, which is in front of the FortiGate unit. So the FortiGate unit being a
stateful packet filter will only see the response and not the initial session request and
will, therefore, block the incomplete session traffic.
Solutions
A few different workarounds can be used to correct this problem. The easiest
approach may be to just move the FortiGate unit to sit in front of the firewall instead of
behind it to avoid the asymmetrical routing issue. In this case sessions that are routed
to the default gateway will not be filtered out. See Figure 2.
Internet
Router
Esc Enter
CONSOLE 1 2 3 4 / HA
FortiGate
192.168.1.0
Router Router
10.1.1.0 172.16.1.0
Client B Client C
Another possible solution is to add static routes to the server, so that it knows how to
connect directly to other networks, without having to go through the default router.
This may involve more work than above if you have a large number of servers to
configure. Alternatively, if the FortiGate model has an available port, you can create a
separate server DMZ network off of one of the ports on the FortiGate unit. This would
allow all traffic going to and from the servers to pass through the Fortigate unit and
provide the added benefit of performing antivirus and intrusion attack filtering on
internal network traffic going to and from the Intranet servers. See Figure 3 below.
Internet
Router
NAT Firewall
Esc Enter
CONSOLE 1 2 3 4 / HA
FortiGate
DMZ SYN
SYN SYN/ACK
SYN/ACK
192.168.1.0
Router Router
10.1.1.0 172.16.1.0
Client B Client C
A solution of last resort would be to turn off stateful inspection on the FortiGate unit.
This would resolve the asymmetric routing problem without moving the FortiGate unit,
but would cause the FortiGate unit to lose the ability to detect and prevent some
hacker attacks.
Use the following commands to turn off stateful inspection and enable asymmetric
routing.
config system global
set asymroute enable
end
Internet
Esc Enter
CONSOLE 1 2 3 4 / HA
FortiGate
IP 192.168.1.25
Layer 2 Switch
with VLANs
192.168.2.0 192.168.1.0
Client B Client A
Default Route Default Route
192.168.2.1 192.168.1.1
In this case both Client A and B can get out to the Internet just fine. But only Client A,
the green line, can perform management functions on the FortiGate unit. Client B, the
red line, is unable to PING, Telnet, or connect a Browser to the FortiGate Management
agent. Again as a stateful inspection firewall, the FortiGate unit associates sessions
with interfaces and when it sees an IP session request coming from one interface and
then the same session request repeating back through a different interface, it
assumes the second one is invalid.
In most cases, simply relocating the FortiGate unit to be in front of the default router
will eliminate these problems.
Here is another design case where the stateful inspection engine breaks the traffic
flow. See Figure 5.
VPN
Remote Sites
Internet
VPN Tunnel
External Network
External Port
FortiGate In
Transparent Mode
CONSOLE 1 2 3 4 / HA
Esc Enter
FortiGate
Internal Port
Router
Internal Network
In this case all traffic from the Internal network to the External network flows well (blue
line), with or without AV scanning enabled. However, traffic from VPN users (red lines)
going to the Internet, External to Internal, stops when AV scanning is enabled. The
problem here is that the AV scanning engine proxy sees the same session twice, once
coming into the FortiGate from the VPN concentrator and then again when the
session goes back out to the Internet and comes back again. The second time it
thinks that there is a session state problem and drops the session.
Unfortunately, enabling asymmetrical routing only affects the firewall stateful function,
not the AV proxy engine so there is no easy fix to this issue.
There are a number of possible solutions to this problem.
• Do not AV scan the VPN traffic.
• Have the router proxy or NAT the traffic before sending it to the firewall, so that
different source/destination addresses appear for each session.
• Move the FortiGate unit to be in-line with the firewall only, so that it doesn't see the
VPN traffic until it goes out to the Internet (see Figure 6).
• Use two FortiGate units such that one will scan all VPN incoming traffic and one
will scan all Internal to External traffic (see Figure 7).
VPN
Remote Sites
Internet
VPN Tunnel
External Network
External Port
CONSOLE 1 2 3 4 / HA
Esc Enter
FortiGate
Internal Port
Router
Internal Network
VPN
Remote Sites
Internet
VPN Tunnel
VPN Concentrator
FortiGate (#1)
Router
External Port
CONSOLE 1 2 3 4 / HA
Esc Enter
FortiGate (#2)
Internal Port
Network Loops
Before enabling other Layer 2 forwarding options, be sure to consider if doing so will
cause any network loop conditions. A loop occurs when there are two Layer 2 paths
from a source to a destination. Typically a loop condition is caused by plugging in two
cables to the same switch or hub from the same Layer 2 source network. This can
cause a broadcast storm. A broadcast storm occurs when a device ARPs for an
address, the ARP broadcast will go out one port and loop back around through the
other port and be repeated back out again rapidly over and over causing all other
network traffic to be hindered. This can usually be easily detected by seeing port
activity indicator lights on hubs and switches all lit up and continuously on or rapidly
flashing in tandem. The Spanning Tree protocol is sometimes used to automatically
detect and block network loops, and, therefore, prevent broadcast storms.
Note: You should enable l2forward for every interface that is receiving non-IP traffic.
By default, ARP forwarding is enabled on the FortiGate unit and ARP packets
received by the FortiGate unit on one VLAN subinterface are forwarded out every
other FortiGate VLAN subinterface. The switches can then receive multiple ARP
packets from the same source MAC but tagged with different VLAN IDs.
To resolve this problem, you can configure multiple virtual domains on the FortiGate
unit, 1 for each VLAN (this means one ingress and one egress VLAN added to each
virtual domain). ARP packets are not forwarded between virtual domains. As a result,
the switches do not receive multiple ARP packets from the same source MAC but
different VLANs and the instability does not occur.
Some switches support the ability to statically configure MAC addresses to multiple
ports. For example many Cisco switches that normally use a global MAC address
table will allow use of the command:
mac-address-table static hw-addr in-port out-port-list
Note: The show system interface command displays only commands that have been
changed from the default settings. Since ARP forwarding is enabled by default the set
arpforward enable command will not show in this display. You can confirm that ARP
forwarding is enabled by typing the command get system interface <name_str> for
each interface.
Conclusion
The FortiGate Antivirus Firewall is very flexible in its ability to work in Layer 2 or Layer
3 networks as long as you understand its capabilities and its limitations. Taking the
time to diagram the network installation can help you to understand the traffic flow and
avoid any pitfalls.