Important notices
Describe the bug
When Shared Forwarding is enabled together with Policy-Based Routing (PBR) on a WAN gateway, tcpdump consistently reports an invalid IPv4 header checksum on packets captured on the PPPoE WAN interface.
The issue is only observed with the combination of:
-
Shared Forwarding = Enabled
-
Policy-Based Routing (gateway selected on firewall rule) = Enabled
The checksum warning disappears immediately when Shared Forwarding is disabled while keeping the same PBR rule.
Hardware checksum offloading, TSO and LRO are all disabled.
The packets continue to function normally (ICMP replies are received), so this may be a packet capture/BPF ordering issue rather than an actual transmission problem.
Observed on OPNsense 26.7-RC2.
To Reproduce
-
Install OPNsense 26.7-RC2.
-
Configure a PPPoE WAN interface.
-
Configure a LAN interface.
-
Disable:
-
Hardware Checksum Offloading
-
Hardware TCP Segmentation Offloading
-
Hardware Large Receive Offloading
-
Set Outbound NAT to Hybrid.
-
Enable Shared Forwarding under System → Settings → Networking.
-
Create a LAN firewall rule using Policy-Based Routing by selecting the WAN gateway.
-
Start a capture:
tcpdump -ni pppoe0 -vvv -xx icmp
-
Generate traffic, for example:
or
-
Observe the packet capture.
-
Disable Shared Forwarding while leaving the PBR rule unchanged.
-
Repeat the capture.
Expected behavior
tcpdump should report a valid IPv4 header checksum regardless of whether Shared Forwarding is enabled.
Actual behavior
With Shared Forwarding enabled:
IP (tos 0x0, ttl 9, id 41299, offset 0, flags [none], proto ICMP (1), length 64, bad cksum 0ed4 (->0fd4)!)
<WAN-IP> > 9.9.9.11: ICMP echo request
Hex dump:
4500 0040 a153 0000 0901 0ed4
tcpdump recalculates the checksum as:
The difference is consistently:
which appears to correspond to the IPv4 TTL field.
The ICMP checksum is not reported as invalid.
Traffic itself appears to function normally.
Reproduction matrix
Shared Forwarding | Policy Routing | Result
-- | -- | --
Disabled | Disabled | No checksum warning
Disabled | Enabled | No checksum warning
Enabled | Disabled | No checksum warning
Enabled | Enabled | IPv4 header checksum reported as invalid by tcpdump
Describe alternatives you considered
-
Disabled Hardware Checksum Offloading
-
Disabled TSO
-
Disabled LRO
-
Verified the issue disappears when Shared Forwarding is disabled
-
Verified the issue is independent of Outbound NAT mode (Hybrid used during testing)
Relevant log files
Example capture:
14:44:33.724226 IP (tos 0x0, ttl 9, id 41299, offset 0, flags [none], proto ICMP (1), length 64, bad cksum 0ed4 (->0fd4)!)
<WAN-IP> > 9.9.9.11: ICMP echo request, id 35890, seq 33043, length 44
0x0000: 0200 0000 4500 0040 a153 0000 0901 0ed4
0x0010: 75d9 78a9 0909 090b 0800 eab9 8c32 8113
sysctl net.inet.ip.forwarding
net.inet.ip.forwarding: 1
Additional context
The checksum mismatch is consistently 0x0100 lower than the value calculated by tcpdump.
This suggests that tcpdump may be observing the packet after the IPv4 TTL has been modified but before the IPv4 header checksum has been updated, although I have not confirmed this in the kernel.
If this is expected due to the Shared Forwarding packet path, it would be helpful to clarify. Otherwise, this may indicate a regression in the interaction between Shared Forwarding, policy routing (route-to), and packet capture on PPPoE interfaces.
Environment
OPNsense 26.7-RC2 (amd64)
WAN: PPPoE
LAN: Ethernet
Outbound NAT: Hybrid
Shared Forwarding: Enabled
Hardware Checksum Offloading: Disabled
Hardware TSO: Disabled
Hardware LRO: Disabled
Important notices
Describe the bug
When Shared Forwarding is enabled together with Policy-Based Routing (PBR) on a WAN gateway,
tcpdumpconsistently reports an invalid IPv4 header checksum on packets captured on the PPPoE WAN interface.The issue is only observed with the combination of:
The checksum warning disappears immediately when Shared Forwarding is disabled while keeping the same PBR rule.
Hardware checksum offloading, TSO and LRO are all disabled.
The packets continue to function normally (ICMP replies are received), so this may be a packet capture/BPF ordering issue rather than an actual transmission problem.
Observed on OPNsense 26.7-RC2.
To Reproduce
or
Expected behavior
tcpdumpshould report a valid IPv4 header checksum regardless of whether Shared Forwarding is enabled.Actual behavior
With Shared Forwarding enabled:
Hex dump:
tcpdumprecalculates the checksum as:The difference is consistently:
which appears to correspond to the IPv4 TTL field.
The ICMP checksum is not reported as invalid.
Traffic itself appears to function normally.
Reproduction matrix
Describe alternatives you considered
Relevant log files
Example capture:
Additional context
The checksum mismatch is consistently 0x0100 lower than the value calculated by
tcpdump.This suggests that
tcpdumpmay be observing the packet after the IPv4 TTL has been modified but before the IPv4 header checksum has been updated, although I have not confirmed this in the kernel.If this is expected due to the Shared Forwarding packet path, it would be helpful to clarify. Otherwise, this may indicate a regression in the interaction between Shared Forwarding, policy routing (
route-to), and packet capture on PPPoE interfaces.Environment