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

    IPSec/L2TP with pfSense 2.2

    Scheduled Pinned Locked Moved IPsec
    118 Posts 48 Posters 111.6k 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.
    • jimpJ
      jimp Rebel Alliance Developer Netgate
      last edited by

      @robertwh:

      I have matched the configuration letter for letter and now matter what i do i cannot connect from windows 8.1 / 7

      the one confusing part in L2TP

      Current LAN: 192.168.1.1/24

      Server Address 192.168.1.2
      first starting 192.168.1.128 /25

      Is this correct?

      While that technically should work, I have not tested overlapping the LAN. It's best to use a different subnet.

      Remember: Upvote with the šŸ‘ button for any user/post you find to be helpful, informative, or deserving of recognition!

      Need help fast? Netgate Global Support!

      Do not Chat/PM for help!

      1 Reply Last reply Reply Quote 0
      • A
        AndrewZ
        last edited by

        Got it partially working…
        1. this Floating rule for TCP is important, but I haven't seen the records in the log until #2 below
        2. the most annoying: I had to set "Send All Traffic" enabled on iPad in order to access my local resources. Without this I had no traffic coming to PF over the tunnel.

        Any idea how to avoid this #2 and send over the VPN only the traffic for my LAN?

        1 Reply Last reply Reply Quote 0
        • O
          opti2k4
          last edited by

          Robert,

          did you make any progress? I am having same issue, not seeing anything inside the log related to L2TP. Tried android and win 8.1, both not working. Simply i am not getting l2tp response from the server even though it's on WAN interface.

          1 Reply Last reply Reply Quote 0
          • P
            Phoenix
            last edited by

            If any forum admin reads this: Please open a category for L2TP, like there is one for IPSec, PPTP and OpenVPN.

            I do have the same trouble. I am very confident, that is is no IPSec issue. I do belive it is a issue with the network stack somehow, see my insights below:

            I locate the mpd4 PID
            [2.2-RELEASE][root@vicinity.dominion.ch]/var/etc: ps ax | grep mpd
            7069Ā  -Ā  SsĀ  Ā  0:02.69 /usr/local/sbin/mpd5 -b -k -d /var/etc -f mpd_wan.conf -p /var/run/pppoe_wan.pid -s ppp pppoeclient
            37089Ā  -Ā  SsĀ  Ā  0:00.02 /usr/local/sbin/mpd4 -b -k -d /var/etc/l2tp-vpn -p /var/run/l2tp-vpn.pid -s l2tps l2tps
            54867Ā  0Ā  S+Ā  Ā  0:00.01 grep mpd

            and KILL it
            [2.2-RELEASE][root@vicinity.dominion.ch]/var/etc: kill 37089

            I start a background tcpdump on the pflog interface, the ip is my public ip I originate from (NATed of course)
            [2.2-RELEASE][root@vicinity.dominion.ch]/var/etc: tcpdump -n -e -ttt -i pflog0 host 194.230.155.137 &
            [1] 29082
            [2.2-RELEASE][root@vicinity.dominion.ch]/var/etc: tcpdump: WARNING: pflog0: no IPv4 address assigned
            tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
            listening on pflog0, link-type PFLOG (OpenBSD pflog file), capture size 65535 bytes
            capability mode sandbox enabled

            I start a fake daemon with netcat
            [2.2-RELEASE][root@vicinity.dominion.ch]/var/etc: nc -l -u 1701
            00:00:00.000000 rule 104..16777216/0(match): pass in on pppoe1: 194.230.155.137.43933 > 212.25.10.250.500: isakmp: phase 1 I ident
            00:00:03.975271 rule 89..16777216/0(match): pass in on enc0: 194.230.155.137.55697 > 212.25.10.250.1701:Ā  l2tp:TLSNs=0,Nr=0 *MSGTYPE(SCCRQ) *PROTO_VER(1.0) *HOST_NAME(anonymous) *FRAMING_CAP(AS) *ASSND_TUN_ID(63285) *RECV_WIN_SIZE(1)
            ^C

            I do see traffic PASS on enc0, but I see no traffic hitting netcat - that is probably why I see NO LOGs

            At that point I am lost, I don't know where my packet vanishes.

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

              i'm unable to get a working config using:

              https://doc.pfsense.org/index.php?title=L2TP/IPsec&oldid=7045

              i also altered the config using the setup posted by themaninblack earlier in this thread without any success.

              trying to connect from osx client and ios.

              1 Reply Last reply Reply Quote 0
              • S
                Simple77
                last edited by

                Just a data point that I have gotten L2TP/IPsec working in testing with three virtual machines under Parallels, one pfSense 2.2 server, one Mavericks Mac on the LAN acting as a server, and one Mavericks Mac on the WAN acting as a VPN client.Ā  I can connect and reach the LAN server to share files over AFP.

                I pretty much followed the steps in meta4's link above and made sure to use the 'allusers’ PSK identifier, the Floating Firewall Rule was in place (or AFP connections to the LAN didn't pass), and the DH key group to DH key group to 2 (1024 bit) to support the Macs.

                I've not enabled this in production as the existing LAN network would likely be unreachable.Ā  If anyone is aware if there is an OpenVPN equivalent of 'push "route 10.0.0.0 255.255.0.0' for the L2TP/IPsec approach, details would be appreciated…

                1 Reply Last reply Reply Quote 0
                • P
                  pfSalmon
                  last edited by

                  Really looking forward to connecting to pfSense with a built-in Win8.1 or Android VPN client.

                  I followed the directions from the wiki:
                  https://doc.pfsense.org/index.php?title=L2TP/IPsec&oldid=7045

                  Status: The IPSec tunnel is created successfully, but the L2TP connection times out. No entries in L2TP or firewall logs.Ā  Packet capture on IPSec interface comes up empty.

                  I have allow-all rules in IPSec and L2TP VPN firewall tabs, and added the floating rule from the wiki. Not sure how to diagnose from here, but willing to try if anyone has any suggestions.

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

                    Hi all,

                    Same problem here. IPSec tunnel was successfully established with the client but after that there's no l2tp connection.
                    I've tried many things (as Phoenix and pfSalmon) with no success.

                    1 Reply Last reply Reply Quote 0
                    • W
                      Wolvesclaw
                      last edited by

                      Got the same problem. IPSec connects but nothing shows up in l2tp-logs. The Client trys and throws error 809 after a while.

                      Is there any solution yet?

                      1 Reply Last reply Reply Quote 0
                      • jimpJ
                        jimp Rebel Alliance Developer Netgate
                        last edited by

                        Looks like there may be an issue when the client itself is behind NAT. Is that the case for everyone seeing problems?

                        Remember: Upvote with the šŸ‘ button for any user/post you find to be helpful, informative, or deserving of recognition!

                        Need help fast? Netgate Global Support!

                        Do not Chat/PM for help!

                        1 Reply Last reply Reply Quote 0
                        • H
                          handspring
                          last edited by

                          @jimp:

                          Looks like there may be an issue when the client itself is behind NAT. Is that the case for everyone seeing problems?

                          It's not true.
                          The IPSec/L2TP VPN can be established on iOS, no matte it behind NAT or 3G/4G network (actually it's same as behind NAT). But it couldn't work on Win7/8.1 client.

                          1 Reply Last reply Reply Quote 0
                          • jimpJ
                            jimp Rebel Alliance Developer Netgate
                            last edited by

                            OK, that's consistent with one of our other tests. The problem seems to be Windows Clients with NAT. iOS seemed to connect OK either way.

                            Remember: Upvote with the šŸ‘ button for any user/post you find to be helpful, informative, or deserving of recognition!

                            Need help fast? Netgate Global Support!

                            Do not Chat/PM for help!

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

                              For me, everything is connecting fine.

                              However, the address that is entered for Remote Address Range is 192.168.32.0. This is the IP being handed out when I connect. which, of course, doesn't work.

                              This is not the address I entered. When ever I try to change the address to something like 192.168.32.15, for example, pfSense changes it back to 192.168.32.0.

                              Am I assuming correctly this is not the desired behavior?

                              If this is not the correct behavior how to I fix this?
                              How can I get it to accept an address that ends in something other than .0?

                              Thanks in advance!

                              1 Reply Last reply Reply Quote 0
                              • jimpJ
                                jimp Rebel Alliance Developer Netgate
                                last edited by

                                Fix your subnet mask. It will align the clients to start at the beginning of the entered "subnet".

                                Since it's a fake subnet anyhow, .0 should work in that context, does it not?

                                Remember: Upvote with the šŸ‘ button for any user/post you find to be helpful, informative, or deserving of recognition!

                                Need help fast? Netgate Global Support!

                                Do not Chat/PM for help!

                                1 Reply Last reply Reply Quote 0
                                • P
                                  Phoenix
                                  last edited by

                                  As I configure a road warrior setup my clients are always behind NAT. Please note, that I tested Win8.1 and Android - neither works.

                                  1 Reply Last reply Reply Quote 0
                                  • W
                                    Wolvesclaw
                                    last edited by

                                    @jimp:

                                    Looks like there may be an issue when the client itself is behind NAT. Is that the case for everyone seeing problems?

                                    Yes, it is behind NAT.

                                    1 Reply Last reply Reply Quote 0
                                    • E
                                      eri--
                                      last edited by

                                      @Wolvesclaw:

                                      @jimp:

                                      Looks like there may be an issue when the client itself is behind NAT. Is that the case for everyone seeing problems?

                                      Yes, it is behind NAT.

                                      Than you should look at the sent identity from the mobile clients.
                                      Before racoon was tolerant on this identity if the remoteip matched either the one sent by clients or the one retrieved from packet itself.

                                      1 Reply Last reply Reply Quote 0
                                      • w0wW
                                        w0w
                                        last edited by

                                        I've tried to configure Android 4.1.2 L2TP https://doc.pfsense.org/index.php/L2TP/IPsec_on_Android#L2TP_Setup
                                        Nothing works. If you use IPSEC identifier, then android forces to use aggresive mode and connection fails, because you can not enable aggresive mode in strongwan when no xauth enabled and…  you can not use IPSEC without identifier if you don't use xauth. Epic...
                                        Does somebody else running IPSEC with android 4.1 on 2.2?

                                        EDIT:
                                        Solution
                                        strongswan app + generated certificate with additional Alternative Name "DNS" that must be similar to Common Name. And connection type is
                                        EAP-TLS, peer identifier is the sameĀ  as Common Name in Cert.

                                        1 Reply Last reply Reply Quote 0
                                        • X
                                          XaserII
                                          last edited by

                                          Hi there,

                                          I, too, spent the last two days trying to set this up properly, unfortunately with little success.

                                          Like pfSalmon and others I get a working IPSec connection (and it detects my LAN IP behind NAT) but L2TP won't respond at all, leading to a 809 error on windows.

                                          I did everything like in the docs tutorial and added the floating filter (made no difference)

                                          Unfortunately I can't contribute any info that might help to find the solution either, I'm pretty much a noob in that area..

                                          Hope someone will find a fix soon :)

                                          1 Reply Last reply Reply Quote 0
                                          • R
                                            revjamie
                                            last edited by

                                            I'm also having the same issue. My VPN clients can connect, but they can't access anything inside the network.

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