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 got all working and I am able to access the Internet and LAN devices through my L2TP/IPsec VPN connection.  Now how do I prevent one of the VPN Client connection to access lets say 192.168.1.3 but still be able to browse the internet through its VPN ?

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

        Block the traffic on Firewall > Rules, IPsec L2TP VPN tab

        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

          thank you … I did that und used destination "Single host or alias"  but I have still full access to the ip from the L2TP vpn side

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

            Show exactly what you did.  And rules only apply to new states so you have to clear old states or existing connections aren't blocked.

            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

              here is what I have ….

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

                You are passing no traffic.  L2TP clients shouldn't be able to access anything over the tunnel.  Where are you testing from?

                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

                  I am testing it from an L2TP/IPsec connected Client (Outside my network)

                  all I am trying to achieve is to get the VPN client to access the Internet through its VPN without having to have access to the LAN side..

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

                    Nothing should be passing. Something must not be how you think it is.

                    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 I can access lan devices from my outside VPN connection (e.g WEB GUI and such) but I can also browse (which is what I wanted…) the only thing is LAN devices are not blocked from accessing..

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

                        You shouldn't be able to access anything.

                        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

                          I had a floating rule in place maybe that OVERULED IT …
                          so now I can not browse or access the lan ... how do I get browsing back through the vpn ?

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

                            Floating rule, huh.

                            For connections originating from L2TP clients:

                            Block specifically what you want to block (Specific LAN host(s))
                            Pass what you want to pass (any any)

                            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

                              unless I have this in place nothing works … and with that in place your rules in the L2TP vpn tab wont work..


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

                                There's no way you need that floating rule - especially since it's direction out.  Get rid of it and put a Pass IPv4 any source any dest any rule on L2TP VPN.

                                You need to make sure:

                                The L2TP VPN tab contans rules that dictate what you want your L2TP clients to have access to.  Since you want them to access the internet over the tunnel, that means block what you don't want them to access and pass everything else.

                                There is proper outbound NAT on WAN for the L2TP tunnel network.

                                https://doc.pfsense.org/index.php/Firewall_Rule_Troubleshooting

                                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

                                  Thank you for your help in this matter …
                                  I have done that and turned of the Floating rule... and I made sure the NAT has the rules in place...  I also did the PASS any rule on the L2TP tab. for now I am not blocking anything in that TAB until I get the Internet to work again...  Once the floating rule was turned of so did the Internet turn off for the Remote Client. (I do reset the states after each change) 
                                  on NAT I have Hybrid selected to manually and Automatically create rules.  No luck

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

                                    I put this on my test system last night and I am not convinced there's not something funky going on.  Did you set it up like this?

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

                                    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

                                      yes that is what I used … and that is where I was told if traffic is blocked to use the floating rule.

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

                                        That's exactly what I am seeing and was going to post about it.  Guess it's a known issue.  This L2TP/IPsec is brand new in 2.2 I think.  I don't think it was feasible with raccoon.

                                        I'll add the floating rule tonight and see.  But, in a nutshell, your IPsec rules need to pass L2TP (UDP 1701), your L2TP VPN needs to pass traffic that you want clients to access (or in your case, block what you don't want them to access and pass everything else.  And, I guess, there needs to be a floating rule passing return traffic back out to 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
                                        • B
                                          BigApple
                                          last edited by

                                          thank you very much …  i thought I am going to loose my last few hair that I have left. good to know its not just me seeing having a problem there

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

                                            @BigApple:

                                            thank you very much …  i thought I am going to loose my last few hair that I have left. good to know its not just me seeing having a problem there

                                            any news yet ?  I can not block lan access unless I turn of the floating rule.  and if I do so I lose also internet access.

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