Important note about SSL VPN compatibility for 20.0 MR1 with EoL SFOS versions and UTM9 OS. Learn more in the release notes.

Sophos Firewall: Using NAT to achieve NTP proxy like functionality

Disclaimer: This information is provided as-is for the benefit of the Community. Please contact Sophos Professional Services if you require assistance with your specific environment.


Table of Contents

Overview

The new engine provides great flexibility when solving interesting network problems.  I don't know if it has been shared here, but you can use NAT to achieve NTP proxy-like functionality.  A standard use case seen is that clients would like to use the IP address of the firewall as the NTP server. Consider this as an example environment:

  • The firewall has at least two interfaces: LAN and WAN. The LAN interface has an RFC1918 address, and the WAN interface utilizes a public address.
  • Clients behind the firewall would like to use the LAN interface IP as the NTP 'server'. In this regard, the default gateway and NTP destination on your clients use the same address.  
  • The NTP server you want to sync with is external to the organization, e.g. pool.ntp.org.

Types of Transparent NTP

There are two different approaches to a transparent NTP solution. 

1. NTP must be forwarded to a specific external (WAN) host/host group.

2. NTP must be forwarded to its resources within the network, and this server must provide the information. 

1st Scenario

The first scenario is rather simple.

It would be best to have one NAT Rule, which translates everything NTP-based to a specific host. 

You can specify all internal hosts with "Interface matching criteria - Inbound Interfaces". 
This example shows ANY. You can select all internal network interfaces (except WAN). 

This rule will fetch all NTP-related traffic, forward it to a public NTP service, and use MASQ. MASQ is required for WAN-related traffic. 

It would be best if you had a firewall rule: 

You can attach IPS rules to this if you want.
Build your own NTP rule with all NTP-related IPS patterns. 

Regardless of the configured IP on a client behind Sophos Firewall, the NTP request will work.
(Example: 1.2.3.4)

2nd Scenario

The second scenario needs more rules, as you can easily generate an NTP loop. 
Your internal server needs its own NAT rule and firewall rule. 
Example = Windows2016 is a NTP server. 

NAT Rule 1# 
NTP Server to WAN (to get the NTP server to the WAN NTP servers.)
You can also force the internal NTP server to get the IP from a specific NTP pool, but we assume the NTP server has its own NTP request pool. 

NAT 2# 
It’ll forward the NTP traffic transparently to the internal NTP server. 

  Firewall rules:

Firewall rule #1

Allowing the traffic of the NTP server to the WAN to get current time. 

 Firewall rule #2

Allowing the Traffic from all internal clients to the internal NTP server. 
Notice the destination zone. 

 You can naturally create variations of this NAT policy based on your network configuration and the location of the NTP server.




Revamped RR
[edited by: Erick Jan at 9:14 AM (GMT -7) on 18 Sep 2024]
Parents
  • Hello,

    are these ntp configuration workarounds still working? I do not get it running. In drppkt-viewer, I see blocked packets. Packets are going from zone1, what is Lan to a zone named local, that is XG itself. But actually it seems, that some is still wrong. I followed this tutorial here or also this one. www.youtube.com/watch

    Date=2022-04-28 Time=17:05:12 log_id=0103021 log_type=Firewall log_component=Local_ACLs log_subtype=Denied log_status=N/A log_priority=Alert duration=N/A in_dev=Port1 out_dev= inzone_id=1 outzone_id=4 source_mac=123456 dest_mac=654321 bridge_name= l3_protocol=IPv4 source_ip=1.1.1.1 dest_ip=2.2.2.2 l4_protocol=UDP source_port=54246 dest_port=123 fw_rule_id=N/A policytype=0 live_userid=0 userid=0 user_gp=0 ips_id=0 sslvpn_id=0 web_filter_id=0 hotspot_id=0 hotspotuser_id=0 hb_src=0 hb_dst=0 dnat_done=0 icap_id=0 app_filter_id=0 app_category_id=0 app_id=0 category_id=0 bandwidth_id=0 up_classid=0 dn_classid=0 nat_id=0 cluster_node=0 inmark=0x0 nfqueue=0 gateway_offset=0 connid=1283577792 masterid=0 status=256 state=0, flag0=549757911040 flags1=17179869184 pbdid_dir0=0 pbrid_dir1=0

    1.1.1.1=IP of ntp client in local lan
    2.2.2.2=IP of UTM

    zoneid | zonename | zonetype | description | system_zone | displaystatus | moveable
    --------+----------+----------+-------------+-------------+---------------+----------
    1 | LAN | 1 | | 1 | 1 | 1
    2 | WAN | 2 | | 1 | 1 | 1
    3 | DMZ | 3 | | 1 | 1 | 1
    4 | LOCAL | 4 | | 1 | 0 | 1
    5 | VPN | 5 | | 1 | 1 | 1
    6 | Discover | 6 | | 1 | 0 | 1
    7 | WiFi | 1 | | 1 | 1 | 1

    Any idea, what might be the issue here?

  • Most likely the Rule does not match or you do not have a SNAT enabled. 

    __________________________________________________________________________________________________________________

  • I think it was the firewallrule. The firewallrule has to have the Lokal XG IP as destination, now it is working.

    Thanks.

Reply Children
No Data