Page MenuHomeFreeBSD

netgraph: Add RFC 6598/Carrier Grade NAT support to ng_nat
ClosedPublic

Authored by nc on Feb 2 2020, 12:18 AM.
Referenced Files
Unknown Object (File)
Wed, Apr 10, 12:33 AM
Unknown Object (File)
Feb 10 2024, 10:03 PM
Unknown Object (File)
Jan 24 2024, 5:31 PM
Unknown Object (File)
Jan 10 2024, 9:08 PM
Unknown Object (File)
Dec 20 2023, 2:14 AM
Unknown Object (File)
Dec 12 2023, 3:28 PM
Unknown Object (File)
Dec 6 2023, 6:42 PM
Unknown Object (File)
Nov 23 2023, 11:08 AM

Details

Summary

netgraph: Add RFC 6598/Carrier Grade NAT support to ng_nat.

This extends upon the RFC 6598 support to libalias/ipfw in r357092.

Submitted by: Neel Chauhan <neel AT neelc DOT org>

Test Plan

Load the kernel module

kldunload ng_ipfw

Replace WAN_IP with the WAN IPv4, and WAN_IF with the WAN interface.

Set the netgraph rules.

ngctl mkpeer ipfw: nat 60 out
ngctl name ipfw:60 nat
ngctl connect ipfw: nat: 61 in
ngctl msg nat: setaliasaddr WAN_IP
ngctl msg nat: setmode "{flags=0x100}"

Set the ipfw rules.

ipfw add 300 netgraph 61 all from any to any in via WAN_IF
ipfw add 400 netgraph 60 all from any to any out via WAN_IF

Set the sysctl:

sysctl net.inet.ip.fw.one_pass=0

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

Of course, the change is straight forward, but can we please have some words in the man page explaining how the names of the flags match the correspondent names in libalias.

I added the explanation in the man page.

This revision is now accepted and ready to land.Feb 13 2020, 8:05 AM
bcr added a subscriber: bcr.

Manpages is also good with this change. Thanks for the implementation.

Can you please add "TESTING" section?

Here, added the testing section.

kp added a subscriber: kp.

Approved by: kp (mentor)

Don't forget to update the man page date before you commit.