HomeDevCentral

Reconfigure packet forwarding for router-001

Description

Reconfigure packet forwarding for router-001

Summary:
On reboot, the routing service overwrites net.inet.ip.forwarding, so the value
in /etc/sysctl.conf isn't relevant.

Here the relevant code from /etc/rc.d/routing on FreeBSD 13.1p5:

if checkyesno gateway_enable; then
    ropts_init inet
    echo -n ' gateway=YES'
    ${SYSCTL} net.inet.ip.forwarding=1 > /dev/null
else
    ${SYSCTL} net.inet.ip.forwarding=0 > /dev/null
fi

So, as documented in the handbook, the expected configuration
is by setting the gateway_enable variable.

This change partially reverts 6deb32e01378 / D2596.

Test Plan: /etc/rc.d/routing restart

Reviewers: dereckson

Reviewed By: dereckson

Differential Revision: https://devcentral.nasqueron.org/D2757

Details

Provenance
derecksonAuthored on Jan 26 2023, 17:16
derecksonPushed on Jan 26 2023, 17:25
Reviewer
dereckson
Differential Revision
D2757: Reconfigure packet forwarding for router-001
Parents
rOPSa39aa0442e38: Apply Intranought netmask to all relevant VMs
Branches
Unknown
Tags
Unknown
Reverts
D2596: Set kernel state for router
rOPS6deb32e01378: Set kernel state for router