HomeFreeBSD

Add ipfw_nat64 module that implements stateless and stateful NAT64.

Description

Add ipfw_nat64 module that implements stateless and stateful NAT64.

The module works together with ipfw(4) and implemented as its external
action module.

Stateless NAT64 registers external action with name nat64stl. This
keyword should be used to create NAT64 instance and to address this
instance in rules. Stateless NAT64 uses two lookup tables with mapped
IPv4->IPv6 and IPv6->IPv4 addresses to perform translation.

A configuration of instance should looks like this:

  1. Create lookup tables:
  2. ipfw table T46 create type addr valtype ipv6
  3. ipfw table T64 create type addr valtype ipv4
  4. Fill T46 and T64 tables.
  5. Add rule to allow neighbor solicitation and advertisement:
  6. ipfw add allow icmp6 from any to any icmp6types 135,136
  7. Create NAT64 instance:
  8. ipfw nat64stl NAT create table4 T46 table6 T64
  9. Add rules that matches the traffic:
  10. ipfw add nat64stl NAT ip from any to table(T46)
  11. ipfw add nat64stl NAT ip from table(T64) to 64:ff9b::/96
  12. Configure DNS64 for IPv6 clients and add route to 64:ff9b::/96 via NAT64 host.

Stateful NAT64 registers external action with name nat64lsn. The only
one option required to create nat64lsn instance - prefix4. It defines
the pool of IPv4 addresses used for translation.

A configuration of instance should looks like this:

  1. Add rule to allow neighbor solicitation and advertisement:
  2. ipfw add allow icmp6 from any to any icmp6types 135,136
  3. Create NAT64 instance:
  4. ipfw nat64lsn NAT create prefix4 A.B.C.D/28
  5. Add rules that matches the traffic:
  6. ipfw add nat64lsn NAT ip from any to A.B.C.D/28
  7. ipfw add nat64lsn NAT ip6 from any to 64:ff9b::/96
  8. Configure DNS64 for IPv6 clients and add route to 64:ff9b::/96 via NAT64 host.

Obtained from: Yandex LLC
Relnotes: yes
Sponsored by: Yandex LLC
Differential Revision: https://reviews.freebsd.org/D6434

Details

Provenance
aeAuthored on
Differential Revision
D6434: [RFC/RFT] NAT64 implementation for ipfw.
Parents
rS304045: Set date and time formats back to what they were before CLDR
Branches
Unknown
Tags
Unknown