Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Block RFC1918-egress floating rules

    Scheduled Pinned Locked Moved Firewalling
    8 Posts 3 Posters 1.5k Views
    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.
    • CatSpecial202C
      CatSpecial202
      last edited by CatSpecial202

      I was messing around with the rules in my firewall and attempted to implement some of the guides in Netgates documentation. It looks like the rule is being allowed but then its also being immediately blocked again and the page eventually times out. Why is that?

      Specifically this guide:
      Preventing RFC 1918 Traffic from Exiting a WAN Interface¶

      It seemed pretty simple and I implemented everything as it shows in the guide but it seems like it's still having issues working correctly for me.

      Allow direction OUT and IN. I added this additional rule.

      71ed285f-7af6-41b9-b8c2-09ebeebdc95f-image.png

      Block RFC1918_local

      a7ba900e-2a94-4c68-859b-c9cc6c890ff6-image.png

      System logs still blocking

      johnpozJ 1 Reply Last reply Reply Quote 0
      • CatSpecial202C
        CatSpecial202
        last edited by

        8a216871-38c8-44d9-90e0-54c71f320c5f-image.png

        the system logs allow but block again

        1 Reply Last reply Reply Quote 0
        • U
          Uglybrian
          last edited by

          you need to check the quick box.
          Screenshot from 2025-01-27 11-13-21.png

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

            @CatSpecial202 you don't need this rule

            rule.jpg

            The state created when you go out would allow the return traffic.

            If you want to allow talking to your modem IP of 192.168.100.1, I would really create a vip - its cleaner solution.

            vip.jpg

            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 24.11 | Lab VMs 2.8, 24.11

            CatSpecial202C 1 Reply Last reply Reply Quote 0
            • CatSpecial202C
              CatSpecial202 @johnpoz
              last edited by CatSpecial202

              @johnpoz I originally attempted a different NAT outbound that was going to a destination that was the entire subnet of the modem. However, not using a virtual IP and it didn't work. I didn't think that inbound rule would do anything but i figured, whatever might as well try it.

              I deleted that inbound rule and added all this other stuff, but it still doesn't seem to be working. The modem is at 192.168.100.1. Should I add this address in the NAT Address? I restarted my router and everything.

              ff780e00-d456-475b-b7fa-9fa92eec2f6e-image.png

              fd1c736e-1028-47f0-8120-0d2f74ba6038-image.png

              1c8a0ca5-6e5c-4660-90b8-305372971dbf-image.png

              e2c2a780-d428-45bb-80be-e2208d55886c-image.png

              da573916-281c-4e56-91eb-639337048fae-image.png

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

                @CatSpecial202 you don't really want a reject on your wan rule to be honest.. That sends a response. And you almost never want a response to go out your wan.

                I think we ran into this some time ago, where you have to set the not reply option on your allow rule to the 192.168.100.1 address in floating

                allowrule.jpg

                Back a few versions ago - you didn't need this, but something awhile back if you don't have this checked it doesn't work.. I will see if I can dig up that older thread.

                edit: here is a thread where it came up before, and at that time did a bit of digging.. But then I got side tracked, but you notice this post where I did some sniffing and different macs.. If you set checkbox to disable reply-to on your allow rule to 100.1 it should now work.

                https://forum.netgate.com/post/1117003

                edit2:
                I just checked this again, yeah if don't have that checked it doesn't work if you have a block rfc1918 rule under it, which is really the whole point wanting to block noise from leaving the wan.. I really should find some time to figure out why exactly this fails if you don't have that checked.. most likely have to look at the actual rules that get created with that unchecked vs when checked - most likely that would make it all clear ;)

                But to solve your issue - I would check that box and you should be working.

                Notice the little gear in my rule

                gear.jpg

                That shows an advanced option set, the disable the auto reply-to rule. With that set I can access my modem web gui.

                webgui.jpg

                If not checked - doesn't work, if you leave it unchecked (default) and you disable the outbound block rfc1918 rule it works.. So yeah its weird..

                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 24.11 | Lab VMs 2.8, 24.11

                CatSpecial202C 1 Reply Last reply Reply Quote 0
                • CatSpecial202C
                  CatSpecial202 @johnpoz
                  last edited by

                  @johnpoz yes, that was it. Now it works. Thank you. Why did you bring up the, "you don't really want a reject on your wan rule to be honest."? Can you not add a rule that has a reply-to on the WAN by default?

                  As far as I understand if you have a rule on an interface that blocks inbound RFC1918 what exactly does blocking outbound do? Blocking inbound is enough to not establish state so shouldn't that be enough?

                  btw. I've noticed my logs clearing up significantly.

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

                    @CatSpecial202 A reject is fine on a lan side rule - it sends an answer back.. But your blocking outbound.. I don't even know if it would work to be honest you would have to sniff to see..

                    but say you have a rule to block say ping to your wan IP from bad guys.. You would send them a reject every time they scanned a port that was blocked.

                    So here is a rule on my lan that rejects going to 8.8.8.8 - see how I get a RST back, when it really should of just timed out..

                    reset.jpg

                    Might be ok since your traffic is going outbound. But it is normally not a good idea to use a reject on a wan interface unless your sure you want to actually send back something to the sender.

                    Ok I tested changing my block outbound rfc1918 to reject - and yup I do get back a rst.. So guess its fine inbound traffic from the internet would not trigger that rule anyway.

                    rejectwan.jpg

                    Just be aware you normally don't want reject on a internet facing interface - unless your sure you want to send an answer back.. Which could lead to sort of dos attack with your firewall busy answering stuff it should just drop and pay no attention too.

                    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 24.11 | Lab VMs 2.8, 24.11

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post
                    Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.