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

    Block traffic between networks

    Scheduled Pinned Locked Moved Firewalling
    31 Posts 5 Posters 3.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.
    • H
      hfarinha
      last edited by

      @netblues the reason I didn't assign ovpns1 interface in pfsense is because somehow OpenVPN worked fine since I setup years ago but it makes sense what you are saying and it seems that pfsense docs also suggest this for better flexibility. So I did that, I assigned ovpns1 and called it 'VPN'.

      Then I restarted OpenVPN service and now under Firewall rules I see the new interface 'VPN', however and strange enough, the previous "interface" where I was adding rules related to the vpn traffic is still there "OpenVPN" and traffic is flowing as normal even if VPN interface has no rules at all atm.(see attached picture)interfaces.jpg

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

        @hfarinha lets see your nic assignment page.

        You would assign an interface when you create a client connection on pfsense, but when you just setup pfsense server on pfsense, it auto creates that openvpn interface where you would setup rules for what remote clients can access.

        edit:
        Here I connected to my vpn with phone, could ping 192.168.3.10.. I then created a firewall rule on that interface, set it to log.. Can not ping now, and its logged blocked with the interface being the vpn instance that it connected too.

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

        H N 2 Replies Last reply Reply Quote 0
        • H
          hfarinha @johnpoz
          last edited by

          @johnpoz oh, this is not a site to site VPN, this a vpn client on my android phone. It's not connected all the time.

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

            @hfarinha exactly see my edit showing you how to block any remote client talking to anything on your network.

            If you advertise to your remove clients your local networks, or you set client to send everything down the vpn and you connect. By default the openvpn interface that is created is any any rule.

            If you don't want your remote clients talking to stuff, just create the rule like any other interface.

            Top down, first rule to trigger wins, no other rules evaluated - this is inbound just like any other interface rule. From your remote client ---> vpn server..

            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
            • N
              netblues @johnpoz
              last edited by

              openvpn will create the general openvpn firewall rule either on a server or a client, or many of them
              Then rules on the openvpn are applied globally
              It comes handy in some occasions
              Assigning a specific interface both in client and server scenarios allows for more granular control of firewall rules.
              And you can also add the interfaces into traffic monitor and see graphs.
              As a rule if you use assigned interfaces you should move rules to specific interface tab. Otherwise it becomes confusing/

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

                @hfarinha here, I connected via different vpn instance (different port).. And that same openvpn interface and its rules are used.

                Notice this block is from different tunnel network 10.0.8 vs 10.0.200 and the "interface" is opvn1 vs 2 in my previous pic

                blockother.jpg

                If you want to block only specific clients, just setup the clients to always get the same IP when they connect, etc. This is easy enough to do with the client specific overrides tab in the vpn setup area.

                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
                • H
                  hfarinha
                  last edited by hfarinha

                  my confusion at this point is not how to allow/deny traffic but how I assign an interface for openvpn as suggested.

                  here's my nic assignment:
                  nic_assig.jpg

                  I want to configure all VPN fw rules under the newly assigned 'VPN' nic however I can't get rid of "OpenVPN" under FW rules. I have no rules under VPN nic and vpn traffic still flow as normal so it seems that rules under OpenVPN are still in effect as I'm allowing traffic there.

                  N johnpozJ 2 Replies Last reply Reply Quote 0
                  • N
                    netblues @hfarinha
                    last edited by

                    @hfarinha vpns1 is the first openvpnserver, vpns2 the second etc
                    vpnc1 is the first vpnclient interface vpnc2 the second etc.

                    As simple as that

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

                      @hfarinha said in Block traffic between networks:

                      but how I assign an interface for openvpn as suggested.

                      There is little reason to assign an interface for remote clients connecting to pfsense as server. The global openvpn interface works for your remote access rules, be it you have 1 instance running or multiple instances running.

                      But you would assign those interfaces here.

                      assignment.jpg

                      But that really is only something you would do if pfsense is the client to some vpn server/service somewhere.

                      See above my ns1vpn interface and what its assigned 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
                      • H
                        hfarinha
                        last edited by

                        I only have one VPN client however I don't see any new interface being created when I establish the tunnel from remote client.

                        Here's what I did, I assigned interface ovpns1 and called it "VPN" (as explained before).
                        Then I recreated all the rules I had under "OpenVPN" in "VPN". Then I disabled all rules under "OpenVPN" and now everything works as it was before. This actual fixed a long time issue that I was having with 'DNS resolver' service. Before assigning the new interface I could not enable this service for VPN remote users, so I had to manually push (via openvpn tunnel config) upstream resolvers to the vpn client. Now with the new interface assigned and added to 'DNS resolver' I no longer need to do this. I now have "OpenVPN" with no rules and I don't think I can delete it.

                        N johnpozJ 2 Replies Last reply Reply Quote 0
                        • N
                          netblues @hfarinha
                          last edited by

                          @hfarinha You cant delete it. Just move the rules and it will be fine

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

                            @hfarinha said in Block traffic between networks:

                            new interface being created when I establish the tunnel from remote client.

                            Who said there would be?

                            This actual fixed a long time issue that I was having with 'DNS resolver' service

                            If you want remote vpn users to use unbound running on pfsense, you just need to create a ACL that allows the tunnel network.. Unbound automatically creates ACLs to allow networks its attached to ask unbound for dns. Tunnel networks are not included in these auto acls, so if you want remove vpn uses to ask unbound, you just need to create a ACL in the unbound settings to allow.

                            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

                            H 1 Reply Last reply Reply Quote 0
                            • H
                              hfarinha @johnpoz
                              last edited by hfarinha

                              @johnpoz said in Block traffic between networks:

                              auto acls
                              I'm not sure about those "auto acls" from unbound as I don't see them in any place, however I added rules to allow DNS traffic to each of the firewall GW IPs and everything is working as expected.

                              Thank you all!

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

                                @hfarinha said in Block traffic between networks:

                                DNS traffic to each of the firewall GW IPs and everything is working as

                                well you would need to be able to talk to the dns port yes.

                                The auto created acls are on the unbound advanced page

                                acl.jpg

                                I have mine disabled, and create my own acls

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

                                H 1 Reply Last reply Reply Quote 0
                                • H
                                  hfarinha @johnpoz
                                  last edited by

                                  @johnpoz The auto option was not enabled under DNS Resolver service however "Services -> DNS Resolver -> Access Lists" was empty. I enabled "Disable Auto-added Access Control" just in case as I want to control this manually. thanks.

                                  H 1 Reply Last reply Reply Quote 0
                                  • H
                                    hfarinha @hfarinha
                                    last edited by

                                    @hfarinha forgot to mention that I had to add acl's manually as well under DNS resolver otherwise dns resolution does not work.

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