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.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.
    • A
      AndrewZ
      last edited by

      It seems I have IPSec part working but something is still wrong with L2TP part :(
      The VPN client (iPad) gets the IP but cannot access resources on LAN.
      Can someone share the working L2TP server config together with L2TP firewall rules?
      I suspect something is wrong with LAN subnet, server address and VPN subnet combination.
      Thanks!

      EDIT
      Some details about my setup:
      local LAN 192.168.5.0/24
      L2TP server interface is WAN as shown in https://doc.pfsense.org/index.php/L2TP/IPsec_on_Android
      L2TP server ip 192.168.155.254
      L2TP client subnet 192.168.155.0/24

      in the log:

      Jan 13 13:14:33 	l2tps: [l2tp0] no interface to proxy arp on for 192.168.155.0
      Jan 13 13:14:33 	l2tps: [l2tp0] IFACE: Up event
      Jan 13 13:14:33 	l2tps: 192.168.155.254 -> 192.168.155.0
      Jan 13 13:14:33 	l2tps: [l2tp0] IPCP: LayerUp
      Jan 13 13:14:33 	l2tps: [l2tp0] IPCP: state change Ack-Rcvd --> Opened
      Jan 13 13:14:33 	l2tps: PRIDNS 192.168.5.1
      Jan 13 13:14:33 	l2tps: IPADDR 192.168.155.0
      Jan 13 13:14:33 	l2tps: [l2tp0] IPCP: SendConfigAck #3
      Jan 13 13:14:33 	l2tps: PRIDNS 192.168.5.1
      Jan 13 13:14:33 	l2tps: 192.168.155.0 is OK
      Jan 13 13:14:33 	l2tps: IPADDR 192.168.155.0
      
      
      1 Reply Last reply Reply Quote 0
      • E
        eri--
        last edited by

        You probably have wrongly setup your l2tp seeing that .0 ip assigned.

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

          Changed client subnet, similar result:

          Jan 14 03:10:06 	l2tps: [l2tp0] no interface to proxy arp on for 192.168.155.16
          Jan 14 03:10:06 	l2tps: [l2tp0] IFACE: Up event
          Jan 14 03:10:06 	l2tps: 192.168.155.254 -> 192.168.155.16
          Jan 14 03:10:06 	l2tps: [l2tp0] IPCP: LayerUp
          Jan 14 03:10:06 	l2tps: [l2tp0] IPCP: state change Ack-Rcvd --> Opened
          
          
          1 Reply Last reply Reply Quote 0
          • MikeV7896M
            MikeV7896
            last edited by

            Same (or similar) issue as Andrew…

            I followed themaninblack's config (except for IPSec phase 1 proposal, adjusted for my device)... The connection is being made without any problems. After connecting, I can ping, both LAN hosts and external hosts, DNS works as well (since it's from my pfSense box), but anything else seems to get lost, even webconfig access. I created an "allow all" firewall rule for L2TP, but the logs still show things being blocked... is there another rule I need to add somewhere?

            Could it be blocking all TCP? If I set the DNS client on my phone to force TCP, nothing is able to resolve anymore.

            EDIT: I noticed in themaninblack's post that he mentions...

            • L2TP VPN, add a rule for the VPN traffic you want to allow.  I have a "pass-everything" rule here.  Note that if you add a rule, by default you get a pass all TCP rule, not a pass everything rule.

            It seems like it's block all TCP, not pass all TCP. And it doesn't appear to be something I can remove as it doesn't show in the rules.

            fw-l2tp0.PNG
            fw-l2tp0.PNG_thumb

            The S in IOT stands for Security

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

              Probably you have to enable MSS clamping on your tunnel.

              1 Reply Last reply Reply Quote 0
              • MikeV7896M
                MikeV7896
                last edited by

                No change. TCP still being blocked, while UDP and ICMP go just fine.

                The S in IOT stands for Security

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

                  virgiliomi,
                  you're still more lucky than me :)
                  I do not even see l2tp in the firewall log. Could you please share your working config not hiding the private addresses you use.
                  Thanks!

                  1 Reply Last reply Reply Quote 0
                  • MikeV7896M
                    MikeV7896
                    last edited by

                    Basically, I followed themaninblack's config from earlier in this thread. The only changes I made are…

                    Phase 1 Algorithms:
                    Encryption: AES 256
                    Hash: SHA1
                    DH key group: 2 (1024 bit)

                    Phase 2 Proposal:
                    Encryption: Only AES checked, 256 bit selected
                    Hash: Only SHA1 checked

                    The IP Addresses I used in L2TP settings are a subset of my LAN subnet, just as mentioned by themaninblack. My LAN is 192.168.1.1/24, my L2TP is 192.168.1.208/29 and my server address is 192.168.1.216. If I use addresses outside of my LAN subnet (i.e. 192.168.51.208/29 and 192.168.51.216) then I get ping responses, but no TCP or UDP traffic (so no DNS).

                    The S in IOT stands for Security

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

                      Looks like the rules are somehow not matching as expected. Maybe inbound L2TP traffic is actually bypassing pf and not receiving a state?

                      If you add a Floating rule (quick=checked, dir=out, interface=l2tp, source=any, destination=any, TCP Flags=Any Flags, State Type=Sloppy State) it works.

                      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
                      • MikeV7896M
                        MikeV7896
                        last edited by

                        Yep, that rule definitely fixed it for me. Works much better now!

                        The S in IOT stands for Security

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

                          For those having trouble getting it going, I started from scratch and got this to work, pfSense 2.2 vs Windows 8.1 client:

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

                          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

                            OK, I've deleted my previous config and followed the guide. Result is the same:
                            IPSec:

                            Jan 21 01:57:26 	charon: 08[KNL] 192.168.32.1 appeared on l2tp0
                            Jan 21 01:57:26 	charon: 08[KNL] interface l2tp0 activated
                            
                            

                            L2TP:

                            Jan 21 01:57:26 	l2tps: [l2tp0] rec'd unexpected protocol IP
                            Jan 21 01:57:26 	l2tps: [l2tp0] no interface to proxy arp on for 192.168.32.128
                            Jan 21 01:57:26 	l2tps: [l2tp0] IFACE: Up event
                            Jan 21 01:57:26 	l2tps: 192.168.32.1 -> 192.168.32.128
                            Jan 21 01:57:26 	l2tps: [l2tp0] IPCP: LayerUp
                            Jan 21 01:57:26 	l2tps: [l2tp0] IPCP: state change Ack-Rcvd --> Opened
                            Jan 21 01:57:26 	l2tps: PRIDNS 192.168.5.1
                            Jan 21 01:57:26 	l2tps: IPADDR 192.168.32.128
                            Jan 21 01:57:26 	l2tps: [l2tp0] IPCP: SendConfigAck #3
                            Jan 21 01:57:26 	l2tps: PRIDNS 192.168.5.1
                            Jan 21 01:57:26 	l2tps: 192.168.32.128 is OK
                            Jan 21 01:57:26 	l2tps: IPADDR 192.168.32.128
                            
                            

                            Nothing in firewall log, cannot access LAN. Tested from iPad. pfsense on nanobsd.

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

                              I managed to get a connection and I'm able to browse LAN and internet from my iPhone (iOS 8.1.2) by following that guide, but I had to make the following modifications:

                              IPsec Phase 1:

                              • DH key group: 2 (1024)

                              ~~Firewall - Rules, WAN tab

                              • see attached pic~~
                                (works without these rules)

                              Services - DNS Resolver - Access Lists

                              • allow 192.168.32.128/25

                              ![Screenshot 2015-01-21 12.32.19.png](/public/imported_attachments/1/Screenshot 2015-01-21 12.32.19.png)
                              ![Screenshot 2015-01-21 12.32.19.png_thumb](/public/imported_attachments/1/Screenshot 2015-01-21 12.32.19.png_thumb)

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

                                @Ocid:

                                I managed to get a connection and I'm able to browse LAN and internet from my iPhone (iOS 8.1.2) by following that guide, but I had to make the following modifications:

                                I added those notes to https://doc.pfsense.org/index.php/L2TP/IPsec

                                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
                                • jimpJ
                                  jimp Rebel Alliance Developer Netgate
                                  last edited by

                                  @AndrewZ:

                                  Nothing in firewall log, cannot access LAN. Tested from iPad. pfsense on nanobsd.

                                  What version of iOS? If you see anything at all in the L2TP log then the IPsec portion must be OK.

                                  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
                                  • D
                                    dstroot
                                    last edited by

                                    Services - DNS Resolver - Access Lists

                                    • allow 192.168.32.128/25

                                    This might be my issue - none of the guides I have seen so far have mentioned anything about DNS resolver…

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

                                      @jimp:

                                      What version of iOS? If you see anything at all in the L2TP log then the IPsec portion must be OK.

                                      iOS 8.1.2
                                      I mean the Firewall log has no records related to L2TP, but I do have something in both IPsec and L2TP logs, I mentioned this earlier in this thread.
                                      Could it be related to nanobsd build?

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

                                        Not likely related to NanoBSD, but it could be related to the client configuration and/or L2TP settings. I don't have any devices with iOS 7.x or 8.x to test. I could try 6.x but that may have other unrelated issues.

                                        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

                                          I don't think the client is guilty… I will try to find another client to test. This error - [l2tp0] no interface to proxy arp on for 192.168.32.128' - make me suspicious regarding the L2TP server config or behavior.

                                          Daemon is started as follows:
                                          /usr/local/sbin/mpd4 -b -d /var/etc/l2tp-vpn -p /var/run/l2tp-vpn.pid -s l2tps l2tps

                                          Configuration file /var/etc/l2tp-vpn/mpd.conf

                                          
                                          l2tps:
                                          	load l2tp0
                                          	load l2tp1
                                          	load l2tp2
                                          	load l2tp3
                                          	load l2tp4
                                          	load l2tp5
                                          	load l2tp6
                                          	load l2tp7
                                          
                                          l2tp0:
                                          	new -i l2tp0 l2tp0 l2tp0
                                          	set ipcp ranges 192.168.32.1/32 192.168.32.128/32
                                          	load l2tp_standard
                                          
                                          l2tp1:
                                          	new -i l2tp1 l2tp1 l2tp1
                                          	set ipcp ranges 192.168.32.1/32 192.168.32.129/32
                                          	load l2tp_standard
                                          
                                          l2tp2:
                                          	new -i l2tp2 l2tp2 l2tp2
                                          	set ipcp ranges 192.168.32.1/32 192.168.32.130/32
                                          	load l2tp_standard
                                          
                                          l2tp3:
                                          	new -i l2tp3 l2tp3 l2tp3
                                          	set ipcp ranges 192.168.32.1/32 192.168.32.131/32
                                          	load l2tp_standard
                                          
                                          l2tp4:
                                          	new -i l2tp4 l2tp4 l2tp4
                                          	set ipcp ranges 192.168.32.1/32 192.168.32.132/32
                                          	load l2tp_standard
                                          
                                          l2tp5:
                                          	new -i l2tp5 l2tp5 l2tp5
                                          	set ipcp ranges 192.168.32.1/32 192.168.32.133/32
                                          	load l2tp_standard
                                          
                                          l2tp6:
                                          	new -i l2tp6 l2tp6 l2tp6
                                          	set ipcp ranges 192.168.32.1/32 192.168.32.134/32
                                          	load l2tp_standard
                                          
                                          l2tp7:
                                          	new -i l2tp7 l2tp7 l2tp7
                                          	set ipcp ranges 192.168.32.1/32 192.168.32.135/32
                                          	load l2tp_standard
                                          
                                          l2tp_standard:
                                          	set bundle disable multilink
                                          	set bundle enable compression
                                          	set bundle yes crypt-reqd
                                          	set ipcp yes vjcomp
                                          	# set ipcp ranges 131.188.69.161/32 131.188.69.170/28
                                          	set ccp yes mppc
                                          	set iface disable on-demand
                                          	set iface enable proxy-arp
                                          	set iface up-script /usr/local/sbin/vpn-linkup
                                          	set iface down-script /usr/local/sbin/vpn-linkdown
                                          	set link yes acfcomp protocomp
                                          	set link no pap chap
                                          	set link enable chap
                                          	set link keep-alive 10 180
                                          	set ipcp dns 192.168.5.1
                                          
                                          
                                          1 Reply Last reply Reply Quote 0
                                          • jimpJ
                                            jimp Rebel Alliance Developer Netgate
                                            last edited by

                                            @AndrewZ:

                                            I don't think the client is guilty… I will try to find another client to test. This error - [l2tp0] no interface to proxy arp on for 192.168.32.128' - make me suspicious regarding the L2TP server config or behavior.

                                            That is normal. It only comes into play if you make the client subnet overlap another interface such as LAN, the firewall will proxy arp for the overlapping addresses so the clients can function. It's not related to any problem.

                                            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
                                            • First post
                                              Last post
                                            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.