03 Getting Started With Sophos Firewall
03 Getting Started With Sophos Firewall
Sophos Firewall
Sophos Firewall
Version: 19.5v1
Sophos Firewall
FW1505: Navigating and Managing Sophos Firewall
November 2022
Version: 19.5v1
© 2022 Sophos Limited. All rights reserved. No part of this document may be used or reproduced
in any form or by any means without the prior written consent of Sophos.
Sophos and the Sophos logo are registered trademarks of Sophos Limited. Other names, logos and
marks mentioned in this document may be the trademarks or registered trademarks of Sophos
Limited or their respective owners.
While reasonable care has been taken in the preparation of this document, Sophos makes no
warranties, conditions or representations (whether express or implied) as to its completeness or
accuracy. This document is subject to change at any time without notice.
Sophos Limited is a company registered in England number 2096520, whose registered office is at
The Pentagon, Abingdon Science Park, Abingdon, Oxfordshire, OX14 3YP.
DURATION
11 minutes
When you have completed this chapter, you will be familiar with the Sophos Firewall WebAdmin
and understand how it uses objects as the building blocks for the configuration of rules and
policies.
When you first login to the WebAdmin you are presented with the Control Center, which provides a
live view of what is happening on the Sophos Firewall, and allows you to quickly identify anything
that requires your attention.
Down the left-hand side is the main menu for navigating the Sophos Firewall. This is divided into
four sections:
MONITOR & ANALYZE, provides access to information on the current activity on the Sophos
Firewall, and reports and diagnostic tools.
PROTECT, for configuring the rules, policies and settings related to protection features.
CONFIGURE, where you setup connectivity, routing, authentication and global settings.
SYSTEM, which houses the device access settings, as well as objects and profiles that are used
within rules and policies.
Each section that is accessible from the main menu is further broken down into tabs for accessing
each area of configuration.
On some screens additional, less frequently used tabs, can be accessed using the ellipses on the
right-hand side of the tabs.
Display additional
Settings for reports
In the Reports section there is an additional, Show Reports settings option, that allows you to
access some of the less often used options.
When the settings are accessed, the screen will flip to the additional options. You can identify
when you are on this screen because the title bar at the top of the page will be yellow.
Found in the top-right is the admin menu. Here you can reboot, shutdown, lock and logout of the
Sophos Firewall. This menu also provides links to the support website, the Sophos Firewall
licensing page, and web-based access to the console.
Found on every screen on the Sophos firewall is a context sensitive link to the online help file.
When clicked, it opens a separate window. This online version of the help is fully interactive, and
can be browsed by selecting the various menu items in the left side menu. It can also be searched
using keywords. When a search result is selected it will load the appropriate section within the
help file.
[Additional Information]
https://docs.sophos.com/nsg/sophos-firewall/18.5/Help/en-us/webhelp/onlinehelp/index.html
Next to the help link is the Log viewer, which opens in a new window to provide access to all log
files.
In the ‘Log viewer’ you can filter the logs and perform context sensitive actions. Other chapters in
the course will explore this in more detail.
Clicking the How-to guides link in the Web Admin takes you to the Sophos Community page.
This provides a link to a library of videos that demonstrate how to perform common tasks on
Sophos Firewall.
The Sophos Firewall uses objects as the building blocks for the configuration of rules and policies.
By defining reusable objects once for things such as hosts, services and networks, it can speed up
configuration, and simplify future changes by having a single place to make a change.
Objects can be created and edited ahead of time, but they can also be created inline when
configuring protection features. This means that you do not have to navigate away from what you
are configuring to create an object, because you will have the option to create it where you need
it.
There are two categories of object – hosts and services; and profiles. These can be found in the
SYSTEM section on the Sophos Firewall.
There are three types of host object on the Sophos Firewall: IP, MAC and FQDN
There are three types of host object on the Sophos Firewall: IP, MAC and FQDN.
IP host objects can represent a single IP address, a subnet, a range of IP addresses or a list of IP
address, for either IPv4 or IPv6.
The object has a name and then must be configured by IP version (IPv4 or IPv6) and a type. Note
that the IP version and type cannot be modified after the object has been created.
You then provide the data for the type of object you selected. Note that IP address lists are comma
separated.
IP host groups can be used to group IP host objects for IP addresses, networks and IP ranges, but
not IP lists.
MAC host objects can be created for individual MAC addresses or MAC address lists.
The MAC host object has a name and then must be configured for a specific type, either MAC
address or MAC list. This cannot be changed once the object has been saved.
FQDN host objects can include a wildcard prefix to resolve sub-domains, for example,
*.sophos.com.
FQDN host groups allow you to create a collection of FQDN host objects to further simplify the
using of objects in rules and policies.
Service based on
TCP and UDP ports
Service based on
IP protocol numbers
Service based on
ICMP types & codes
Each service object is for a single type, and can contain one or more definitions.
Sophos Firewall maintains a geo IP database that maps IP addresses to countries, and this is
automatically updated with the pattern definitions.
There are several predefined country groups that ship with Sophos Firewall, which can be edited.
You can also create custom groups of countries.
Decryption IPsec
• Settings for TLS decryption • IKE parameters for establishing tunnels
between two firewalls
Device access
• Roles for administrators
Profiles are a collection of settings that can be defined and used when configuring protection
features.
Upload firmware
Sophos Firewall has two firmware slots, one for the current active firmware, and the other that can
be updated with a new version. This means that if an issue is encountered with the running
firmware, the previous version can be booted.
Firmware can be downloaded automatically or uploaded manually. When there is a new firmware
version you will be prompted to upgrade when you login.
As well as uploading new firmware, you can select which firmware version to boot, or choose to
boot one of the firmware versions with the default factory settings.
Firmware updates require a valid support license. For devices that do not have a valid support
license applied, a banner is shown on the firmware page that shows the number of free firmware
updates that are left.
Three free firmware updates are provided, and mandatory updates that are installed as part of the
initial setup wizard are not counted towards this. Pattern updates are not affected.
The main menu is the primary navigation tool and is divided into four sections. Pages are
further broken down into tabs for accessing each area of configuration
Two types of object – hosts and services, and profiles – are used as the building blocks
for the configuration of rules and policies
Here are the three main things you learned in this chapter.
The main menu is the primary navigation tool and is divided into four sections. Pages are further
broken down into tabs for accessing each area of configuration.
The Sophos Firewall uses two types of object – hosts and services, and profiles - as the building
blocks for the configuration of rules and policies.
Sophos Firewall
Version: 19.0v1
[Additional Information]
Sophos Firewall
FW1515: Getting Started with Zones, Interfaces and Routing on Sophos Firewall
April 2022
Version: 19.0v1
© 2022 Sophos Limited. All rights reserved. No part of this document may be used or reproduced
in any form or by any means without the prior written consent of Sophos.
Sophos and the Sophos logo are registered trademarks of Sophos Limited. Other names, logos and
marks mentioned in this document may be the trademarks or registered trademarks of Sophos
Limited or their respective owners.
While reasonable care has been taken in the preparation of this document, Sophos makes no
warranties, conditions or representations (whether express or implied) as to its completeness or
accuracy. This document is subject to change at any time without notice.
Sophos Limited is a company registered in England number 2096520, whose registered office is at
The Pentagon, Abingdon Science Park, Abingdon, Oxfordshire, OX14 3YP.
Getting Started with Zones, Interfaces and Routing on Sophos Firewall 19.0v1 - 1
Getting Started with Zones and Interfaces on Sophos
Firewall
in this chapter you will learn how RECOMMENDED KNOWLEDGE AND EXPERIENCE
to use Sophos Firewall ✓ Navigating and Managing the Sophos Firewall using
WebAdmin to configure network the WebAdmin
zones and interfaces.
DURATION
8 minutes
in this chapter you will learn how to use Sophos Firewall WebAdmin to configure network zones,
interfaces and routing.
Getting Started with Zones, Interfaces and Routing on Sophos Firewall 19.0v1 - 2
Interfaces and Zones
A virtual interface is a logical representation of an interface, for example an alias that allows you to
bind multiple IP addresses to a single physical interface.
A zone is a grouping of interfaces. When used with firewall rules, zones provide a convenient
method of managing security and traffic for a group of interfaces.
Getting Started with Zones, Interfaces and Routing on Sophos Firewall 19.0v1 - 3
Zones
Sophos Firewall
LAN 1
Internet
LAN Zone
DMZ WAN Zone
LAN 2
We’ll start by looking at zones. Sophos Firewall is a zone-based firewall, and it is important to
understand what a zone is before we proceed to look at interfaces and routing.
When we talk about zones on the Sophos Firewall, we mean a logical group of networks where
traffic originates or is destined to.
Each interface is associated with a single zone, which means that traffic can be managed between
zones rather than by interface or network simplifying the configuration.
Interfaces and zones are not equivalent; multiple interfaces can be associated with a zone and
each zone can be made up of multiple networks.
Getting Started with Zones, Interfaces and Routing on Sophos Firewall 19.0v1 - 4
Zones are created and managed in:
Zones CONFIGURE > Network > Zones
• LAN – this is the most secure zone by default and is for your internal networks.
• WAN – this zone is used for external interfaces that provide Internet access.
• DMZ – this zone is for hosting publicly accessible servers.
• VPN – this is the only zone that does not have a physical port or interface assigned to it. When a
VPN is established, either site-to-site or remote access, the connection is dynamically added to
the zone and removed when disconnected.
• WiFi – this zone is for providing security for wireless networks.
Except for the VPN zone, the default zones can be customized.
Zones are managed and created in CONFIGURE > Network > Zones.
Getting Started with Zones, Interfaces and Routing on Sophos Firewall 19.0v1 - 5
Creating Zones
When you create a custom zone, you can choose between two types of zones, LAN or DMZ, which
is used to indicate the level of trust for the zone. You cannot create additional VPN or WAN type
zones as there can only be one of each of these.
You then customize the zone to define which services the Sophos Firewall provides and will be
accessible. This is broken down into four categories:
• Admin services, for accessing and managing the Sophos Firewall.
• Authentication services, for user authentication.
• Network services, for PING and DNS.
• And Other services, which controls access to things like the web proxy, wireless access point
management, and user portal.
Getting Started with Zones, Interfaces and Routing on Sophos Firewall 19.0v1 - 6
Activity
Match the zone with its description
Take a moment to test your knowledge and match the zone with its description.
Getting Started with Zones, Interfaces and Routing on Sophos Firewall 19.0v1 - 7
Network Interfaces
Now that you know how to create zones, we will look at Network Interfaces.
Getting Started with Zones, Interfaces and Routing on Sophos Firewall 19.0v1 - 9
Configuring Interfaces Interfaces are configured in:
CONFIGURE > Network > Interfaces
By default, interfaces are named after their hardware device ID. However, you can give them a
friendly name to make identifying them easier.
To begin configuring the network settings, you must assign the interface to a zone. This will
determine what IP configuration can be set, as only interfaces in the WAN zone are configured with
a gateway.
You can configure interfaces either statically or by DHCP. IPv4 configuration also supports
configuration via PPPoE.
Getting Started with Zones, Interfaces and Routing on Sophos Firewall 19.0v1 - 10
Configuring Interfaces
Interfaces can be
configured for IPv4 or
IPv6 or both
Getting Started with Zones, Interfaces and Routing on Sophos Firewall 19.0v1 - 11
Interface Types
BRIDGE: Allows two or more interfaces to be used to create a transparent layer 2 or 3 bridged
interface for seamless communication between interfaces
VLAN: A virtual LAN interface created on an existing Sophos Firewall interface, used when the
Sophos Firewall needs to perform inter-VLAN routing or tagging
LAG: A group of interfaces acting as a single connection which can provide redundancy and
increased speed between two devices
RED: Used to connect Sophos’ Remote Ethernet Devices back to the Sophos Firewall
In addition to those used for configuring the network adapters in the Sophos Firewall, there are
several other interface types that can be created.
These are:
• Bridge
• Alias
• VLAN
• LAG
• And RED
Getting Started with Zones, Interfaces and Routing on Sophos Firewall 19.0v1 - 12
Bridge Interface
We’ll look at two examples of these interfaces. The first is a bridge interface which bridges over
physical interfaces, such as ports or virtual interfaces, such as VLANs.
If ‘enable routing’ is selected, you must assign an IP address to the bridge interface.
Getting Started with Zones, Interfaces and Routing on Sophos Firewall 19.0v1 - 13
Alias Interface
An Alias interface is
added for the GuestAP
physical interface
An Alias interface is used to bind multiple IP addresses to a physical interface. In this example an
alias is added to the GuestAP interface and can then be seen in the interfaces listing page.
Getting Started with Zones, Interfaces and Routing on Sophos Firewall 19.0v1 - 14
Activity
Match the interface type with its description
Take a moment to test your knowledge and match the interface type with its description.
Getting Started with Zones, Interfaces and Routing on Sophos Firewall 19.0v1 - 15
Interface Types
TUNNEL: Tunnel interfaces are created using a type of IPsec VPN, that allows standard
routing to be used to send traffic over the VPN
WiFi: A wireless network where traffic is routed back to the Sophos Firewall from the access
point instead of directly onto the network the access point is connected to
These two interface types are created as part of configuring other functionality on Sophos Firewall,
IPsec VPNs, and wireless networks using separate zone configuration.
Tunnel interfaces are created using a type of IPsec VPN that allows standard routing to be used to
send traffic over the VPN.
WiFi interfaces are created when a wireless network routes traffic back to the Sophos Firewall
using separate zone configuration, instead of to either the physical LAN the access point is
connected to, or a VLAN.
Getting Started with Zones, Interfaces and Routing on Sophos Firewall 19.0v1 - 17
Simulation: Create Zones and Interfaces
https://training.sophos.com/fw/simulation/ZonesAndInterfaces/1/start.html
In this simulation you will configure zones and interfaces on Sophos Firewall.
A zone is a logical group of networks. Each firewall interface is associated with a single
zone, meaning that traffic can be managed using zones
IPsec tunnel and wireless interface types are created as part of configuring other
functionality on Sophos Firewall. These use separate zone configuration
Here are the three main things you learned in this chapter.
A zone is a logical group of networks. Each firewall interface is associated with a single zone,
meaning that traffic management can be simplified using zones instead of interfaces and networks.
Network interfaces are assigned to a zone, which determines what IP configuration can be set.
IPsec tunnel and wireless interface types are created as part of configuring other functionality on
Sophos Firewall. These use separate zone configuration.
Getting Started with Zones, Interfaces and Routing on Sophos Firewall 19.0v1 - 21
Getting Started with Zones, Interfaces and Routing on Sophos Firewall 19.0v1 - 22
Advanced Interface
Configuration on Sophos
Firewall
Sophos Firewall
Version: 19.5v1
[Additional Information]
Sophos Firewall
FW1520: Advanced Interface Configuration on Sophos Firewall
November 2022
Version: 19.5v1
© 2022 Sophos Limited. All rights reserved. No part of this document may be used or reproduced
in any form or by any means without the prior written consent of Sophos.
Sophos and the Sophos logo are registered trademarks of Sophos Limited. Other names, logos and
marks mentioned in this document may be the trademarks or registered trademarks of Sophos
Limited or their respective owners.
While reasonable care has been taken in the preparation of this document, Sophos makes no
warranties, conditions or representations (whether express or implied) as to its completeness or
accuracy. This document is subject to change at any time without notice.
Sophos Limited is a company registered in England number 2096520, whose registered office is at
The Pentagon, Abingdon Science Park, Abingdon, Oxfordshire, OX14 3YP.
In this chapter you will learn the RECOMMENDED KNOWLEDGE AND EXPERIENCE
advanced configuration settings ✓ The types of interface supported by Sophos
that are available for physical Firewall
and virtual interfaces. ✓ Configuring firewall interfaces
DURATION
9 minutes
In this chapter you will learn the advanced configuration settings that are available for physical and
virtual interfaces.
The Sophos Firewall supports several different interface types that can be created.
These include:
• Physical and wireless interfaces
• Bridge
• VLAN
• Alias
• LAG (Link Aggregation)
• And RED
The menu beside each interface allows you to edit and view settings such as MMS and MTU.
MTU (Maximum Transmission Unit) is the largest packet size that a network can transmit in bytes.
Packets larger than the specified value are divided into smaller packets before they are sent.
MSS (Maximum Segment Size) is the amount of data in bytes that can be transmitted in a TCP
packet.
Sophos Firewall will auto-detect and recommend link settings. In the ‘Advanced settings’ section of
the interface you can click Show recommended settings to see them, and them click Load
recommended configuration to update the settings to the recommended parameters.
This includes support for advanced port configurations for high-speed interfaces, and includes
forward error correction, FEC, for 40 gigabit interfaces in XGS 5500 and 6500.
You can configure the MTU and MSS for interfaces, and this includes support for jumbo frames
with more than 1500-byte payloads. This can be configured in the WebAdmin in the ‘Advanced
settings’ for the interface, or in the console as shown here.
Bridge interfaces include a few additional controls and settings that we will look at over the next
few slides, starting with filtering VLANs. This allows you to define which VLANs can pass across the
bridge without requiring an interface in the VLAN.
If you select filtering, but don't specify the permitted VLANs, Sophos Firewall drops tagged traffic
from all the VLANs. Please note that untagged traffic and system generated traffic will not be
affected by this filter.
Turn on Spanning
Tree Protocol (STP)
By default, bridge interfaces forward ARP (Address Resolution Protocol) broadcasts to discover the
destination MAC addresses.
In ‘Advanced settings’ you can clear the check box to prevent ARP broadcasts. You can use this
when there's a broadcast storm.
You can turn on STP (Spanning Tree Protocol) to prevent bridge loops, which occur when there's
more than one path between two bridge interfaces. Redundant paths can result in a broadcast
storm in the network. STP also enables failover to redundant paths dynamically when the primary
path fails.
The default setting for Filter Ethernet Frames allows all frame types to pass through the bridge.
You can optionally filter using the 4-digit hexadecimal ID. For example, 809B is for AppleTalk.
If you select filtering, but don't specify the permitted Ethernet frame types, Sophos Firewall drops
traffic for all Ethernet frames except the frame types specified in the additional notes, which are
always allowed.
[Additional Information]
Spanning Tree Protocol IEEE 802.1D RFC 7727.
One STP instance is created for the entire bridged network.
Drop Ethernet Frames: The drop setting doesn't affect the frames of ARP, IPv4, IPv6, 8021Q and
EXTE traffic, which are always allowed.
Sophos Firewall drops traffic related to bridge interfaces without an IP address if the traffic
matches a firewall rule with web proxy filtering, or if it matches a NAT rule. These dropped packets
are not logged.
[Additional Information]
To prevent NAT rules from causing the traffic to drop, follow these instructions:
• Go to Rules and policies > NAT rules and select the SNAT rule to edit.
• Select Override source translation for specific outbound interfaces.
• Set Outbound interface to the bridge interface without IP address.
• Set Translated source (SNAT) to Original and click Save.
You can create multiple VLAN interfaces on a single physical interface and allow for tagged as well
as untagged traffic on the same physical interface in the Sophos Firewall.
VLAN support on the Sophos Firewall follows the IEEE 802.1q standards with support for up to
4096 VLANS on the device. There a 3 reserved VLANs:
• VLAN 0 is used when a device needs to send priority-tagged frames but does not know the
specific VLAN it resides in
• VLAN 1 is reserved for the physical LAN
• VLAN 4095 is reserved as per the IEEE 802.1q standard. VLAN ID 4095 is a special purpose VLAN
ID. When configured it acts like a trunk port for the vSwitch
Interface
and Zone
VLAN ID
A VLAN can be created on a physical interface such as PortA, or eth0. The physical port does not
need to be configured with an IP address before a VLAN can be added to it, and you can add
multiple VLAN interfaces to a physical port.
A VLAN can also be created for a virtual interface such as bridge and LAG.
A zone must also be selected for the new VLAN network, and then a VLAN ID needs to be assigned
to the interface. Please note the valid ID range is listed next to the input box.
Advantages:
• Scales bandwidth usage according to the number of links
• Provides link redundancy with failover and failback
• Facilitates load sharing across links
• Requires no changes to the existing network deployment or additional hardware
Link Aggregation Groups (LAG) combine multiple physical links into a single logical link to increase
bandwidth and make automatic failover available.
[Additional Information]
Note: Link Aggregation is also known as:
• Port trunking
• Link building
• NIC bonding
• NIC teaming
Link aggregation control protocol (LACP) is a part of the IEEE specification; it groups two or more
physical links into a single logical link. You must turn on LACP at both ends of the link for it to
The Active Backup LAG mode can be used with devices that do not support 802.3ad (LACP).
In active-backup, the Sophos Firewall manages the links, keeping one link active and the other in
an inactive backup state. Because of this, active-backup does not have the benefit of increased
bandwidth, only redundancy. However, it does allow for the option to failover between links for
different speeds.
You can configure the MTU and MSS for interfaces using ‘Advanced settings’ in the
WebAdmin or from the console
You can create multiple VLAN interfaces on a single physical interface and allow for
tagged as well as untagged traffic on the same physical interface
LAG combines multiple physical links into a single logical link to increase bandwidth and
make automatic failover available
Here are the three main things you learned in this chapter.
You can configure the MTU and MSS for interfaces, and this includes support for jumbo frames
with more than 1500-byte payloads. This can be configured in the WebAdmin in the ‘Advanced
settings’ for the interface or in the console.
You can create multiple VLAN interfaces on a single physical interface and allow for tagged as well
as untagged traffic on the same physical interface in the Sophos Firewall.
Link Aggregation Groups, (LAG), combine multiple physical links into a single logical link to increase
bandwidth and make automatic failover available.
Sophos Firewall
Version: 19.5v1
[Additional Information]
Sophos Firewall
FW1525: Introduction to Routing and SD-WAN on Sophos Firewall
November 2022
Version: 19.5v1
© 2022 Sophos Limited. All rights reserved. No part of this document may be used or reproduced
in any form or by any means without the prior written consent of Sophos.
Sophos and the Sophos logo are registered trademarks of Sophos Limited. Other names, logos and
marks mentioned in this document may be the trademarks or registered trademarks of Sophos
Limited or their respective owners.
While reasonable care has been taken in the preparation of this document, Sophos makes no
warranties, conditions or representations (whether express or implied) as to its completeness or
accuracy. This document is subject to change at any time without notice.
Sophos Limited is a company registered in England number 2096520, whose registered office is at
The Pentagon, Abingdon Science Park, Abingdon, Oxfordshire, OX14 3YP.
In this chapter you will learn how RECOMMENDED KNOWLEDGE AND EXPERIENCE
to configure routing and SD-WAN ✓ Navigating and Managing the Sophos Firewall using
on Sophos Firewall. the WebAdmin
DURATION
20 minutes
In this chapter you will learn how to configure routing and SD-WAN on Sophos Firewall.
Default route
When Sophos Firewall receives traffic, it needs to know where to send it so that it will reach its
destination. If the traffic is destined for a network that Sophos Firewall is connected to, then it will
know where to send it. Everything else will be sent to the default route, which is normally the ISP,
or Internet service provider.
Gateway
Indirectly
connected
network Where do I send this to reach its
destination?
If traffic is destined for a network that is not directly connected to the Sophos Firewall, by default it
will not know where to send it, and so it will be sent to the default route.
In the example shown here, we would need to create a route on the Sophos Firewall so that it
knows to send traffic that is destined for the indirectly connected network to the gateway for that
network.
There are three types of configurable route you can create on Sophos Firewall:
• Static routes. These are the simplest type of route that send traffic to a specific gateway based
on the destination
• SD-WAN routes. These can route traffic based on more attributes, including the source, service,
application, and user. This can route to a specific gateway or backup gateway based on health
monitoring; alternatively, you can use a profile to select a gateway based on quality metrics or
load balancing
• Dynamic routes. These are routes that are learned by communicating with other routing devices
on the network
Enter the network and netmask of the destination traffic that will match this route. In this
example, any traffic to 192.168.16.0/24 will match.
Enter the IP address of the gateway to send the traffic to and select the port to send the traffic on.
For each static route you can also set the administrative distance and metric to set the relative
priority. The administrative distance is used to compare distances between routing protocols; for
example, the administrative distance for OSPF is the shortest distance learned for a route. The
metric is used for route selection between static routes.
https://training.sophos.com/fw/simulation/StaticRoutes/1/start.html
To configure SD-WAN routes you need to start by creating the gateway you will be sending the
traffic to. This is done in CONFIGURE > Routing > Gateways.
On this page you can see all your gateways, both those that you have added here, and the
gateways configured for WAN interfaces.
Gateway details
Gateway health
monitoring
When you add a gateway, start by specifying the IP address, the interface it can be reached on, and
optionally the zone it is in.
Further down the page you can configure the health monitoring for the gateway. This will be filled
in with the gateway IP address by default but can be customized to use a host accessed through
the gateway. You may need to do this if the gateway will not respond to PING or TCP requests from
Sophos Firewall.
SD-WAN routes are configured in two sections, the ‘Traffic selector’, which defines what traffic to
match on for the route, and the ‘Link selection settings’, which is used to determine the gateway to
use.
SD-WAN routes provide a much wider range of traffic selection criteria. You can select the traffic
you want to route based on:
• The interface it arrives at the Sophos Firewall on
• The source and destination networks
• The service
• DSCP marking
• User
• And application
In the ‘Link selection settings’ section you can choose between using an SD-WAN profile, which we
will cover shortly, or a primary and
backup gateway.
The SD-WAN route will use the gateway health status to determine which of the gateways to use,
preferring the primary gateway when it is available.
If you always want the traffic to be routed via a specific gateway and no other, you can optionally
enable Route only through specified gateways. This means the routing will not failover to an
alternative gateway even if it is unavailable.
Static Routes
Precedence
Directly Dynamic
Unicast SSL VPN
Connected Routing Configurable
Routes Routes
Networks Protocols
route
precedence
SD-WAN Routes
Routes are processed in order of precedence. By default, this is health check routes first, then
static routes, SD-WAN routes, VPN routes, and finally the default route. Health check routes always
take precedence as routing traffic to check gateway health must be done independently of any
routes configured. The default route is the gateway derived from the load balancing configuration
across active gateways.
The precedence of routes, SD-WAN routes, VPN routes, and static routes can be modified on the
command line; however, the precedence within static routes is dependent on the specificity of the
route and the distance metric. The more specific the route the higher the precedence, and the
lower the distance the higher the precedence.
[Additional Information]
Routing behaviour documentation:
https://docs.sophos.com/nsg/sophos-firewall/19.0/Help/en-
us/webhelp/onlinehelp/AdministratorHelp/Routing/SDWANPolicyRouting/RoutingSDWANPolicyBe
havior/index.html
At the top of the SD-WAN routes page, the current route precedence is displayed. This can be
checked and modified via the console using the system route_precedence command.
[Additional Information]
To access the console, connect using SSH and login as admin. Choose option 4 for Console.
ISP 1 ISP 2
Sophos Firewall supports environments with multiple WAN connections. When you add a WAN
connection in Sophos Firewall you must specify a gateway, you can then use the WAN link manager
to configure how the WAN connections are used.
The WAN link manager provides an immediate view of the status of your WAN gateways. Through
this page you can access advanced settings for your WAN gateways to configure how they are
used.
WAN gateways can be configured as either active or backup. Where there are multiple active
gateways, Sophos Firewall will load balance traffic between them. Where a gateway has been
configured as a backup, it will only be activated based on the configuration on this page, this could
be manually, or if any, all, or a specific gateway fails.
When a backup gateway is activated, it can inherit the weight of the gateway it is replacing, or you
can manually set the weight that it will be given.
You can configure how connections are handled when the active gateway comes back online,
either gradually serving new connections to the active gateway, or immediately switching all
connections to the active gateway. If all connections are immediately switched to the active
gateway when it comes back online, it can cause existing connections to be dropped and re-
established.
Further down the page you can define how Sophos Firewall can test if the gateway has failed, this
can use either PING or TCP connections to an IP address. You can also add multiple test conditions
so that if the test server is offline, it does not cause the gateway to failover.
Latency 5ms
Latency 134ms
SD-WAN profiles provide link management that allow you to define routing strategies across
multiple gateways. Using SD-WAN profiles enables seamless and efficient routing and rerouting of
traffic based on the performance and stability of the link, optimizing network performance and
ensuring continuity.
For example, if you have multiple ISP connections, you can use SD-WAN profiles and policy routing
to ensure that business critical applications always use the best link.
Latency 5ms
Latency 134ms
Alternatively, you can choose to load balance the traffic between multiple connections and use the
SLA to determine which connections should be used.
Source IP address
Destination IP address
Source and destination IP address
Connection
SD-WAN profiles are managed in CONFIGURE > Routing. Start by selecting the routing strategy,
which can be either first available gateway or load balancing.
When the load balancing mode is selected you can select the load balancing method used. You can
use ‘Round-robin’, which distributes the connections to each gateway in turn. Alternatively, you can
choose a session persistence type to use to route the traffic through the same gateway. You can
choose between:
• Source IP address
• Destination IP address
• Source and destination IP address
• Or connection
Select up to 8 gateways
You can select up to 8 gateways, these can include custom gateways such as route-based VPN
gateways.
If you are using load balancing, you can choose to weight the distribution of traffic across the
gateways. For example, you may want to do this if the connections are different speeds. By default,
all gateways are given a weight of one.
The default SLA, service level agreement, selects the gateway with the best quality link based on
latency. You can change this to alternatively use jitter or packet loss for determining the quality of
the link.
For load balancing, the SLA can be used to select only the gateways that meet the minimum quality
settings that you select.
SD-WAN profiles provide granular options for monitoring the health of the link. Please note that
when you have an SLA enabled for the profile, you cannot disable the health check.
The health check can be done using either Ping or TCP, to either one or two probe targets. Where
TCP is selected, the port must be entered for the probe targets.
You may want to change the probe target, either in the case that the gateway does not respond to
PING, or to better test that the gateway is able to route through to the destination network. If you
are only testing the gateway, you are testing the interface closest the firewall, this does not test
that the outbound interface is also operational.
You can also refine the health checks by specifying the interval between checks, response time-
out, when to deactivate and activate gateways, and the sample size that is used for the SLA.
From the SD-WAN profile page you can see immediately which gateway has been selected. You can
also get real-time status of the gateways by clicking the clipboard icon. The chart icon will take you
to the SD-WAN monitoring graphs.
The SD-WAN monitoring graphs can be found in MONITOR & ANALYZE > Diagnostics > SD-WAN
performance.
Here you can see the distribution of the connections and data across the gateways. This data can
be reset if you are troubleshooting your SD-WAN profile configuration.
Further down the page, the graphs provide current and historical data on latency, jitter, and packet
loss, for each of the gateways in the selected SD-WAN profile.
The view can be changed to show graphs for Live, the last 24 and 48 hours, the last week, or the
last month.
PLAY FIRST AVAILBLE GATEWAY DEMO PLAY FIRST LOAD BALANCING DEMO CONTINUE
In these demos you will see how to configure an SD-WAN profile for multiple Internet connections.
The default route precedence on Sophos Firewall is static routes, SD-WAN routes, VPN
routes, and then the default route. Static routes are comprised of directly connected
networks, dynamic routing protocols, and static unicast routes
WAN link manager is used to manage Internet links. You can configure links as active or
backup and customize failover and failback settings and health monitoring. Gateways is
used to create health monitored gateways for use with SD-WAN routes and profiles
SD-WAN profiles provide link management that allow you to define routing strategies
across multiple gateways, rerouting traffic based on the performance and stability of
the link, optimizing network performance and ensuring continuity
Here are the three main things you learned in this chapter.
The default route precedence on Sophos Firewall is static routes, SD-WAN routes, VPN routes, and
then the default route. Static routes are comprised of directly connected networks, dynamic
routing protocols, and static unicast routes.
The WAN link manager is used to manage Internet links. You can set links as active or backup, set
the failover and failback configuration, and customize the health monitoring. The Gateways page is
used to create health monitored gateways for use with SD-WAN routes and profiles.
SD-WAN profiles provide link management that allow you to define routing strategies across
multiple gateways, rerouting traffic based on the performance and stability of the link, optimizing
network performance and ensuring continuity.
Sophos Firewall
Version: 19.5v1
[Additional Information]
Sophos Firewall
FW1530: Advanced Routing Configuration on Sophos Firewall
November 2022
Version: 19.5v1
© 2022 Sophos Limited. All rights reserved. No part of this document may be used or reproduced
in any form or by any means without the prior written consent of Sophos.
Sophos and the Sophos logo are registered trademarks of Sophos Limited. Other names, logos and
marks mentioned in this document may be the trademarks or registered trademarks of Sophos
Limited or their respective owners.
While reasonable care has been taken in the preparation of this document, Sophos makes no
warranties, conditions or representations (whether express or implied) as to its completeness or
accuracy. This document is subject to change at any time without notice.
Sophos Limited is a company registered in England number 2096520, whose registered office is at
The Pentagon, Abingdon Science Park, Abingdon, Oxfordshire, OX14 3YP.
DURATION
30 minutes
In this chapter you will learn how Sophos Firewall routes traffic, how to manage gateways, and
how to configure SD-WAN profiles and routes.
Static Routes
Precedence
Directly Dynamic
Unicast SSL VPN
Connected Routing Configurable
Routes Routes
Networks Protocols
route
precedence
SD-WAN Routes
Sophos Firewall supports multiple methods for building and dynamically controlling the routing,
which fall into three main types of route; static routes, SD-WAN routes, and VPN routes, and these
are processed in order. In addition to this there are also the health check routes and the default
route. The health check routes are used to route the traffic for health probes independently of any
routes configured. The default route selects the gateway based on the configuration in the WAN
link manager.
Static routes define the gateway to use based on the destination network. This includes directly
connected networks, routes added by dynamic routing protocols, and routes created for SSL VPNs.
SD-WAN routes make decisions based on the properties of the traffic, such as source, destination
and service.
VPN routes are created automatically when policy-based IPsec VPN connections are established
with the Sophos Firewall.
Please note that the precedence of static routes, SD-WAN routes, and VPN routes can be modified
on the command line.
[Additional Information]
Routing behaviour documentation:
https://docs.sophos.com/nsg/sophos-firewall/19.0/Help/en-
us/webhelp/onlinehelp/AdministratorHelp/Routing/SDWANPolicyRouting/RoutingSDWANPolicyBe
havior/index.html
Mark if there is a
PBR match
Firewall rule
Traverse full routing matching done on Traverse full routing
and mark post-NAT zone and as per precedence
Destination zone pre-NAT IP PBR, VPN, Main, All
1 2 3 4 5 6 7 8
NAT lookup for Mark if there is a DNAT or Full NAT as
DNAT/Full NAT match for RTG per rule matched in
rules #3
If WAN traffic with or
Destination zone no PBR and no RTG NAT lookup for the
updated as per mark, then mark for best match SNAT or
DNAT MLM linked NAT rule
This diagram shows how routing is applied to packets by the Sophos Firewall.
After the packet arrives, the Sophos Firewall checks if it matches an SD-WAN route, and if so,
marks the packet. This is used later.
The full routing precedence is traversed, and the destination zone of the packet is marked.
The NAT lookup is performed as previously covered, and the destination zone is updated if a DNAT
or Full NAT rule is matched.
The packet is matched in the firewall based on the post-NAT zone and pre-NAT IP.
Sophos Firewall checks if there is a match for a route through gateway, these will be any migrated
SD-WAN routes created from gateways configured in firewall rules in v17.5.
If the traffic is destined for the WAN zone and no PBR or RTG has been matched, the packet is
marked for MLM.
MLM is the gateway derived from the load balancing configuration across active gateways.
The packet then traverses the full routing as per the precedence.
Match when
Sophos Firewall
XG135_XN02_SFOS 18.0.0# ip rul ls
sends traffic to
0: from all lookup local
itself
51: from all fwmark 0x4002 lookup gw2
51: from all fwmark 0x4001 lookup gw1 Match PBR if marked
Here is an example of the routing table on Sophos Firewall. You can see that it uses a combination
of the source and fwmark to lookup gateways.
From the routing table you can then lookup the route table associated with each gateway as
shown here.
multilink
default proto static
nexthop via 103.226.184.250 dev Port2_ppp weight 1
nexthop via 192.168.8.1 dev WWAN1 weight 1
By using the ip rule list and ip route list table commands you can navigate the
routing table tree to identify how traffic is being routed.
By default, static routing has the highest priority; this can be viewed on the console, and changed if
necessary, using the system route_precedence command.
[Additional Information]
There are two gateway management tools on the Sophos Firewall, the WAN link manager, and the
gateway manager.
The WAN link manager allows you to modify existing WAN gateways that are created when new
interfaces are added to the Sophos Firewall on the WAN zone. The WAN link manager does not
allow an admin to create new WAN links from this location; to add a new link, a new interface
would need to be created. Only modifications can be done here.
The Gateway manager allows you to create gateways on the Sophos Firewall that can forward
traffic to other networks. These gateways can be used to control the flow of traffic through the
Sophos Firewall by coupling these gateways with routing rules. WAN gateways do not need to be
created since they are automatically added when a WAN interface is created.
The WAN link manager allows you to configure Internet gateways to support failover and load
balancing.
Using failover, you can minimize the chance of a service disruption and ensure connectivity to the
Internet.
You can achieve failover using an active–backup configuration. In the event of a link failure, the
firewall reroutes traffic to available connections, and traffic is distributed among links according to
their assigned weights. During failover, the firewall monitors the health of the dead link and
redirects traffic to it once it is restored.
Load balancing allows you to optimize connectivity by distributing traffic among links. Traffic is
assigned according to the weight specified in the links. You can achieve load balancing using an
active-active configuration.
Active or backup
gateway
Gateway priority
When editing WAN gateways, you can set it as either active, in which case the firewall will use it to
route traffic, or backup, in which case the gateway will not be used.
The weight sets the priority of the gateway for allocating traffic. This value determines how much
traffic will pass through the link in relation to the other available links.
You can set the failover rules for the gateway. This determines how the firewall will test whether
the gateway is available, or if it needs to use another gateway.
By default, the failover rules will be configured with a single rule that will attempt to PING the
gateway IP address. You may need to change this if the gateway is configured not to respond to
PING requests.
You can configure failover rules using either PING or TCP connections. You can also choose to
include multiple rules that can be combined using AND, so failover will only happen if both tests
fail, or they can be combined using OR, where failover will happen if either test fails.
Having multiple failover tests can prevent a failover if the test server is unavailable. You can also
configure the tests to check access to services through the gateway and not just the availability of
the gateway itself.
Activation method
Weight setting
Session handling
You can choose to activate the backup gateway either manually, which is the default option, or
dynamically if an active gateway fails. This can be if ANY gateway fails, if ALL gateways fail, or if a
specific gateway fails.
You can also choose for the backup gateway to inherit the weight of the failed active gateway or
use the configured weight.
The action on failback option can be used to control how sessions are handled if the active
gateway comes back online. You can choose to serve new connections through the restored
gateway, or force all connections, including current connections through the restored gateway.
Forcing current connections through the restored gateway can in some circumstances cause the
session to fail for that connection because the traffic is routing asynchronously.
By clicking on the report icon in the gateway row, you can view the traffic utilization for that
gateway. This can be either weekly, monthly, or for a custom time period.
The gateway manager on the Sophos Firewall allows the configuration of IPv4 and IPv6 gateways
for use with SD-WAN routes.
To configure a gateway, enter the IP address and optionally select which interface should be used
to reach it. You can also select a zone, which we will cover later in this section.
Gateways can be monitored using a health check that will test whether the gateway is up by
pinging it at regular intervals, and email notifications can be enabled for when the gateway state
changes.
Please note, if health monitoring is not enabled, the Sophos Firewall will always assume the
gateway is available.
This table shows which interface types are supported for IPv4 and IPv6 gateways. IPsec, GRE, IP
Tunnels and SSL site-to-site VPNs are not supported.
Routing is usually determined by the destination of the traffic; however, SD-WAN routing allows
decisions to be based on other criteria, such as the source and traffic type.
There are two elements for configuring SD-WAN routing on the Sophos Firewall, gateways and SD-
WAN route rules.
If you have multiple Internet connections, routing can be defined through either the primary or
backup gateway WAN connection and can be configured for replay direction.
Synchronized SD-WAN offers additional benefits with SD-WAN application routing. It leverages the
added clarity and reliability of application identification that comes with the sharing of
Synchronized Application Control information between Sophos Central managed endpoints and
Sophos Firewall.
SD-WAN profiles provide link management that allow you to define routing strategies across
multiple gateways. Using SD-WAN profiles enables seamless and efficient routing and rerouting of
traffic based on the performance and stability of the link, optimizing network performance and
ensuring continuity.
SD-WAN profiles can be configured to use one of two routing strategies; first available gateway or
load balancing.
The first available gateway strategy will use the first gateway that has been selected that is online.
When paired with the SLA configuration it will switch between links to use the best quality link that
is available. This routing strategy can provide redundancy and quality.
Load balancing can provide both redundancy and performance by distributing traffic across all
available gateways. When paired with the SLA configuration, only gateways that meet the SAL are
included for load balancing. Gateways that do not meet the SLA will not be used.
SESSION PERSISTENCE
Traffic from the same source IP address is always sent through the
SOURCE IP ADDRESS
same gateway
SOURCE IP ADDRESS AND Traffic that has the same source and destination IP address is always
DESTINATION IP ADDRESS sent through the same gateway
CONNECTION Traffic for a connection is always sent through the same gateway
When you configure an SD-WAN profile using load balancing you can choose between either round
robin or session persistence.
When you select round robin, all traffic is distributed between the gateways in turn.
There are four session persistence modes that you can choose from:
• Source IP address, where the traffic that originates from an IP address is always sent through
the same gateway
• Destination IP address, where traffic destined from the same IP address is always sent through
the same gateway
• Source IP address and destination IP address, which sends traffic between a pair of source and
destination IP addresses through the same gateway
• And connection, which sends all traffic associated with a specific connection through the same
gateway
The default SLA, service level agreement, selects the gateway with the best quality link based on
latency. You can change this to alternatively use jitter or packet loss for determining the quality of
the link.
Network latency, sometimes called lag, is the term used to describe how long data takes to reach
its destination.
Jitter measures the changes in the latency in a network connection, where zero milliseconds of
jitter is data being delivered at a constant latency, and five milliseconds of jitter would indicate that
the latency is not stable and can vary by five milliseconds. This can be caused by network
congestion.
Packet loss measures how many packets do not reach their destination as a percentage of packets
sent.
You also have the option to define a custom SLA that is based on any combination of latency, jitter,
and packet loss. For each of the criteria that you want to use you can define maximum values.
The default values are based on general web traffic, but examples of other traffic types can be seen
by hovering over the information icon for Recommended SLA values.
For example, you could configure an SLA for SIP that requires packet loss not to exceed 1%.
SD-WAN profiles provide granular options for monitoring the health of the link. Please note that
when you have an SLA enabled for the profile, you cannot disable the health check.
The health check can be done using either Ping or TCP, to either one or two probe targets. Where
TCP is selected, the port must be entered for the probe targets.
You can also refine the health checks by specifying the interval between checks, response time-
out, when to deactivate and activate gateways, and the sample size that is used for the SLA.
1s
Probes
Interval
between checks
In this example the sample size is 5. The default sample size is 30.
Here you can see the timeline for health check probes, and in this example, we are using a one
second interval between probes.
The SLA sample size forms a sliding window over time. The default sample size is 30, but in this
example, we are using 5.
Once the SLA sample size is reached, the first SLA verdict is returned, and it is updated on each
probe. The time taken to report the first verdict is the SLA sample size multiplied by the interval
between checks.
When there are three consecutive failures the firewall determines that the link is down.
If the link comes back up, the firewall will change its status after receiving the configured number
of consecutive responses, five in this example.
The gateway with the best quality based on the SLA will
ON ON
be used
SLA and health check can be independently configured. Let’s look at how these combine to control
the behavior when using the first available gateway strategy.
With the SLA and health check both disabled, all gateways are assumed to be up and the first
gateway will be used.
When the SLA is disabled but the health check is enabled, Sophos Firewall will use the first gateway
that becomes available.
And when both the SLA and health check are enabled, Sophos Firewall will start to use the gateway
with the best quality link based on the SLA.
With the SLA and health check both disabled, all gateways are assumed to be up and are included
for load balancing.
When the SLA is disabled but the health check is enabled, Sophos Firewall will start load balancing
as soon as at least one gateway becomes available.
And when both the SLA and health check are enabled, Sophos Firewall will start load balancing as
soon as at least one gateway becomes available, and only include the gateways that meet the SLA.
If you are using the first available gateway routing strategy, Sophos Firewall will use the first
gateway in the list.
If you are using load balancing, Sophos Firewall will use all available gateways.
1Gbps
500Mbps
250Mbps
You can also apply weights to the gateways where higher numbers are preferred. You may want to
do this if your links have different amounts of bandwidth to help ensure that the traffic is
appropriately allocated between them. For example, you might have a fast primary link and two
slower links. You could weight these in a ratio dependant on their bandwidth.
So here we have 1 gigabit, 500 megabit, and 250 megabit connections. Each connection is half the
speed of the next fastest, so the weights could be applied by doubling for each link.
Sophos Firewall uses connection rerouting to reroute traffic to another available gateway if a
gateway becomes unavailable. This is controlled in the console with the routing reroute-
connection setting. This will be enabled by default, but it can be checked and controlled via
the console on Sophos Firewall.
In the log viewer there is an SD-WAN module that allows you to focus on log entries specific to SD-
WAN routing and health. Each log entry includes the SD-WAN rule ID and name for both the route
request and the reply.
SD-WAN routes are configured in CONFIGURE > Routing > SD-WAN routes. Please note that
separate SD-WAN routes need to be created for IPv4 and IPv6.
SD-WAN routes are processed in order from the top down and the first match is used. SD-WAN
routes can be moved by dragging and dropping routes.
SD-WAN route configuration is made up of two parts, traffic selector and routing.
Traffic can be selected based on the incoming interface. Please note that if you unbind the
interface, the SD-WAN route will be deleted.
Source, destination and service selectors work in the same way as for firewall rules.
In the ‘Link selection settings” you can choose to either select the gateway based on an SD-WAN
profile, or manually select a primary and backup gateway.
If you delete the primary gateway or the SD-WAN profile, the SD-WAN route will be deleted, and
the traffic will use WAN link load balancing.
If you delete the backup gateway, the backup gateway will be set to ‘None’.
Select Override gateway monitoring decision if you want to route traffic through the selected
gateway even if the gateway is down.
• Green when the primary or backup gateway is up, and the SD-WAN route is active
• Red when the gateways are down, and the SD-WAN route is not active and override gateway
monitoring is off
• Yellow when the gateways are down, and override gateway monitoring is on. The SD-WAN route
will be active in this case
You can see the status of the gateways and the monitoring setting by hovering your mouse over
the SD-WAN route status icon.
Application-based routing works using learned routes, this means that for the very first connection
from an application it will be routed via the default route. Once the Sophos Firewall has learned
and cached the association between the application and route, all subsequent connections will
adhere to the application-based route.
The DPI supports application-based routing for all applications; however, the legacy web proxy
does not support this for micro-apps.
Application-based routes require an active Web Protection license and one of the following:
• Application classification is on, which it is by default
• An application filter is applied to the firewall rule
• Or the application is part of the offload signatures and is flowing through snort
[Additional Information]
In high availability, the cached application-based routing information is synchronized over the
dedicated HA link using multicast IP 226.1.1.1 on port 4455.
• Sophos Firewall automatically prefixes the firewall rule ID to the SD-WAN route name
• Sophos Firewall uses the firewall rule ID to match traffic with migrated routes
• SD-WAN routes don’t have zone-based settings
• You cannot change the sequence of migrated SD-WAN routes, since they correspond
to the firewall rule sequence
• If you delete the firewall rule, the migrated SD-WAN route is deleted
• You can edit only the gateways and the gateway monitoring decision
Firewall rules no longer include routing settings. When you migrate from version 17.5 or earlier,
Sophos Firewall migrates the routing settings in firewall rules as migrated SD-WAN routes. You can
see them in the SD-WAN routing table. You can identify these migrated SD-WAN routes by the
firewall rule ID and name. Note that this also applies to restoring a backup configuration file that
was taken on version 17.5 or earlier.
Enable and disable routing reply packets with SD-WAN routes via the console
SD-WAN routes will match reply packets in new installations of Sophos Firewall.
As this is a change of behavior from previous versions of Sophos Firewall, SD-WAN routes will not
match reply packets for upgrades or where a pre-v18 configuration file is restored.
You can view and set the behaviour for SD-WAN routes on the console using the commands shown
here.
[Additional Information]
show routing sd-wan-policy-route reply packet
set routing sd-wan-policy-route reply packet <enable|disable>
You can create a virtual WAN zone on custom gateways for single arm usage after deployment. This
would primarily be in AWS or Azure. You can create more than one custom gateway attaching
different zones to each. Once configured, you can create access and security rules for traffic going
to these zones.
For example, in a single VPC/vNet deployment in AWS or Azure, you may use this where the
firewall serves as the next-hop for all traffic. It allows an admin to apply policies based on zones,
for example WAN to DMZ instead of WAN to WAN in single-arm deployments.
This configuration may also be used to add an extra layer of security to the internal network; for
example, all east-west traffic between the DMZ and the user network can be routed through the
firewall. The firewall can then enforce network security and validate access for that traffic.
There are five things to configure to use zones for custom gateways.
First, you create the gateways with the custom zone attached, then you create SD-WAN routes to
select the traffic and route it through your custom gateway. You may need to configure the route
precedence so that SD-WAN routes match first.
You will need to create a firewall rule for the traffic, and finally a NAT Rule to perform DNAT and
SNAT on the traffic.
172.16.16.10
Custom gateway in LAN zone
Here we have a subnet 172.16.16.0/24. The Sophos Firewall has the IP address 172.16.16.16 in the
WAN zone and uses 172.16.16.250 as its default gateway. There is another server on the same
subnet with the IP address 172.16.16.10 that is in the LAN zone.
GATEWAY
SWITCH/
ROUTER 172.16.16.250
172.16.16.10
First, we have our gateways; GW is the default gateway on PortA in the WAN zone, and LAN is the
server we are have created the custom gateway for.
Custom gateways do not participate in load-balancing, so to use them you need to create SD-WAN
routes for the traffic. Here we have created the HTTP_LAN rule that will match all HTTP traffic and
route it to the custom gateway. So that the Sophos Firewall can still route HTTP traffic out to the
Internet we have also created an SD-WAN route that matches on traffic from the internal hosts and
sends it to the default gateway.
Remember, the default routing precedence is static routes, SD-WAN routes, and the VPN routes;
you may need to adjust this, so the SD-WAN routes take precedence.
Here we have created a firewall rule that will allow HTTP traffic from the WAN to the LAN where it
is destined for the Sophos Firewall IP address.
We also have a NAT rule that DNAT and SNAT the inbound HTTP traffic, and a second NAT rule to
SNAT the outbound traffic from the LAN server.
If we review the conntrack you can see that the zone for this connection is being changed from 2
(WAN) to 1 (LAN).
Sophos Firewall marks incoming traffic with the matching routes and the destination
zone before DNAT is applied. Routes are then processed in order of precedence before
SNAT is applied
Sophos Firewall has the WAN link manager for configuring balancing and failover of
Internet links. There is also the gateway manager for creating and managing custom
gateways for SD-WAN routing
SD-WAN profiles provide link selection based on link quality and performance using
latency, jitter, packet loss, or a combination of all three. SD-WAN routes provide powerful
traffic selection options, that can leverage SD-WAN profiles for link selection
Here are the three main things you learned in this chapter.
Sophos Firewall marks incoming traffic with the matching routes and the destination zone before
DNAT is applied. Routes are then processed in order of precedence before SNAT is applied.
Sophos Firewall has the WAN link manager for configuring balancing and failover of Internet links.
There is also the gateway manager for creating and managing custom gateways for SD-WAN
routing.
SD-WAN profiles provide link selection based on link quality and performance using latency, jitter,
packet loss, or a combination of all three. SD-WAN routes provide powerful traffic selection
options, that can leverage SD-WAN profiles for link selection.
Sophos Firewall
Version: 19.0v2
[Additional Information]
Sophos Firewall
FW1540: Troubleshooting Routing on Sophos Firewall
June 2022
Version: 19.0v2
© 2022 Sophos Limited. All rights reserved. No part of this document may be used or reproduced
in any form or by any means without the prior written consent of Sophos.
Sophos and the Sophos logo are registered trademarks of Sophos Limited. Other names, logos and
marks mentioned in this document may be the trademarks or registered trademarks of Sophos
Limited or their respective owners.
While reasonable care has been taken in the preparation of this document, Sophos makes no
warranties, conditions or representations (whether express or implied) as to its completeness or
accuracy. This document is subject to change at any time without notice.
Sophos Limited is a company registered in England number 2096520, whose registered office is at
The Pentagon, Abingdon Science Park, Abingdon, Oxfordshire, OX14 3YP.
DURATION
17 minutes
In this chapter you will learn how Sophos Firewall routes packets, and how to approach
troubleshooting routing related problems.
Static Routes
Precedence
Directly Dynamic
Unicast SSL VPN
Connected Routing Configurable
Routes Routes
Networks Protocols
route
precedence
SD-WAN Routes
Routing requirements will be different in every scenario you encounter, so in this chapter we will
focus on explaining how the Sophos Firewall routes traffic, and the tools available for monitoring
and troubleshooting.
The Sophos Firewall supports multiple methods for building and dynamically controlling the
routing, which fall into three main types of route; static routes, SD-WAN policy routes, and VPN
routes, and these are processed in order.
Health check routes are used by Sophos Firewall to ensure that health probe traffic is sent through
the gateway that is being monitored and not being matched on any other route. These will always
take precedence.
Static routes define the gateway to use based on the destination network. This includes directly
connected networks, routes added by dynamic routing protocols, and routes created for SSL VPNs.
Policy routes make decisions based on the properties of the traffic, such as source, destination and
service.
VPN routes are created automatically when policy-based IPsec VPN connections are established
with the Sophos Firewall.
When no other routing rule has been matched the Sophos Firewall will send the packets on the
default route, which is the active gateway derived from the load balancing configuration across
active gateways.
Note that the precedence of static routes, policy routes, and VPN routes can be modified on the
[Additional Information]
Routing behaviour documentation:
https://docs.sophos.com/nsg/sophos-firewall/19.0/Help/en-
us/webhelp/onlinehelp/AdministratorHelp/Routing/SDWANPolicyRouting/RoutingSD
WANPolicyBehavior/index.html
Mark if there is a
PBR match
Firewall rule
Traverse full routing matching done on Traverse full routing
and mark post-NAT zone and as per precedence
Destination zone pre-NAT IP PBR, VPN, Main, All
1 2 3 4 5 6 7 8
NAT lookup for Mark if there is a DNAT or Full NAT as
DNAT/Full NAT match for RTG per rule matched in
rules #3
If WAN traffic with or
Destination zone no PBR and no RTG NAT lookup for the
updated as per mark, then mark for best match SNAT or
DNAT MLM linked NAT rule
This diagram shows how routing is applied to packets by the Sophos Firewall.
After the packet arrives the Sophos Firewall checks if it matches an SD-WAN policy route, and if so,
marks the packet. This is used later.
The full routing precedence is traversed, and the destination zone of the packet is marked.
The NAT lookup is performed, and the destination zone is updated if a DNAT or Full NAT rule is
matched.
The packet is matched in the firewall based on the post-NAT zone and pre-NAT IP.
Sophos Firewall checks if there is a match for a route through gateway, these will be any migrated
SD-WAN policy routes created from gateways configured in firewall rules in v17.5.
If the traffic is destined for the WAN zone and no PBR or RTG has been matched, the packet is
marked for MLM.
MLM is the gateway derived from the load balancing configuration across active gateways.
The packet then traverses the full routing as per the precedence.
Here is an example of the routing table on Sophos Firewall. You can see that it uses a combination
of the source and fwmark, firewall mark, to lookup gateways.
To show the routing table, run ip rule list on the advanced shell.
From the routing table you can then lookup the route table associated with each gateway as
shown here.
multilink
default proto static
nexthop via 103.226.184.250 dev Port2_ppp weight 1
nexthop via 192.168.8.1 dev WWAN1 weight 1
By using the ip rule list and ip route list table commands you can navigate the
routing table tree to identify how traffic is being routed.
You can use the conntrack command in the advanced shell to see how packets are being
marked for routing and then use the previous commands to look up the gateway.
By default, static routing has the highest priority; this can be viewed on the console, and changed if
necessary, using the system route_precedence command.
[Additional Information]
Version 18.0 of Sophos Firewall included two changes of behavior to policy routing:
1. Policy routes are applied to reply packets
2. Policy routes are applied to system generated traffic
As this was not the behavior in earlier versions of Sophos Firewall these behaviors are not enabled
when the Sophos Firewall has been upgraded. They can be enabled through the console using the
commands:
set routing sd-wan-policy-route reply-packet enable
set routing sd-wan-policy-route system-generate-traffic
enable
Note: for new installations of Sophos Firewall v18.0 and later these options are enabled by default.
Sophos Firewall checks the health of gateways, which is used by the default routing and SD-WAN
routes when configured to use primary and backup gateways.
SD-WAN profiles also have health checks; these are independent of the gateway health checks, and
the health check for each profile is also independent of each other.
If the first probe target is unavailable the second probe target is used
SD-WAN profiles support two probe targets. When two probe targets are configured, Sophos
Firewall will use the first probe target for performing the health checks on the connections. If the
first probe target is unavailable, Sophos Firewall will use the second probe target. The second
probe target will continue to be used until in becomes unavailable, at which point Sophos Firewall
will try the first probe target again. If both probe targets are unavailable, the health check fails as
the gateway is unavailable.
Link 2
SLA not met Sophos
Internet SLA not met Firewall
Link 3
13
In some circumstances it is possible that all the configured gateways in an SD-WAN profile fail to
meet the configured SLA. In this case Sophos Firewall will use the first available gateway.
Where the links are of a poor quality, it may be necessary to use a custom SLA with higher values
that the links can achieve to get the desired routing outcomes.
In the log viewer you can add columns to the firewall log to show which SD-WAN profile and SD-
WAN route is being used for each connection.
In the SD-WAN log you can see events for the SD-
WAN profile health checks and when routes
change.
When you are troubleshooting routing, you can check the log viewer to see which SD-WAN profile,
route, and gateway are being used, and the interface that the traffic is leaving the firewall on.
On the command line you can use conntrack to see the gateway mark and outbound port.
[Additional Information]
Here you can see the log and conntrack output after a route change.
In the log you can see that the SD-WAN profile and route are the same, but the gateway and
outbound interface have changed.
In the conntrack output you can see that the gateway mark and the outbound interface have
changed.
[Additional Information]
Application-based routing works using learned routes, this means that for the very first connection
from an application it will be routed via the default route. Once the Sophos Firewall has learned
and cached the association between the application and route, all subsequent connections will
adhere to the application-based route.
The DPI supports application-based routing for all applications; however, the legacy web proxy
does not support this for micro-apps.
Application-based routes require an active Web Protection license and one of the following:
• Application classification is on, which it is by default
• An application filter is applied to the firewall rule
• Or the application is part of the offload signatures and is flowing through snort
[Additional Notes]
In high availability, the cached application-based routing information is synchronized over the
dedicated HA link using multicast IP 226.1.1.1 on port 4455.
You can review the application policy route information with the command ipset -L appset
in the Advanced Shell.
Here you can see all the connection details for a specific application, ID 10004 in this case.
Below that you can see the defined application objects and the IDs of the applications.
Please note that application IDs above 10000 are applications identified by Synchronized
Application Control. Other application IDs are in the set that Sophos Firewall has detection for by
default.
LON-GW1.SOPHOS.WWW
WAN IP: 10.1.1.100 & 10.3.3.100 (/24)
10.100.100.65 (/29)
10.1.1.250 (/24)
MPLS
10.2.2.250 (/24)
10.3.3.250 (/24) 10.100.100.70 (/29)
Now that we have covered some of the key points of how the Sophos Firewall manages routing,
let’s consider an example where you are unable to access a resource on New York Server from
London DC over the MPLS.
Here you can see that from London DC you cannot load a web page on New York Server.
The first thing to do is check the logs. Using the log viewer you can apply source IP, destination IP
and destination port filters to identify the traffic. As you can see here the traffic is allowed through
both London Gateway 1 and New York Gateway.
The next step would be to perform a packet capture to see what is happening. Again, you can filter
the results. In the example here we are using a BPF, Berkley Packet Filter, string host
192.168.16.30 and port 80 to select the relevant traffic.
In the output from London Gateway 1 you can see the request coming from port A and leaving
through port G, this is the MPLS port.
Using the same BPF string on New York Gateway, in this case we see the traffic come in on port D,
the MPLS port, and leave through port B the WAN port. This is incorrect.
On New York Gateway we check the route precedence and can see that SD-WAN policy routes has
the highest precedence.
While we are logged in, we also check the configuration for reply packets and find it is not enabled.
This Sophos Firewall must have been upgraded from v17.5.
In this case the issue has been resolved by enabling reply packets for SD-WAN policy routing.
If this had not resolved the issue the next step would have been to review the routes and routing
table on New York Server to see what route(s) may be incorrectly matching the traffic.
There are a couple more useful tools for troubleshooting routing issues. The first is tcpdump. This
is a command line packet capture tool that can be used on the Console or Advanced Shell. You can
use a BPF (Berkley Packet Filter) string with tcpdump in the same way as with the packet capture in
the WebAdmin.
tcpdump output can be saved to a pcap file, which allows you to view the output of the tcpdump
command and analyze it using other packet analyzer tools, such as WireShark, on an external
computer.
You can then use SCP to copy the output to another server from the Sophos Firewall.
For example:
scp /tmp/dump.pcap user@servername:/folder/location/
[Additional Information]
When using tcpdump in the advanced shell you can use llh to print the link-level header on each
dump line.
conntrack, which must be run on the advanced shell, can show current connection details.
conntrack -L will output all of the current connections at that point in time. The output can
be used with grep for filtering.
conntrack -E will continuously write updates to the screen. Each entry will be tagged as a
NEW connection, an UPDATE to an existing connection, a connection that is being DESTROYed, and
so forth. You can also apply filters to the command such as the protocol, port and destination.
The default route precedence is health check routes, static routes, SD-WAN policy
routes, VPN routes, then the default route derived from balancing active gateways
Route precedence for static, SD-WAN, and VPN routes can be changed on the console
Whether Sophos Firewall uses SD-WAN routes for reply traffic and system generated
traffic is controlled through the console
Here are the three main things you learned in this chapter.
The default route precedence is health check routes, static routes, SD-WAN policy routes, VPN
routes, then the default route derived from balancing active gateways.
Route precedence for static, SD-WAN, and VPN routes can be changed on the console.
Whether Sophos Firewall uses SD-WAN routes for reply traffic and system generated traffic is
controlled through the console.
Sophos Firewall
Version: 19.0v2
[Additional Information]
Sophos Firewall
FW1545: Configuring DNS and DHCP on Sophos Firewall
June 2022
Version: 19.0v2
© 2022 Sophos Limited. All rights reserved. No part of this document may be used or reproduced
in any form or by any means without the prior written consent of Sophos.
Sophos and the Sophos logo are registered trademarks of Sophos Limited. Other names, logos and
marks mentioned in this document may be the trademarks or registered trademarks of Sophos
Limited or their respective owners.
While reasonable care has been taken in the preparation of this document, Sophos makes no
warranties, conditions or representations (whether express or implied) as to its completeness or
accuracy. This document is subject to change at any time without notice.
Sophos Limited is a company registered in England number 2096520, whose registered office is at
The Pentagon, Abingdon Science Park, Abingdon, Oxfordshire, OX14 3YP.
DURATION
5 minutes
In this chapter you will learn how to configure the DNS and DHCP settings on Sophos Firewall.
Set up to three
DNS servers for
IPv4 and IPv6
During the initial setup you will have to set a DNS server, this can be modified in CONFIGURE >
Network > DNS.
Here you can set how Sophos Firewall obtains its DNS server, and you can set up to three DNS
servers statically for IPv4 and IPv6.
Sophos Firewall also acts as a DNS server, using its configured DNS servers to resolve and respond
to requests. You can set how Sophos Firewall handles the preference between IPv4 and IPv6
lookups.
You can also configure DNS records on the Sophos Firewall itself. These can include a reverse
lookup from the IP address back to the hostname.
Set the DNS server to use to lookup hosts in the sophos.local domain
Set the DNS server to use to lookup IP addresses in the network 172.16.16.0/24
If the Sophos Firewall is configured to use your ISPs DNS servers, so that it can resolve hosts on the
Internet, you can override this for specific domains and networks by configuring DNS request
routes.
A DNS request route defines what DNS server should be used to lookup hosts in the selected
domain. Request routes can also be created for reverse lookups to define what DNS server should
be used to lookup IP addresses in the selected network.
https://training.sophos.com/fw/simulation/ConfigureDNS/1/start.html
In this simulation you will configure DNS request routes on Sophos Firewall.
If your ISP assigns your IP through DHCP, you can use a dynamic DNS provider to host a DNS record
for this IP address, and have the Sophos Firewall update the IP address associated with it.
To configure dynamic DNS, you enter the hostname, and select the WAN interface it should resolve
to. You then need to select your provider, and enter your login details.
Sophos Firewall can provide DHCP to any networks that are connected to it. Each DHCP server you
configure on the Sophos Firewall can be either IPv4 or IPv6 and is bound to an interface.
Sophos Firewall can also act as a DHCP relay, passing DHCP requests between clients and a DHCP
server on another network.
DNS servers can be assigned to Sophos Firewall using DHCP, from PPPoE interface
settings and manually
DNS request routes define what DNS server should be used to lookup hosts in the
selected domain
Sophos Firewall can provide DHCP to any networks that are connected to it. It can also
pass requests to another DHCP server.
Here are the three main things you learned in this chapter.
DNS servers can be assigned to Sophos Firewall using DHCP, from PPPoE interface settings and
manually.
A DNS request routes define what DNS server should be used to lookup hosts in the selected
domain.
Sophos Firewall can provide DHCP to any networks that are connected to it. It can also pass
requests to another DHCP server.
Sophos Firewall
Version: 19.0v1
[Additional Information]
Sophos Firewall
FW1550: Managing Device Access and Certificates on Sophos Firewall
April 2022
Version: 19.0v1
© 2022 Sophos Limited. All rights reserved. No part of this document may be used or reproduced
in any form or by any means without the prior written consent of Sophos.
Sophos and the Sophos logo are registered trademarks of Sophos Limited. Other names, logos and
marks mentioned in this document may be the trademarks or registered trademarks of Sophos
Limited or their respective owners.
While reasonable care has been taken in the preparation of this document, Sophos makes no
warranties, conditions or representations (whether express or implied) as to its completeness or
accuracy. This document is subject to change at any time without notice.
Sophos Limited is a company registered in England number 2096520, whose registered office is at
The Pentagon, Abingdon Science Park, Abingdon, Oxfordshire, OX14 3YP.
DURATION
10 minutes
In this chapter you will learn how to control access to admin services and add a certificate to
replace the default ‘ApplianceCertificate’.
Local services are management services specific to the internal functioning of Sophos Firewall,
such as web admin and CLI consoles, and authentication services.
You can control access to the management services of Sophos Firewall from custom and default
zones using the local service ACL (Access Control List).
The zones which are allowed access to Admin services can be managed on the Device Access page
under the heading Local service ACL. The example shows that only the LAN and WiFi zones are
allowed access to Admin services using HTTPS and SSH. This section gives an easy and graphical
way to manage access to admin services as well as authentication, network, and other services
from any zone on the Sophos firewall.
BEST PRACTICES
Sophos does not recommend allowing access to the web admin console (HTTPS), CLI console
(SSH), and the user portal from the WAN zone or over the SSL VPN port.
Even though you can enable access to admin services from these zones, the Webadmin will warn
you that this is not a safe practice.
If you must give access, best practices are provided in the Administrator Help.
[Additional Information]
Best practices: https://docs.sophos.com/nsg/sophos-firewall/19.0/Help/en-
us/webhelp/onlinehelp/AdministratorHelp/Administration/DeviceAccess/index.html
The Local service ACL rules allow an administrator to quickly enable or disable access to a service
for a specific zone. While this is a simple way to enable access to these services, it does not allow
an administrator to securely grant access to services from untrusted zones. Or an administrator
may want to restrict access from specific IP addresses in a secure zone, for example, to prevent
guests from being able to see the User Portal login page.
To only allow specific hosts and networks to access the services, scroll down to Local service ACL
exception rule, and click Add.
In the example shown here, we are allowing access to the WebAdmin and SSH in the WAN zone,
but only from the specified IP address.
We have looked at the built-in zones on the Sophos firewall. These include the LAN, WAN, VPN,
DMZ, and WiFi zones. While you can choose to use only these zones, you also have the option of
creating additional custom zones to further define your networks.
When you create or edit a zone from Network > Zones, you can also configure which services it can
access on the Sophos Firewall.
When you first connect to a Sophos firewalls webadmin console, you may notice that you get a
certificate error. This is not to say that your connection is insecure, but rather that the certificate is
untrusted by your machine.
This is because Sophos Firewall comes with a default certificate called ‘ApplianceCertificate’, this is
used to provide HTTPS for the Admin Portal, User Portal and SSL VPNs. The common name on this
certificate is the serial number of the appliance, and therefore you will almost certainly get a
certificate error when you login.
If you use Sophos Central to connect to Firewall Management, the certificate provided by Sophos
Central will be trusted.
2 Self-Signed Create a self-signed certificate that will be signed by the ‘Default’ signing CA
Certificates can be added to Sophos Firewall and can then be selected to be used in place of the
default ‘ApplianceCertificate’.
1. Upload a certificate that has been signed by an external trusted certificate authority. This could
be a third-party company such as GlobalSign, or an internal enterprise certificate authority. To
upload a certificate, you need to provide the certificate, private key, and the passphrase for
decrypting the private key.
2. Generate a self-signed certificate. This will be generated and signed by the Sophos Firewall’s
own ‘Default’ signing certificate authority.
3. The third option is to generate a CSR and download it along with the private key and
passphrase. This is a signing request for a certificate that can be signed by either a third-party
company or an internal enterprise certificate authority. Once you have the certificate you can
then upload it to the Sophos Firewall.
In this example, the option to Generate locally-signed certificate has been selected and the
required information for the certificate has been entered. This must include the common name,
which is included in the Distinguished name, and one or more Subject Alternative Names. SANs
define the entities for which your certificate will be valid and can be DNS names or IP addresses.
If you have created a new certificate or uploaded a public certificate to the firewall, it can be
assigned for use by the Webadmin and user portal.
Admin and user settings, under Administration, allows you to select another certificate using the
drop-down list.
Sophos Firewall comes preconfigured with the certificates for common trusted Internet root
certificate authorities; these are used to verify the certificates of devices the Sophos Firewall
connects to.
You can also upload additional CA certificates that you want to trust, such as an internal enterprise
CA that signs the certificates for your internal servers.
https://training.sophos.com/fw/simulation/ImportCACertificates/1/start.html
In this simulation you will import CA certificates from an internal certificate authority to
Sophos Firewall.
Sophos Firewall also acts as a certificate authority, and so comes with two signing CAs.
• The ‘Default’ signing CA is used for creating and signing certificates.
• The ‘SecurityAppliance_SSL_CA’ is used for creating the certificates used in HTTPS web scanning
and securing TLS/SSL email connections.
You can upload additional signing CAs by providing the private key with the CA certificate when you
upload it. These CAs can then be selected for use in Web and Email Protection.
• The Email CAs can be separately selected for SMTPS and IMAPS & POPS. This is done in EMAIL >
General settings.
• The Web CA for HTTPS scanning can be selected in Web > Protection.
https://training.sophos.com/fw/simulation/DeployCertificates/1/start.html
In this simulation you will download Sophos Firewall’s CA certificates and deploy them using Active
Directory Group Policy.
The zones which are allow access to Admin services can be managed on the Device
Access page. Local service ACL exception rules restrict by IP addresses or by network
Sophos Firewall acts as a certificate authority with two signing CAs. ’Default’ creates and
signs certificates. ‘SecurityAppliance_SSL_CA’ creates certificates used in HTTPS web
scanning and securing TLS/SSL email connections
Here are the three main things you learned in this chapter.
The zones which are allowed access to Admin services can be managed on the Device Access page.
Local service ACL exception rules restrict by IP addresses or by network.
Certificates can be added to Sophos Firewall and used in place of the default ’ApplianceCertificate’
which generates a certificate error.
Sophos Firewall acts as a certificate authority with two signing CAs. ‘Default’ creates and signs
certificates. ‘SecurityAppliance_SSL_CA’ creates certificates used in HTTPS web scanning and
securing TLS/SSL email connections.
Sophos Firewall
Version: 19.0v1
[Additional Information]
Sophos Firewall
FW1555: Considerations for Configuring Device Access on Sophos Firewall
April 2022
Version: 19.0v1
© 2022 Sophos Limited. All rights reserved. No part of this document may be used or reproduced
in any form or by any means without the prior written consent of Sophos.
Sophos and the Sophos logo are registered trademarks of Sophos Limited. Other names, logos and
marks mentioned in this document may be the trademarks or registered trademarks of Sophos
Limited or their respective owners.
While reasonable care has been taken in the preparation of this document, Sophos makes no
warranties, conditions or representations (whether express or implied) as to its completeness or
accuracy. This document is subject to change at any time without notice.
Sophos Limited is a company registered in England number 2096520, whose registered office is at
The Pentagon, Abingdon Science Park, Abingdon, Oxfordshire, OX14 3YP.
DURATION
10 minutes
In this chapter you will learn how to secure administrative access to Sophos Firewall and configure
when CAPTCHA is required for login.
The Sophos Firewall can be accessed in multiple ways; the preferred method for most
administrative tasks is to use the WebAdmin.
By default, the devices’ IP address will be 172.16.16.16 and the WebAdmin on a Sophos Firewall
runs on port 4444. So, to connect to the WebAdmin interface you would need to connect to
HTTPS://172.16.16.16:4444 on a brand-new device.
The default administrator username is admin, and the password for this is set as part of the initial
setup.
There is also a User Portal which can be accessed using HTTPS on port 443.
SSH Console
Default credentials
Username: admin
Password: admin
Although the Sophos Firewall is managed through a web interface, it also has a command line
interface (CLI) that is accessible through SSH or a console connection. You may want to use the CLI
to change the IP address of the management port to be in your LAN IP range so that you can
connect to the WebAdmin to complete the initial setup wizard.
To login to the CLI use the password of the built-in ‘admin’ user. The default admin password is
‘admin’; you change this as part of the initial setup wizard.
[Additional Information]
For deployments where multiple administrators will have access to the CLI, Public key
authentication can be used for SSH access. This provides access without needing to share the
admin password, and the public keys of multiple users can be uploaded. This also allows for better
logging and auditing as changes and actions will not all show as performed by ‘admin’.
Keys can be created using a tool such as PuTTY Key Generator on Windows, or ssh-keygen on Linux.
Sophos Firewall supports RSA, DSA and ECDSA keys of 1024, 2048 and 4096 bits in length. When
the SSH connection is authenticated using keys, the thumbprint of the key is logged in sshd.log
with the IP address that the connection was initiated from.
Here you can see a key that has been generated using PuTTY. The Public Key Authentication section
of Administration > Device access is used to add the public keys. To access the CLI, the
corresponding private key must be entered in the SSH tool.
[Additional Information]
Example log extract: /log/sshd.log:
[10269] Jul 20 09:20:45 Child connection from 172.16.16.10:49634
[10269] Jul 20 09:20:45 Pubkey auth succeeded for 'admin' with key sha1!!
cb:10:6e:38:37:27:e5:66:90:41:8a:36:c9:ae:53:ce:52:51:ca:05 from 172.16.16.10:49634
Device access allows an administrator to define what services are allowed or available in which
zones.
The default settings in device access allow minimal services in the WAN zone while allowing most
services in the LAN and WiFi zones. Best practice dictates that any services that are not needed
should be disabled for any zone in which they will not be used.
Source Network/Host
and Destination Host
Services
The Device access page also allows you to create local service ACL exception rules. These rules let
an administrator allow or deny access to specific services for specific hosts or networks.
You begin by adding a name for the rule and then selecting whether the rule should be placed at
the bottom or top of the existing list of rules.
Device access ACLs are applied to either IPv4 or IPv6. If you want to do both you need to create
separate rules.
Select the network zone from which the traffic or requests will be originating, and the source
networks or hosts within the zone that are going to be allowed or blocked.
Select the services that the ACL will apply to, and finally, select whether this is an accept or drop
rule.
This shows the ACL Exception rules with the newly created one placed at the bottom. These rules
are processed in order and override the Local Service ACL rules.
The default Device Access settings allow anyone in the LAN zone to
access the login page for the WebAdmin and to connect to the SSH
login
The default Device Access settings allow anyone in the LAN zone to access the login page for the
WebAdmin if they know the address, and then to connect to the SSH login.
What could be done on the Sophos Firewall in order to secure these connections, assuming that
you would like to allow access to the WebAdmin or SSH through the LAN zone?
Based on the default configuration of the device access section, if you were to lock down the
Sophos Firewall, what would you change?
Disable unnecessary
Disable zone-based services in zones
access to admin services
Optionally create ACLs on Disable PING where
Create specific ACL managed switches or possible to help prevent
exception rules to allow routes for the admin discovery and probing
access to admin services services
from specific network Remove SMTP relay and
segments/hosts SNMP from any zone that
does not require it
The simplest step to take is to disable the zone-based access to admin services and to only allow
access using targeted ACL exception rules. Create specific ACL exception rules to allow access to
admin services from specific network segments/hosts.
In addition, you could create ACLs on managed switches to control access to the admin services.
Remove SMTP relay and SNMP from any zone that does not require it.
Sophos Firewall displays a CAPTCHA on the WebAdmin and user portal login pages when they are
being accessed from the WAN zone and VPN zone. This is found to be very effective in preventing
automated attacks against the user portal and webadmin portals.
CAPTCHA can be enabled or disabled for VPN and WAN zone or just the VPN zone
console> system captcha-authentication-global show
Captcha authentication status:
Webadmin console: enabled
User portal: enabled
console> system captcha-authentication-vpn disable
Are you sure you want to disable captcha authentication when they are exposed on
the VPN zone (Y/N) ?
y
Captcha authentication for the webadmin and user portal is disabled on the VPN
zone
console> system captcha-authentication-vpn enable
Captcha authentication for the webadmin and user portal is enabled on VPN zone
You can enable and disable the CAPTCHA either globally, for both the WAN and VPN zone, or just
for the VPN zone. You cannot disable access for just the WAN zone on its own.
The configuration is managed via the console using the commands shown here.
[Additional Information]
You can also optionally specify to enable or disable it for the user portal or the WebAdmin by
appending for userportal or for webadminconsole to the commands:
Public key authentication can be configured for secure access to the CLI. This allows
access without the need to share the admin password
You can enable and disable the CAPTCHA either globally, for both the WAN and VPN
zone, or just the VPN zone. The configuration is managed via the console
Here are the three main things you learned in this chapter.
Public key authentication can be configured for secure access to the CLI. This allows access without
the need to share the admin password.
Administrative access can be secured by disabling zone-based access to services and creating local
service ACL exception rules to allow access to admin services from specific network
segments/hosts.
You can enable and disable the CAPTCHA either globally, for both the WAN and VPN zone, or just
for the VPN zone. The configuration is managed via the console.
Sophos Firewall
Version: 19.0v1
[Additional Information]
Sophos Firewall
FW1565: Getting Started with Traffic Shaping on Sophos Firewall
April 2022
Version: 19.0v1
© 2022 Sophos Limited. All rights reserved. No part of this document may be used or reproduced
in any form or by any means without the prior written consent of Sophos.
Sophos and the Sophos logo are registered trademarks of Sophos Limited. Other names, logos and
marks mentioned in this document may be the trademarks or registered trademarks of Sophos
Limited or their respective owners.
While reasonable care has been taken in the preparation of this document, Sophos makes no
warranties, conditions or representations (whether express or implied) as to its completeness or
accuracy. This document is subject to change at any time without notice.
Sophos Limited is a company registered in England number 2096520, whose registered office is at
The Pentagon, Abingdon Science Park, Abingdon, Oxfordshire, OX14 3YP.
DURATION
8 minutes
In this chapter you will learn how to configure the global settings for traffic shaping, including
default policy settings, and the different types of traffic shaping policy you can create.
Using traffic shaping policies, you can manage bandwidth and prioritize network traffic to reduce
the impact of heavy bandwidth usage.
What are some example scenarios where traffic shaping can be deployed to help optimize and
manage network performance?
Traffic shaping is primarily deployed to protect business continuity. With the increasing move to
using cloud services it is important to prioritize and guarantee bandwidth for these business critical
applications.
Another approach is to limit bandwidth of non-business critical heavy bandwidth applications, such
as streaming and downloads.
Traffic shaping is also a great tool for controlling the amount of bandwidth used by guest networks,
ensuring they do not impact more important business use.
To start using traffic shaping you should first configure the general traffic shaping settings. It is
important to specify the settings found on the CONFIGURE > System Services > Traffic shaping
settings tab.
This includes the total WAN bandwidth available, which Sophos Firewall needs so it can allocate
bandwidth effectively. The total available WAN bandwidth is the sum of the maximum bandwidth
of all WAN links in KBps.
To view bandwidth usage, click Show bandwidth usage at the bottom of the page.
The option Optimize for real-time (VoIP) gives priority to real-time traffic such as VoIP. If disabled,
priority will be applicable only for excess bandwidth, that is, bandwidth remaining after guaranteed
bandwidth allocation.
If ‘Optimize for Real-Time (VoIP)’ is enabled real-time traffic (Traffic Shaping policy with priority 0)
like VoIP will be given precedence over all other traffic.
As priority is given to the real time traffic, it is possible that some non-real-time traffic will not get
their minimum guaranteed bandwidth. Specifically, if the sum of Limit (max allowed) of all Traffic
Shaping policies (real-time and non real-time) is greater than total max-limit, then guaranteed
bandwidth of the real-time policies will be fulfilled but non-real-time might not get the minimum
guaranteed bandwidth.
The setting to Enforce guaranteed bandwidth should only be enabled if you would like to apply the
Default policy shown here to all traffic that does not have an explicit Traffic shaping policy applied
to it. If this option is enabled, you should take the time to configure the Default policy as well.
Enforce guaranteed bandwidth handles all Internet-bound traffic by the traffic-shaping policy
applied to it. If there is no policy applied to the traffic, it will be handled by the default policy.
• Enable this setting if you want to enforce bandwidth restriction on the traffic to which a traffic-
shaping policy is not applied
• Disable this setting if you do not want to enforce a bandwidth restriction on traffic to which a
traffic-shaping policy is not applied (it will handle traffic only on which a traffic-shaping policy is
applied)
If you have enabled Enforce guaranteed bandwidth you can configure the default policy to use for
traffic that does not have a traffic-shaping policy applied.
• Guarantee, is the minimum bandwidth available to the user
• Limit, is the maximum bandwidth available to the user
• Priority, can be set from 1 (highest) to 7 (lowest) depending on the traffic required to be shaped
Traffic shaping policies are configured in CONFIGURE > System services > Traffic shaping.
Traffic shaping policies can be applied to either users, rules, web categories or applications, and
can be used to either limit or guarantee bandwidth.
You can choose to set bandwidth limits for upload and download either separately or combined.
The Priority field is used to set the traffic type to which bandwidth priority is to be allocated. By
default, priority is assigned to realtime traffic. When priority is allocated to real-time traffic, the
ability of non-real time policies to receive their guaranteed bandwidth is determined by the
bandwidth remaining in the total available bandwidth after real-time policies have been serviced.
Bandwidth usage can either be configured to be individual or shared. Individual applies the policy
to a single user, firewall rule, web category or application. Shared applied to policy to all the users,
firewall rules web categories or applications which have the policy assigned.
[Additional Information]
Rule type:
• Limit User cannot exceed the defined bandwidth limit
• Guarantee User is guaranteed the specified bandwidth and can draw on bandwidth up to the
specified limit, if available. Allowing users to draw on additional bandwidth can ensure constant
service levels during peak periods
Let's look at an example policy. Here we have a policy to limit the bandwidth of streaming media
applications to 480p based on their web category as determined by the firewall.
We have set the association to Web categories and the Rule type to Limit. We then calculated the
bandwidth needed for 480p video to 1000 KB/s and set it as an individual limit, so each person
viewing a video will have enough bandwidth to view the video at 480p.
Finally, the Priority is set low. We have chosen a priority of 5 to make sure it is processed after any
business-critical applications.
Traffic shaping can also be applied to web categories under PROTECT > Web > Categories.
By editing a category, you can select a traffic shaping policy to apply to that web category,
independent of the firewall rule matched.
The total WAN bandwidth needs to be configured before using traffic shaping
You can configure a default traffic shaping policy for all traffic that does not have a policy
applied
Traffic shaping policies can be created for users, rules, web categories, and applications
Here are the three main things you learned in this chapter.
The total WAN bandwidth needs to be configured before using traffic shaping.
You can configure a default traffic shaping policy for all traffic that does not have a policy applied.
Traffic shaping policies can be created for users, rules, web categories, and applications.