UFW silently overrides sysctl.conf, breaking kernel settings like IP forwarding
On Linux hosts running UFW, the firewall ships its own sysctl configuration file at /etc/ufw/sysctl.conf, which takes precedence over the standard /etc/sysctl.conf when the firewall starts. This means settings such as net.ipv4.ip_forward can be silently reverted to 0 even after a user correctly configures them, with no warning or log entry generated. The issue commonly surfaces when a WireGuard VPN tunnel appears to connect but passes no traffic, because IP forwarding has been quietly disabled. Users can verify the active kernel value via sysctl net.ipv4.ip_forward or by reading /proc/sys/net/ipv4/ip_forward, then check /etc/ufw/sysctl.conf for a conflicting entry using either dot or slash notation. A read-only Python 3 tool has been released that compares effective kernel sysctl values against declared settings and flags any discrepancies without modifying the system.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in