Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    • Register
    • Login
    Introducing Netgate Nexus: Multi-Instance Management at Your Fingertips.

    RFC1918 Best Practices: Hardening WAN Egress Alias with APIPA/CGNAT on Static IP Connections?

    Scheduled Pinned Locked Moved Firewalling
    rfc1918egress
    14 Posts 8 Posters 1.0k Views 10 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • JonathanLeeJ
      JonathanLee
      last edited by

      Hello fellow Netgate community members,

      I am currently hardening a pfSense that has a dedicated Static Public IP assigned directly to the WAN interface.

      Following the official Netgate recipe for Preventing RFC 1918 Traffic from Exiting a WAN Interface, I created a dedicated RFC1918 network alias to apply to my outbound WAN block rules. (floating rule)

      eca9130b-c5ef-4f57-8f6a-52ac6900d02f-image.png

      To make it as comprehensive as possible for catching local information leaks or misbehaving local DHCP configurations, I included the main subnets along with the standard APIPA Link-Local block:

      • 10.0.0.0/8 (Class A Private)
      • 172.16.0.0/12 (Class B Private)
      • 192.168.0.0/16 (Class C Private)
      • 169.254.0.0/16 (Link-Local / APIPA)

      My Questions for the Community:
      Given that I have a true static IP setup (completely bypassing Carrier-Grade NAT on my side), is there any security benefit to manually injecting the CGNAT range (100.64.0.0/10) directly into this specific alias, or should it be left out to keep the alias strictly clean?

      Is it preferred to handle CGNAT/APIPA entirely via the global "Block Bogon Networks" checkbox on the WAN interface settings page rather than nesting non-RFC1918 parameters inside a custom alias?

      Would love to hear how other engineers structure this block for clean rule management. Thanks in advance for the advice!

      654fd178-ad04-4626-97ae-f4824c05c6f9-image.png

      Ref:
      https://docs.netgate.com/pfsense/en/latest/recipes/rfc1918-egress.html

      Make sure to upvote

      chpalmerC 1 Reply Last reply
      Reply Quote 0
      • chpalmerC
        chpalmer @JonathanLee
        last edited by

        @JonathanLee "Given that I have a true static IP setup (completely bypassing Carrier-Grade NAT on my side), is there any security benefit to manually injecting" any private LAN type address?

        No. Other than if you don't want to see the attempts. The WAN is already default block all unless you build a rule to allow something.

        I personally would like any such attempts on my WAN side to show up in the "firewall logs". I rarely to never see any unless someone has erroneously (or for ill intent) did/does something dumb.. (like the local fire department did one time a few years ago.. 🙄 )

        Triggering snowflakes one by one..
        Primary- Intel(R) Pentium(R) CPU G4400 @ 3.30GHz on an M470 WG box. pfsense+ 26.07

        1 Reply Last reply
        Reply Quote 0
        • M
          marcosm Netgate
          last edited by

          FYI there's already a built-in alias for those networks. See Firewall > Aliases > All

          JonathanLeeJ 1 Reply Last reply
          Reply Quote 0
          • JonathanLeeJ
            JonathanLee @marcosm
            last edited by

            @marcosm There is only onees I made in there.... must be something new right?

            Make sure to upvote

            patient0P 1 Reply Last reply
            Reply Quote 0
            • patient0P
              patient0 @JonathanLee
              last edited by

              @JonathanLee said in RFC1918 Best Practices: Hardening WAN Egress Alias with APIPA/CGNAT on Static IP Connections?:

              There is only onees I made in there.... must be something new right?

              I think you gotta mention (in every thread) that you're on an ancient pfSense+ version with your 2100 ;).
              The built-in alias' are a relatively new thing, yes.

              JonathanLeeJ 1 Reply Last reply
              Reply Quote 4
              • JonathanLeeJ
                JonathanLee @patient0
                last edited by JonathanLee

                @patient0

                680d0272-4c1a-45cd-afd9-2400818e9666-image.png

                It basically works fine .... I mean just type go to alias right?

                Make sure to upvote

                johnpozJ patient0P luckman212L 3 Replies Last reply
                Reply Quote 2
                • johnpozJ
                  johnpoz LAYER 8 Global Moderator @JonathanLee
                  last edited by

                  @JonathanLee I am not exactly sure when the new built in aliases started, but they do include apipa and cgnat ranges - along with a few others

                  _reserved4_ 	Network(s) 	IPv4 networks reserved for local use.
                  
                  0.0.0.0/8, 10.0.0.0/8, 100.64.0.0/10, 127.0.0.0/8, 169.254.0.0/16, 172.16.0.0/12,
                  192.0.0.0/24, 192.0.2.0/24, 192.88.99.0/24, 192.168.0.0/16, 198.18.0.0/15,
                  198.51.100.0/24, 203.0.113.0/24, 224.0.0.0/4, 240.0.0.0/4, 255.255.255.255/32 
                  

                  An intelligent man is sometimes forced to be drunk to spend time with his fools
                  If you get confused: Listen to the Music Play
                  Please don't Chat/PM me for help, unless mod related
                  SG-4860 26.07 | Lab VMs 2.9.0, 26.07

                  tinfoilmattT JonathanLeeJ 2 Replies Last reply
                  Reply Quote 1
                  • patient0P
                    patient0 @JonathanLee
                    last edited by

                    @JonathanLee said in RFC1918 Best Practices: Hardening WAN Egress Alias with APIPA/CGNAT on Static IP Connections?:

                    @patient0
                    <snip>
                    It basically works fine .... I mean just type go to alias right?

                    😁

                    1 Reply Last reply
                    Reply Quote 0
                    • tinfoilmattT
                      tinfoilmatt LAYER 8 @johnpoz
                      last edited by

                      Pretty sure it was only somewhat recently with the 2.8.x/25.xx releases.

                      block out log on { ix0 } inet from any to any
                      block out log on { ix0 } inet6 from any to any

                      1 Reply Last reply
                      Reply Quote 0
                      • JonathanLeeJ
                        JonathanLee
                        last edited by

                        So I made a list based on this forum thanks everyone

                        IPv4 Special & Private Ranges
                        • 0.0.0.0 / 8 — Local System Broadcast Placeholder
                        Used by local devices as a source placeholder before they are assigned an IP address. It should never route traffic across the internet. (Safe to block since this firewall uses a Static WAN IP).
                        • 10.0.0.0 / 8 — Private Network (RFC 1918 Class A)
                        Reserved strictly for local, internal business and enterprise networks.
                        • 100.64.0.0 / 10 — Carrier-Grade NAT (CGNAT)
                        Used internally by Internet Service Providers (ISPs) to share public IP addresses among multiple subscribers. It should never cross into your local network from the public WAN.
                        • 127.0.0.0 / 8 — Localhost Loopback
                        Reserved for a device to talk to itself internally. Internet traffic claiming to originate from 127.x.x.x is 100% malicious IP spoofing.
                        • 169.254.0.0 / 16 — Link-Local / APIPA
                        Automatically assigned by devices to talk to immediate neighbors on a local switch if a DHCP server cannot be found. Unroutable over the internet.
                        • 172.16.0.0 / 12 — Private Network (RFC 1918 Class B)
                        Reserved for internal local area networks.
                        • 192.0.0.0 / 24 — IETF Protocol Assignments
                        Reserved strictly for core cryptographic and ds-lite protocol operations by the IETF.
                        • 192.0.2.0 / 24 — Documentation (Test-Net-1)
                        Reserved exclusively for textbooks, manuals, and configuration examples. No live internet infrastructure uses this space.
                        • 192.88.99.0 / 24 — Legacy 6to4 Anycast Relay
                        An old, deprecated IPv6-to-IPv4 translation mechanism. It is heavily abused by attackers today for DDoS amplification traffic.
                        • 192.168.0.0 / 16 — Private Network (RFC 1918 Class C)
                        The standard private IP block used by almost all home routers and small office networks worldwide.
                        • 198.18.0.0 / 15 — Benchmark Testing
                        Reserved under RFC 2544 for testing lab equipment performance and network device throughput.
                        • 198.51.100.0 / 24 — Documentation (Test-Net-2)
                        Reserved exclusively for technical documentation and educational examples.
                        • 203.0.113.0 / 24 — Documentation (Test-Net-3)
                        Reserved exclusively for technical documentation and educational examples.
                        • 224.0.0.0 / 4 — IP Multicast (Class D)
                        Reserved for local multicast streaming protocols and router discovery. Public internet traffic should never unicast from this block.
                        • 240.0.0.0 / 4 — Reserved Space (Class E)
                        Reserved for future use and experimental research. No legitimate public traffic routes out of this space.
                        • 255.255.255.255 / 32 — Limited Local Broadcast
                        Used for local subnet data broadcasting. It cannot pass through an internet router.

                        🪐 IPv6 Special & Private Ranges
                        • ::1 / 128 — IPv6 Loopback Address
                        The IPv6 equivalent of 127.0.0.1. Used for internal host diagnostics.
                        • :: / 128 — Unspecified Address
                        A placeholder network header used before an interface has been assigned an IPv6 address.
                        • ::ffff:0:0 / 96 — IPv4-Mapped IPv6 Addresses
                        Used internally inside applications to format standard IPv4 addresses into an IPv6 structure for backward compatibility.
                        • 100:: / 64 — Discard-Only Prefix
                        Reserved strictly for dropping traffic during blackhole routing or configuration testing.
                        • 2001:db8:: / 32 — IPv6 Documentation Prefix
                        The IPv6 equivalent of the test networks. Used only in textbook examples and manuals.
                        • 3fff:: / 20 — Additional Documentation Prefix
                        A newer block reserved to provide additional documentation space for examples.
                        • fec0:: / 10 — Deprecated Site-Local Unicast
                        An old, obsolete private space implementation. Modern systems have replaced this entirely, making it safe to drop.

                        Crucial Configuration Note for Hurricane Electric (HE) Tunnel Users
                        If you run a Hurricane Electric IPv6 Tunnel Broker, keep in mind:

                        1. Do not add fe80::/10 (Link-Local) to a global block list, as your tunnel endpoint requires Link-Local space to handle neighbor routing.

                        Make sure to upvote

                        1 Reply Last reply
                        Reply Quote 1
                        • JonathanLeeJ
                          JonathanLee @johnpoz
                          last edited by

                          @johnpoz why did you add 192.18.0.0/15 isnt that oracle's address space?

                          Make sure to upvote

                          johnpozJ 1 Reply Last reply
                          Reply Quote 0
                          • johnpozJ
                            johnpoz LAYER 8 Global Moderator @JonathanLee
                            last edited by johnpoz

                            @JonathanLee I didn't add that - that is the built in alias reserved4

                            Per the list you posted, that is reserved for benchmarking.

                            • 198.18.0.0 / 15 — Benchmark Testing
                            Reserved under RFC 2544 for testing lab equipment performance and network device throughput.

                            I assume your 192 was a typo, since 198.18/15 is what is in the alias.

                            An intelligent man is sometimes forced to be drunk to spend time with his fools
                            If you get confused: Listen to the Music Play
                            Please don't Chat/PM me for help, unless mod related
                            SG-4860 26.07 | Lab VMs 2.9.0, 26.07

                            1 Reply Last reply
                            Reply Quote 1
                            • luckman212L
                              luckman212 LAYER 8 Rebel Alliance @JonathanLee
                              last edited by luckman212

                              @JonathanLee said

                              It basically works fine .... I mean just type go to alias right?

                              I tried the code below but it's crashing on my router. I think I have a core i7 with 32GB, pic of my setup is below @JonathanLee any idea what could be wrong??

                              10 INPUT "What alias do you want to update? "; ALIAS$
                              20 PRINT "Updating "; ALIAS$
                              30 LET ALIAS = RFC1918
                              40 IF ALIAS <> RFC1918 THEN GOTO 30
                              50 PRINT "Alias updated!"
                              60 END
                              

                              fe2b69e2-3210-45f4-b392-4e1f408238b2-image.png

                              1 Reply Last reply
                              Reply Quote 2
                              • A
                                ASGR71
                                last edited by

                                Just for reference...
                                https://www.rfc-editor.org/info/rfc6890/
                                https://www.openbsd.org/faq/pf/example1.html

                                1 Reply Last reply
                                Reply Quote 0

                                Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                With your input, this post could be even better 💗

                                Register Login
                                • First post
                                  Last post
                                Copyright 2026 Rubicon Communications LLC (Netgate). All rights reserved.
                                Privacy Policy · Cookie Policy