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

    Prevent some LAN devices from being accessable over L2TP/IPsec

    Firewalling
    3
    43
    9.3k
    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.
    • B
      BigApple
      last edited by

      I used out only but when I used ports 53, 80, 443 to allow browsing only on the floating rule it does not work (see sample)

      the floating rule only allows internet when any is selected …(see below)

      1 Reply Last reply Reply Quote 0
      • D
        doktornotor Banned
        last edited by

        And why are those other rules floating? Leave the wiki one as floating direction out and put the rest where it belongs to restrict traffic. I really don't understand how we all of a sudden got to the "to allow browsing only ". You stated the goal is to "prevent some LAN devices from being accessable over L2TP/IPsec". This is the exact opposite direction.

        1 Reply Last reply Reply Quote 0
        • B
          BigApple
          last edited by

          my goal is to allow people to browse through the vpn ..but not access the lan network… but to allow browsing I need to turn on the floating rule (TCP any out)

          when that is done... I can no longer prevent them from accessing the lan also.... the rules in the l2tp vpn tab no longer works

          1 Reply Last reply Reply Quote 0
          • D
            doktornotor Banned
            last edited by

            @BigApple:

            the rules in the l2tp vpn tab no longer works

            Yeah, those will never work… since, this tab is completely WRONG side of the tunnel. You need to move to the other firewall on the other end to block access to LAN. Or really dunno what "LAN network" are you talking about. Perhaps draw some diagram what are you trying to block where.

            1 Reply Last reply Reply Quote 0
            • B
              BigApple
              last edited by

              i have no other firewall in place only the pfsense unit. I only have VPN connections coming in… and there is no firewall that I know off...

              1 Reply Last reply Reply Quote 0
              • D
                doktornotor Banned
                last edited by

                @BigApple:

                i have no other firewall in place only the pfsense unit. I only have VPN connections coming in… and there is no firewall that I know off...

                Sorry, but floating rule with direction OUT will never apply to inbound traffic to the selected interface. You are doing this upside down. You cannot take the wiki rule as is and start restricting ports/IPs accessible on your LAN.

                1 Reply Last reply Reply Quote 0
                • DerelictD
                  Derelict LAYER 8 Netgate
                  last edited by

                  Read the language in the documentation again:

                  Firewall traffic blocked outbound

                  If the firewall logs show traffic blocked "out" on L2TP, then add a floating firewall rule to work around the block:

                  Navigate to Firewall > Rules, Floating tab
                      Click "+" to add a new rule
                      Set 'Action to Pass
                      Check Quick
                      Select L2TP VPN for the Interface
                      Set Direction to Out
                      Set Protocol to TCP
                      Set Source/Destination as needed, or set to any
                      Advanced Features:
                          Set TCP Flags to Any flags
                          Set State Type to Sloppy State

                  You should then control what your L2TP VPN clients can connect to with rules on your L2TP VPN tab.  if you only want them to get at TCP/UDP 53, TCP/80, and TCP/443 put those pass rules there.  Everything else will be blocked as it enters the firewall from the clients.  Except that it doesn't work.

                  I just tested it.  The floating rule is exactly as described above.  Direction OUT on L2TP VPN verified.  It appears the rules on the L2TP VPN tab are ignored.  Yes, I cleared states.

                  I can still SSH to 172.26.0.100 and the source address is the VPN client address 172.29.7.128.

                  ![Screen Shot 2015-05-23 at 10.32.20 AM.png](/public/imported_attachments/1/Screen Shot 2015-05-23 at 10.32.20 AM.png)
                  ![Screen Shot 2015-05-23 at 10.32.20 AM.png_thumb](/public/imported_attachments/1/Screen Shot 2015-05-23 at 10.32.20 AM.png_thumb)
                  ![Screen Shot 2015-05-23 at 10.31.10 AM.png](/public/imported_attachments/1/Screen Shot 2015-05-23 at 10.31.10 AM.png)
                  ![Screen Shot 2015-05-23 at 10.31.10 AM.png_thumb](/public/imported_attachments/1/Screen Shot 2015-05-23 at 10.31.10 AM.png_thumb)
                  pfSense+L2TP.png
                  pfSense+L2TP.png_thumb

                  Chattanooga, Tennessee, USA
                  A comprehensive network diagram is worth 10,000 words and 15 conference calls.
                  DO NOT set a source address/port in a port forward or firewall rule unless you KNOW you need it!
                  Do Not Chat For Help! NO_WAN_EGRESS(TM)

                  1 Reply Last reply Reply Quote 0
                  • D
                    doktornotor Banned
                    last edited by

                    Yeah, of course they will get ignored when you tick the "Quick" checkbox on the floating rule.

                    1 Reply Last reply Reply Quote 0
                    • DerelictD
                      Derelict LAYER 8 Netgate
                      last edited by

                      Direction OUT.  The SSH connection is coming IN.

                      So you're saying the wiki is wrong?

                      https://doc.pfsense.org/index.php/L2TP/IPsec

                      And the floating rule is for TCP only.  I can still ping 172.26.0.100 despite the reject rule.

                      Chattanooga, Tennessee, USA
                      A comprehensive network diagram is worth 10,000 words and 15 conference calls.
                      DO NOT set a source address/port in a port forward or firewall rule unless you KNOW you need it!
                      Do Not Chat For Help! NO_WAN_EGRESS(TM)

                      1 Reply Last reply Reply Quote 0
                      • D
                        doktornotor Banned
                        last edited by

                        Sigh…

                        1/ Check what sloppy state does.
                        2/ Check the Set Source/Destination as needed - why on earth are you setting that as ANY when it obviously is NOT suitable for the intended purpose???

                        1 Reply Last reply Reply Quote 0
                        • DerelictD
                          Derelict LAYER 8 Netgate
                          last edited by

                          Because without it set to ANY reply traffic to sides is blocked outbound.  This is with the rule disabled:

                          ![Screen Shot 2015-05-23 at 10.57.25 AM.png](/public/imported_attachments/1/Screen Shot 2015-05-23 at 10.57.25 AM.png)
                          ![Screen Shot 2015-05-23 at 10.57.25 AM.png_thumb](/public/imported_attachments/1/Screen Shot 2015-05-23 at 10.57.25 AM.png_thumb)

                          Chattanooga, Tennessee, USA
                          A comprehensive network diagram is worth 10,000 words and 15 conference calls.
                          DO NOT set a source address/port in a port forward or firewall rule unless you KNOW you need it!
                          Do Not Chat For Help! NO_WAN_EGRESS(TM)

                          1 Reply Last reply Reply Quote 0
                          • DerelictD
                            Derelict LAYER 8 Netgate
                            last edited by

                            The bottom line is rules on the L2TP VPN tab do not work like they work on every other VPN interface in pfSense.  They do not filter traffic coming INTO the firewall from VPN clients at the other end of the tunnel.

                            For instance, with the floating rule disabled I can still ping 172.26.0.100 despite the explicit block rule on L2TP VPN.

                            Chattanooga, Tennessee, USA
                            A comprehensive network diagram is worth 10,000 words and 15 conference calls.
                            DO NOT set a source address/port in a port forward or firewall rule unless you KNOW you need it!
                            Do Not Chat For Help! NO_WAN_EGRESS(TM)

                            1 Reply Last reply Reply Quote 0
                            • D
                              doktornotor Banned
                              last edited by

                              I am not telling you to disable the rule. I am telling you to "Set Source/Destination as needed". When access to LAN in unwanted, obviously ANY is not proper?!?!?!?!?!?!?!?!?

                              1 Reply Last reply Reply Quote 0
                              • DerelictD
                                Derelict LAYER 8 Netgate
                                last edited by

                                Explain how, with this explicit block rule, L2TP clients can ping 172.26.0.100.  The floating rule only applies to TCP traffic anyway so enabled or disabled makes no difference.  Let's forget about TCP and concentrate on ICMP.

                                ![Screen Shot 2015-05-23 at 11.09.45 AM.png](/public/imported_attachments/1/Screen Shot 2015-05-23 at 11.09.45 AM.png)
                                ![Screen Shot 2015-05-23 at 11.09.45 AM.png_thumb](/public/imported_attachments/1/Screen Shot 2015-05-23 at 11.09.45 AM.png_thumb)

                                Chattanooga, Tennessee, USA
                                A comprehensive network diagram is worth 10,000 words and 15 conference calls.
                                DO NOT set a source address/port in a port forward or firewall rule unless you KNOW you need it!
                                Do Not Chat For Help! NO_WAN_EGRESS(TM)

                                1 Reply Last reply Reply Quote 0
                                • DerelictD
                                  Derelict LAYER 8 Netgate
                                  last edited by

                                  All rules on LT2P VPN tab disabled
                                  Floating sloppy rule disabled
                                  Only rule on IPsec tab passes UDP 1701 to WAN address
                                  States cleared

                                  Can still ping 172.26.0.100 from L2TP clients.

                                  Chattanooga, Tennessee, USA
                                  A comprehensive network diagram is worth 10,000 words and 15 conference calls.
                                  DO NOT set a source address/port in a port forward or firewall rule unless you KNOW you need it!
                                  Do Not Chat For Help! NO_WAN_EGRESS(TM)

                                  1 Reply Last reply Reply Quote 0
                                  • D
                                    doktornotor Banned
                                    last edited by

                                    Check stuff like pfctl -sr, pfctl -ss and go from there. I have zero desire to dig into the code generating god knows what rules behind the scene, let alone to set up this nonsense here. IPsec alone is flaky like hell here with the strongswan POS, no need to add another level of crap into the mix. There's also this "Disable Auto-added VPN rules" checkbox in System - Advanced - Firewall.

                                    Perhaps start your own thread, debugging your ICMP is really not what's this thread about.

                                    1 Reply Last reply Reply Quote 0
                                    • DerelictD
                                      Derelict LAYER 8 Netgate
                                      last edited by

                                      Nice hang time on that punt. Maybe before belittling and insulting people next time you take a step back.

                                      Chattanooga, Tennessee, USA
                                      A comprehensive network diagram is worth 10,000 words and 15 conference calls.
                                      DO NOT set a source address/port in a port forward or firewall rule unless you KNOW you need it!
                                      Do Not Chat For Help! NO_WAN_EGRESS(TM)

                                      1 Reply Last reply Reply Quote 0
                                      • B
                                        BigApple
                                        last edited by

                                        well thank you for trying to help … maybe best I pay the guys to get help ...

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