| Tested on | RHEL 10.2 (Coughlan) — vm1.lab.example (target) and vm2.lab.example (remote probe) |
|---|---|
| Package | firewalld 2.4.3-2.el10_2nftables 1.1.5-5.el10_2iptables-nft 1.8.11-15.el10_2nmap 7.92-5.el10 (nping) |
| Applies to | RHEL, Rocky Linux, AlmaLinux, Fedora, Debian, Ubuntu, and other Linux hosts with firewalld, nftables, iptables-nft, or UFW |
| Privilege | sudo or root to change firewall policy |
| Scope | Drop IPv4 ICMP timestamp-request (type 13) and optionally timestamp-reply (type 14) using method-specific firewall configuration, verify from a second host, and remove rules cleanly. Does not cover ICMPv6, network-edge ACL design, full firewall policy baselines, or blocking all ICMP echo traffic. |
| Related guides | firewalld cheat sheet hping3 command nmap command UFW command Patch management and security updates |
Security scanners often flag ICMP timestamp support (CVE-1999-0524 and similar findings) because a host that answers type 13 (timestamp-request) returns type 14 (timestamp-reply) with clock values. That leak is minor compared with an unpatched service, but compliance workflows still expect you to stop responding.
Linux answers timestamp requests in software when the packet reaches the network stack. There is no supported sysctl like net.ipv4.icmp_echo_ignore_all for timestamps—you filter at the firewall. The sections below are grouped by firewall method (firewalld, nftables, iptables, UFW), not by distribution.
Quick answer
| Method | When to use it | Block incoming type 13 | Block outgoing type 14 |
|---|---|---|---|
| firewalld | Host already managed by firewalld |
Rich rule with family="ipv4" or --add-icmp-block=timestamp-request on the active zone |
Optional; see nftables OUTPUT rule if you need explicit egress drop |
| nftables | Standalone nftables or custom ruleset | nft add rule … input icmp type timestamp-request drop |
nft add rule … output icmp type timestamp-reply drop |
| iptables / iptables-nft | No firewalld; you own filter tables |
iptables -I INPUT … timestamp-request |
iptables -I OUTPUT … timestamp-reply |
UFW before.rules |
Ubuntu/Debian hosts using UFW | Edit /etc/ufw/before.rules |
Same file, ufw-before-output chain |
Pick one method per host. Stacking firewalld rules and manual nftables tables without planning can duplicate drops or fight for hook priority.
What ICMP timestamp types mean
ICMP carries control messages beside TCP and UDP. Two IPv4 types matter for hardening (RFC 792). ICMPv6 defines a separate message registry and has no timestamp request or reply equivalents.
| ICMP type | Name | Direction you care about |
|---|---|---|
| 13 | timestamp-request | Inbound to your host from scanners or tools |
| 14 | timestamp-reply | Outbound from your host after the kernel accepts a request |
Modern time sync uses NTP or PTP, not ICMP timestamps. Blocking type 13 on INPUT stops remote hosts from eliciting replies. Dropping type 14 on OUTPUT is optional—useful if you want explicit egress control or tools that generate replies locally.
Verify before and after changes
Run tests from a second machine when possible. Loopback checks miss the INPUT path your scanner uses.
On the target host (vm1.lab.example in our lab), confirm the kernel responds before any firewall change:
nping --icmp --icmp-type 13 -c 1 -H 127.0.0.1Sample output:
Max rtt: 0.017ms | Min rtt: 0.017ms | Avg rtt: 0.017ms
Raw packets sent: 1 (40B) | Rcvd: 1 (40B) | Lost: 0 (0.00%)From the probe host (vm2.lab.example), aim at the target address:
nping --icmp --icmp-type 13 -c 2 -H 192.168.56.116Sample output before filtering:
Raw packets sent: 2 (80B) | Rcvd: 2 (92B) | Lost: 0 (0.00%)
Nping done: 1 IP address pinged in 1.02 secondsAfter you apply one of the firewall methods below, run the same remote nping command again. A successful block shows 100% packet loss and Rcvd: 0 in the summary line.
Install nmap on the probe host if nping is missing (dnf install nmap on RHEL-family systems). hping3 with --icmp --icmptype 13 is an alternative where packaged.
Block with firewalld
Use this path when firewall-cmd --state reports running and you already manage zones through firewalld. All rules here target IPv4 only (family="ipv4"), which matches the ICMP types scanners test.
Rich rule (explicit drop)
Add a rich rule that drops IPv4 timestamp requests in the default zone:
sudo firewall-cmd --permanent --add-rich-rule='rule family="ipv4" icmp-type name="timestamp-request" drop'Load the permanent configuration into the running firewall:
sudo firewall-cmd --reloadConfirm the rule is present:
sudo firewall-cmd --list-rich-rules | grep timestampSample output:
rule family="ipv4" icmp-type name="timestamp-request" dropRe-run the remote nping probe from your second host. On our RHEL 10.2 lab, that alone moved the result from 0% loss to 100% loss without a separate OUTPUT rule—dropped requests never reach the code that would emit type 14.
Do not combine protocol value="icmp" and icmp-type in one rich rule; firewalld 2.4 rejects that combination as INVALID_RULE.
A rich rule uses an explicit drop action. That differs from firewall-cmd --add-icmp-block, which applies a zone reject for the ICMP type—both stop remote timestamp replies when the block is on the zone that owns your tested interface.
ICMP block (zone reject)
firewalld also supports blocking timestamp requests through the zone ICMP-block list:
sudo firewall-cmd --permanent --add-icmp-block=timestamp-requestLoad the permanent configuration into the running firewall:
sudo firewall-cmd --reloadConfirm which zone owns the interface you tested:
sudo firewall-cmd --get-active-zonesList ICMP blocks for that zone:
sudo firewall-cmd --list-icmp-blocksSample output:
public (default)
interfaces: enp0s8
timestamp-requestIf the tested NIC sits in a non-default zone, pass --zone= when you add the block. After reload, run the same remote nping probe from your second host.
To roll back an ICMP block, remove it from the permanent configuration:
sudo firewall-cmd --permanent --remove-icmp-block=timestamp-requestApply the change to the running firewall:
sudo firewall-cmd --reloadTo roll back the rich-rule method, remove the permanent rule and reload firewalld:
sudo firewall-cmd --permanent --remove-rich-rule='rule family="ipv4" icmp-type name="timestamp-request" drop'The remove command exits silently on success. Apply the change to the running firewall:
sudo firewall-cmd --reloadBlock with nftables
Use native nftables when no front end manages the ruleset, or when you attach a dedicated table with a clear priority on top of existing hooks.
Create a table and chains (one-time setup):
sudo nft add table inet filterRegister an input hook on that table:
sudo nft 'add chain inet filter input { type filter hook input priority 0; policy accept; }'The input chain is registered when that command exits without an error. Add the matching output hook on the same table:
sudo nft 'add chain inet filter output { type filter hook output priority 0; policy accept; }'Drop incoming timestamp requests:
sudo nft add rule inet filter input icmp type timestamp-request dropOptionally drop outbound timestamp replies on OUTPUT:
sudo nft add rule inet filter output icmp type timestamp-reply dropRemote nping from vm2 showed 100% loss on vm1 with a temporary inet glc_test table at priority -300 using the same match syntax.
Persist rules under /etc/nftables.conf or a file in /etc/nftables/ included from there, then enable the unit:
sudo systemctl enable --now nftablesOn firewalld-managed hosts, prefer firewalld instead of a parallel inet filter table unless you understand hook ordering.
List the table when you need rule handles for deletion:
sudo nft list table inet filterDelete the input rule by handle number from that listing:
sudo nft delete rule inet filter input handle <num>Remove the output rule the same way when you added one:
sudo nft delete rule inet filter output handle <num>Block with iptables
iptables-nft remains the CLI many scripts expect. It works on hosts without firewalld owning the tables.
Block incoming timestamp requests at the top of INPUT:
sudo iptables -I INPUT 1 -p icmp --icmp-type timestamp-request -j DROPAdd a matching drop for outbound replies on OUTPUT:
sudo iptables -I OUTPUT 1 -p icmp --icmp-type timestamp-reply -j DROPConfirm the INPUT rule is present:
sudo iptables -L INPUT -n | grep -i timestampCheck the OUTPUT chain the same way:
sudo iptables -L OUTPUT -n | grep -i timestampSample output:
DROP icmp -- 0.0.0.0/0 0.0.0.0/0 icmptype 13
DROP icmp -- 0.0.0.0/0 0.0.0.0/0 icmptype 14Save according to your distribution (iptables-save to /etc/sysconfig/iptables on RHEL-family systems with legacy persistence, or a netfilter-persistent package on Debian/Ubuntu).
On vm1 with active firewalld, raw iptables -I failed with iptables-restore … RULE_INSERT failed (No such file or directory)—another sign to use firewalld or nftables instead of fighting the active ruleset.
Remove the rules by exact specification when you roll back:
sudo iptables -D INPUT -p icmp --icmp-type timestamp-request -j DROPDrop the matching OUTPUT rule with the same syntax:
sudo iptables -D OUTPUT -p icmp --icmp-type timestamp-reply -j DROPBlock with UFW before.rules
UFW does not expose per-ICMP-type CLI toggles. Edit the before rules file so drops apply before UFW evaluates its allow/deny policy.
Open /etc/ufw/before.rules and add these lines inside the *filter section, before the final COMMIT:
-A ufw-before-input -p icmp --icmp-type timestamp-request -j DROP
-A ufw-before-output -p icmp --icmp-type timestamp-reply -j DROPReload UFW so the file is applied:
sudo ufw reloadCheck status:
sudo ufw status verboseUFW still uses iptables/nftables underneath; the exact file layout matches Debian and Ubuntu packaging. See UFW command for enable order—allow SSH before ufw enable on remote servers.
To revert, remove the two lines from /etc/ufw/before.rules and run sudo ufw reload again.
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
Remote nping still receives replies |
Rule not in the active path, or wrong method for your manager | Confirm firewall-cmd --list-rich-rules or nft list ruleset; retest from a remote host |
--icmp-block listed but remote probe still gets replies |
Block applied to a zone that does not own the tested interface | Run firewall-cmd --get-active-zones; add --icmp-block to that zone, reload, and retest with nping |
INVALID_RULE: … icmp-type and protocol value="icmp" |
Invalid firewalld rich syntax | Use rule family="ipv4" icmp-type name="timestamp-request" drop only |
iptables-restore … RULE_INSERT failed |
firewalld owns tables; raw iptables insert | Switch to firewalld or a dedicated nftables table |
| Loopback works, remote probe fails differently | Expected—test from another host on INPUT |
Run nping from a second machine or security scanner segment |
| Lost SSH after editing UFW | Enabled UFW without allow rule | Console access; add ufw allow OpenSSH before enable |
References
- RFC 792 — ICMP
- IANA ICMP parameters
- firewalld rich rules — Red Hat documentation
- firewalld ICMP types — firewalld.org
- nftables wiki — Official wiki
- UFW community documentation — Ubuntu
Summary
ICMP timestamp findings are fixed at the firewall, not with a kernel sysctl. Block timestamp-request (type 13) on the path scanners use—usually the host INPUT hook or firewalld zone—and confirm from a second host with nping or your scanner’s plugin.
When firewalld already runs the machine, a permanent rich rule with family="ipv4" dropping timestamp-request is the most explicit path; --add-icmp-block=timestamp-request on the active zone is another supported firewalld method. Use nftables on hosts you manage with nft directly, iptables when no front end conflicts, and UFW before.rules on Ubuntu-style UFW deployments.
After you deploy a method, keep the verification command in your change record. Compliance rescans only care that a remote IPv4 type 13 request no longer produces a type 14 reply on the network path they test.

