I need to make NAT of internal IP addresses with one external source IPv6 address. Is it possible on FreeBSD 13.X? What to use for this: IPFW or PF?

As far as I understand IPFW can do prefix translation (NPTV6), but cannot replace all internal addresses with one external one. It seems like PF can do such NAT.


  • 1
    Main design principle in IPv6 is that all devices have a public routable IPv6 address. What is the problem you are trying to solve by doing IPv4 style NAPT with IPv6? Aug 1, 2022 at 19:46
  • My network is in the process of migrating to IPv6. It is configured using real addresses. Because of the multiple ISPs, there is no real routing to my IPv6 network, but there are a few dedicated ISP addresses that work. When the ISP fixes its problems (two years have passed), I will have to remove the NAT and everything will work as it should.
    – dshykuts
    Aug 2, 2022 at 7:31

1 Answer 1


Perhaps someone will need it: NAT for IPv6 works in PF. Among other things, in the configuration file /etc/pf.conf you need to write:

nat on eif0 from 1:2::/64 to any -> 5:6::7

where eif0 - your external interface name, 1:2::/64 - your internal IPv6 network, 5:6::7 - your external IPv6 address.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .