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

    could use some help with firewall/nat rules?

    Scheduled Pinned Locked Moved Firewalling
    14 Posts 2 Posters 857 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.
    • johnpozJ
      johnpoz LAYER 8 Global Moderator @comet424
      last edited by johnpoz

      @comet424 said in could use some help with firewall/nat rules?:

      i guess what i confused about is why does the gateway matter?

      Because how exactly does your vpn get to one of your other segments, if you shove traffic down the vpn?

      So yes it matters.. Why would want/need traffic to go out your vpn or wan connection to get to another segment directly connected to pfsense.,

      That is fine if you want traffic not going to some other segment on your network to go out a vpn, but you need a rule above that that says you can go to the other network without shoving it out a gateway.

      When you set a gateway on a rule, you take out of the mix any routes that pfsense knows about, and traffic that matches that rule goes out the gateway set.. It gets shoved out that gateway, without looking at pfsense routing table that says oh 192.168.10.x is locally connected to my optX interface.

      Pfsense oh you match this rule go get sent to this gateway...

      So you need a rule before you policy route it out that gateway, that says oh you can go to 192.168.10.x - that is locally connected to my optX interface let me send the traffic out that interface, via my routing table.

      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

      C 1 Reply Last reply Reply Quote 0
      • C
        comet424 @johnpoz
        last edited by

        @johnpoz
        trying to post a reply but its telling me its spam trying to edit my post to figure what word it is

        johnpozJ C 2 Replies Last reply Reply Quote 0
        • johnpozJ
          johnpoz LAYER 8 Global Moderator @comet424
          last edited by

          @comet424 this rule doesn't even make any sense

          makesnosense.jpg

          if your client on your iot net is trying to talk to an IP on pfsense "this firewall" why would you shove it down your vpn group gateway?

          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
          • C
            comet424 @comet424
            last edited by comet424

            @johnpoz not 100% sure how to make that rule

            is that like this? ive tried this and this doesnt work but im sure its wrong
            do you have an example i can go by
            pa1.JPG

            @johnpoz
            was part of the video i watched.. if you want DNS on your vlan thats what you enter in.
            and cuz i dont know from what i saw

            • = WAN
              so i dont want IOT to use WAN at all .. since * is default WAN so my understanding is i dont want IOT to ever see WAN so thats why i tell it do not use WAN
              thats my understanding
            C 1 Reply Last reply Reply Quote 0
            • C
              comet424 @comet424
              last edited by

              @comet424

              all i know is i know if i do * then nordvpn website says i not secure tells me my ip is leaking so but the network works and when i try to change the default gateway to vpn_group
              so its forced

              i did do a Reject that lan.net cant use wan address and wan net but i found it didnt help unless i didnt wait long enough

              but if there is pictures to learn better or a dummies book explantion style be great.. i appreciate the help so far

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

                @comet424 if your want your clients to use your vpn for dns that is fine - but the destination wouldn't be this firewall.. Point the clients directly to some outside dns, or your vpn dns..

                If you want lan net to get to say your camera net, put a rule above where you shove it out your vpn that allows that.

                Rules are evaluated top down, first rule to trigger wins, no other rules are looked at..

                Its pretty straight forward in the link I provided..

                bypass.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

                C 1 Reply Last reply Reply Quote 0
                • C
                  comet424 @johnpoz
                  last edited by comet424

                  @johnpoz ya i had to re read it several times.. i think i got it working... but whats weird i not sure
                  if you test dnsleaktest website.. the LAN picks up 4 dns's but the IOT picks up just 1 dns
                  figured the LAN would only be picking up the one dns too... dunno

                  ok so if first rule wins doesnt that mean it goes out the default gateway of wan.. or is that the acception to the rule?

                  and ok i added block rules.. in the pics below... is it irrelivant to do that.. or it wont block because the other is above it..

                  now i re tried things i think its way it should be.. i dont want the iot to access anything other then internet.. and same for cameras... now do i need to add the like
                  IOT * private_network * * none do i need to add it for them or is the current way ok

                  here the pics.. and is the NAT looking ok too?

                  oh and should block rules then should be before Allow rules then right .. not after then cuz the allow rule over writes the block rule then
                  pa5.JPG pa4.JPG pa3.JPG pa2.JPG pa6.JPG

                  update i unchecked that invert you see on the LAN

                  C 1 Reply Last reply Reply Quote 0
                  • C
                    comet424 @comet424
                    last edited by

                    i think this is correct for IOT let me know
                    first line saying to enable the bypass rule
                    2nd line block firewall access
                    next is to allow home assistant ips back and forth
                    and last is allow internet but deny the rest of the network is that correct way ?
                    correct order?
                    a11.JPG

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

                      @comet424 What part are you not understanding about routing traffic out your vpn gateway?

                      Where are those home_assistant_ips if they are on the iot network that 2nd allow rule is pointless. And if they are and yo want them to get to other stuff on your local networks how is routing them out your vpn going to get there?

                      And then all of those rules below the 1st one are completely pointless anyway.. Because that is the 1st rule and its an any any - so none of those other rules mean anything..

                      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

                      C 1 Reply Last reply Reply Quote 0
                      • C
                        comet424 @johnpoz
                        last edited by

                        @johnpoz
                        ah ok as for my home assistant ips
                        they are
                        192.168.0.12
                        192.168.10.12
                        192.168.20.12
                        those are the vlants to the main home assistant
                        then
                        192.168.0.10 is another

                        and then on my sisters network i do the openvpn site to site
                        its
                        192.168.1.12

                        and what i didnt understand is if the first rule says use default gate way which is wan then the 2nd rule saying use the the vpn the wan superceeds using vpn thats what i ment..

                        im having troubles i going to play around and ok good i can delete the grayed out ones.. wasnt sure.. i going to try some things later..

                        i learning by trying... (: i appreciate the help so far.. least i can access the networks from LAN...
                        i just never figured why i get more dns results on LAN then the IOT but going to play a bit and see how i do (: im sure ill have questions tomorow.. so i really appreciated the help so far

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