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

    Prevent Certain LAN ips from accessing WAN when OpenVPN goes down

    OpenVPN
    11
    52
    25.8k
    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.
    • M
      m3ki
      last edited by

      That's the thing the moment traffic is redirected to VPN Gateway every other rule seems to be skipped.

      I am trying to wrap my head around this:
      Policy Route Negation
      When a firewall rule directs traffic into the gateway, it bypasses the firewall's normal routing table. Policy route negation is just a rule that passes traffic to other local or VPN-connected networks that does not have a gateway set. By not setting a gateway on that rule it will bypass the gateway group and use the firewall's routing table. These rules should be at the top of the ruleset – or at least above any rules using gateways.

      Am I supposed to create another rule somewhere ?

      1 Reply Last reply Reply Quote 0
      • K
        kejianshi
        last edited by

        I'd just make the computer the client directly and that solves so many issues.
        If its a windows machine or a MAC, this is really easy.  If its some server, maybe not as easy.

        1 Reply Last reply Reply Quote 0
        • M
          m3ki
          last edited by

          Haha yeah… that would be simpler.

          What I want is:

          Have 3x machines -> ISP
          TV -> flow to US VPN
          NAS -> Some other VPN

          If OpenVPN links go down BLOCK TV and NAS from accessing outside world.
          I did this with DDWRT before but I have no idea how to do this with PFsense. I must be missing something simple.

          1 Reply Last reply Reply Quote 0
          • K
            kejianshi
            last edited by

            OK - I want to be sure about this, so I'll list a list of conditions.  Tell me which are true or false for you.

            Your distant VPN server uses a fixed IP?

            If your VPN drops you want everything connected to pfsense to not be able to access internet?

            1 Reply Last reply Reply Quote 0
            • M
              m3ki
              last edited by

              @kejianshi:

              OK - I want to be sure about this, so I'll list a list of conditions.  Tell me which are true or false for you.

              Your distant VPN server uses a fixed IP?
              NO It's dynamic. Using OpenVPN Client in pfsense

              If your VPN drops you want everything connected to pfsense to not be able to access internet?
              No only machines forwarded to VPN Gateway

              1 Reply Last reply Reply Quote 0
              • K
                kejianshi
                last edited by

                In that case, not sure…  I'll be reading along and thinking about it a while.

                1 Reply Last reply Reply Quote 0
                • K
                  kejianshi
                  last edited by

                  You posted a screen shot above.  I cant see the whole page.  Can you repost the screen shot to include the interface tabs etc?

                  1 Reply Last reply Reply Quote 0
                  • M
                    m3ki
                    last edited by

                    Here you go

                    ![Screen Shot 2013-08-09 at 7.12.12 PM.png](/public/imported_attachments/1/Screen Shot 2013-08-09 at 7.12.12 PM.png)
                    ![Screen Shot 2013-08-09 at 7.12.12 PM.png_thumb](/public/imported_attachments/1/Screen Shot 2013-08-09 at 7.12.12 PM.png_thumb)

                    1 Reply Last reply Reply Quote 0
                    • M
                      m3ki
                      last edited by

                      This can easily be done using iptables I just don't know how to do it here.

                      Idea is mark packets to go to either one routing table or another. then if packet still arrives to unwanted interface drop it. I have my iptables rules in earlier  posts.

                      1 Reply Last reply Reply Quote 0
                      • K
                        kejianshi
                        last edited by

                        The rules, as they are now, pass everything.  For sure.  First you pass 192.168.1.5, and then you pass everything that isn't 192.168.1.5.
                        So, that everything.

                        For the first one, shouldn’t you specify a destination gateway?

                        1 Reply Last reply Reply Quote 0
                        • M
                          m3ki
                          last edited by

                          Yeah sorry I was doing some other tests to see here are the rules as they are now. OpenVPN gateway is down and I can still ping outside from 192.168.1.5

                          ![Screen Shot 2013-08-09 at 7.20.11 PM.png](/public/imported_attachments/1/Screen Shot 2013-08-09 at 7.20.11 PM.png)
                          ![Screen Shot 2013-08-09 at 7.20.11 PM.png_thumb](/public/imported_attachments/1/Screen Shot 2013-08-09 at 7.20.11 PM.png_thumb)

                          1 Reply Last reply Reply Quote 0
                          • K
                            kejianshi
                            last edited by

                            So, if you put in a rule immediately after the pass 192.168.1.5 to olive rule and you made it a block 192.168.1.5 to anywhere rule, I wonder what that would do?

                            Second what is the subnet the VPN is using?  I have 1 last question after this…

                            1 Reply Last reply Reply Quote 0
                            • M
                              m3ki
                              last edited by

                              Like so ?
                              Still lets traffic go though ISP.

                              ![Screen Shot 2013-08-09 at 7.40.15 PM.png](/public/imported_attachments/1/Screen Shot 2013-08-09 at 7.40.15 PM.png)
                              ![Screen Shot 2013-08-09 at 7.40.15 PM.png_thumb](/public/imported_attachments/1/Screen Shot 2013-08-09 at 7.40.15 PM.png_thumb)

                              1 Reply Last reply Reply Quote 0
                              • K
                                kejianshi
                                last edited by

                                If none of this works, I'm thinking this.

                                Traffic should go from 192.168.1.5 > some VPN subnet > WAN > VPN

                                (my understanding could be bad)

                                But, if you put a rule on the WAN to block any traffic that is source 192.168.1.5 and destination * that should block 192.168.1.5 when its not using VPN for sure.  Not sure if it will also block it when inside VPN also.  Never tried it.  Its easy to do, try and undo if needed.  Maybe try it.

                                If blocking 192.168.1.5 at the wan doesn't work or if it completely breaks 192.168.1.5 then I'm fresh out of unique and amazing ideas.

                                1 Reply Last reply Reply Quote 0
                                • M
                                  m3ki
                                  last edited by

                                  Like so?
                                  You would think this would work ;) So did I, I think this was the first think i tried.

                                  anyway tried it again same thing.

                                  ![Screen Shot 2013-08-09 at 7.49.51 PM.png](/public/imported_attachments/1/Screen Shot 2013-08-09 at 7.49.51 PM.png)
                                  ![Screen Shot 2013-08-09 at 7.49.51 PM.png_thumb](/public/imported_attachments/1/Screen Shot 2013-08-09 at 7.49.51 PM.png_thumb)

                                  1 Reply Last reply Reply Quote 0
                                  • K
                                    kejianshi
                                    last edited by

                                    Just an idle question?  Do you have a floating rule that says pass anything to anything because this is getting strange?
                                    And are you sure the computer in question's IP is actually 192.168.1.5?

                                    1 Reply Last reply Reply Quote 0
                                    • M
                                      m3ki
                                      last edited by

                                      hehe..
                                      no but I have block source 192.168.1.5 to anywhere. Doesnt work either.

                                      1 Reply Last reply Reply Quote 0
                                      • K
                                        kejianshi
                                        last edited by

                                        So, its going to the VPN as a gateway and then that gateway is sending to the openweb when the vpn fails.

                                        Maybe make a rule on the WAN that blocks anything from source interface BOLEVPN that isn't on that one port that openvpn needs.

                                        This isn't multi-public-IP system right?  Just 1 WAN?

                                        1 Reply Last reply Reply Quote 0
                                        • M
                                          m3ki
                                          last edited by

                                          I really hoped that would work but no :(
                                          It seems the rules are being bypassed and traffic just jumps to VPN gateway.

                                          1 Reply Last reply Reply Quote 0
                                          • K
                                            kejianshi
                                            last edited by

                                            Did you apply some rules to the firewall outside the gui using command line?

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