<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic C2S - L2TP over IPSEC Linux VPN with R80.30 - working in SASE and Remote Access</title>
    <link>https://community.checkpoint.com/t5/SASE-and-Remote-Access/C2S-L2TP-over-IPSEC-Linux-VPN-with-R80-30-working/m-p/68069#M11728</link>
    <description>&lt;P&gt;*************************************************&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;The easiest way to configure L2TP over IPSEC in Linux is to use the&lt;/STRONG&gt; &lt;A href="https://community.checkpoint.com/t5/Remote-Access-Solutions/L2TP-over-IPSec-Linux-VPN/m-p/67225/highlight/true#M2134" target="_self"&gt;Network Manager with the L2TP gnome Plugin as described here&lt;/A&gt;. Use at least Network Manager L2TP Plugin Version 1.7.2, otherwise you can't configure IKE Lifetime (8h) and SA Lifetime (1h) which is very important for a stable connection.&lt;/FONT&gt;&lt;BR /&gt;*************************************************&lt;/P&gt;&lt;P&gt;This guide show every step how &lt;STRONG&gt;L2TP over IPSEC&lt;/STRONG&gt; works in Linux. There are three binaries involved: libreswan, xl2tpd and ppp. At the end you should be able to connect to your Check Point Firewall using the L2TP Pre-shared Key and Username + Password.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;FONT size="5"&gt;&lt;STRONG&gt;Check Point&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/U&gt;&lt;BR /&gt;&lt;SPAN&gt;Before you begin, please make sure you have a working Remote Access environment with Office Mode using one of the Check Point Endpoint Clients (Windows / MacOS). For Authentication use username and password.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;In R80.x, when the L2TP Client is behind a NAT device, the connection won't work, see&lt;A href="https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&amp;amp;solutionid=sk145895" target="_self" rel="nofollow noopener noreferrer"&gt;&amp;nbsp;&lt;/A&gt;&lt;A href="https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&amp;amp;solutionid=sk145895" target="_self" rel="nofollow noopener noreferrer"&gt;&lt;U&gt;sk145895&lt;/U&gt;&lt;/A&gt;. Without this hotfix the L2TP connection won't be establish.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;My Setup:&lt;/U&gt;&lt;STRONG&gt;&lt;BR /&gt;R80.30&amp;nbsp;&lt;/STRONG&gt;Standalone with&lt;STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Jumbo Take 76&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/STRONG&gt;and&lt;STRONG&gt;&amp;nbsp;Hotfix:&amp;nbsp;&lt;/STRONG&gt;&lt;SPAN&gt;&lt;STRONG&gt;fw1_wrapper_HOTFIX_R80_30_T71_JHF_470_MAIN_GA_FULL.tgz&lt;/STRONG&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;U&gt;Requirements Check Point:&lt;/U&gt;&lt;/P&gt;&lt;P&gt;1)&lt;BR /&gt;- Global Properties - Remote Access - VPN - Authentication - Support Authentication - Support Legacy Authentication for SC&lt;BR /&gt;-&amp;nbsp;Global Properties - Remote Access - VPN - Authentication - Support Authentication - Support L2TP with Pre-Shared Key&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="l2tp1.png" style="width: 999px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/3224iD0A66BD2BB790758/image-size/large?v=v2&amp;amp;px=999" role="button" title="l2tp1.png" alt="l2tp1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;2)&lt;BR /&gt;- Gateway Object - Properties - VPN Clients - Remote Access - Support L2TP&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="l2tp2.png" style="width: 999px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/3225i9082A15F79882341/image-size/large?v=v2&amp;amp;px=999" role="button" title="l2tp2.png" alt="l2tp2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="5"&gt;&lt;U&gt;&lt;STRONG&gt;Linux&lt;/STRONG&gt;&lt;/U&gt;&lt;/FONT&gt;&lt;BR /&gt;This guide is based on Linux Mint 19.2 which uses Libreswan 3.23 and xl2tpd 1.3.10.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The L2TP over IPSEC connections depends on&amp;nbsp;&lt;STRONG&gt;libreswan&lt;/STRONG&gt;, &lt;STRONG&gt;xl2tpd&lt;/STRONG&gt;, &lt;STRONG&gt;ppp&lt;/STRONG&gt; and changing the &lt;STRONG&gt;routes&lt;/STRONG&gt; manually.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;1) libreswan&lt;BR /&gt;Is used to establish the IPSEC connection, the transport layer. Install the latest binary by running:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# sudo apt install libreswan&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;2) xl2tpd&amp;nbsp;&lt;BR /&gt;Is used to handle the L2TP authentication with PPP.&amp;nbsp;Install the latest binary by running:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# sudo apt install xl2tpd&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;3) ppp&lt;BR /&gt;Is used for User authentication (Username + Password).&amp;nbsp;Install the latest binary by running:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# sudo apt install ppp   # usually pre-installed&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;4) Routes&lt;BR /&gt;After the L2TP over IPSEC connection was established, routing have to be changed manually.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="4"&gt;&lt;FONT size="5"&gt;Libreswan Configuration&lt;/FONT&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;Libreswan uses files located in /etc/ipsec.d and the main configuration file /etc/ipsec.conf.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;1)&lt;BR /&gt;Edit the main configuration file &lt;STRONG&gt;/etc/ipsec.conf&lt;/STRONG&gt; and add only the logging option. Leave the rest like it is.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;config setup
	# Normally, pluto logs via syslog. If you want to log to a file,
	# specify below or to disable logging, eg for embedded systems, use
	# the file name /dev/null
	# Note: SElinux policies might prevent pluto writing to a log file at
	#       an unusual location.
	logfile=/var/log/pluto.log&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;2)&amp;nbsp;Create a new file called "ra.conf" and "ra.secrets" in /etc/ipsec.d/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;#sudo touch /etc/ipsec.d/ra.conf
#sudo touch /etc/ipsec.d/ra.secrets&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;3) edit the /etc/ipsec.d/ra.conf file&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# sudo vi /etc/ipsec.d/ra.conf&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;conn Company-IPSEC
  auto=add
  type=transport           # IPSEC transport layer
  authby=secret
  keyingtries=0
  left=%defaultroute       # Client IP Address or use the Defaultroute Interface
  right=46.89.4.xxx        # put here your Gateway IP Address
  rightid=192.168.0.1      # Check Point responds with the Main IP Address from the FW Object
  rightprotoport=udp/l2tp  # Use L2TP
  pfs=no                   # no PFS is IKE Phase 2
  ike=aes256-sha1;modp1024 # IKE Phase 1; AES256, SHA1, DH Group2
  phase2alg=aes128-sha1    # IKE Phase 2; AES128, SHA1
  salifetime=1h            # A Lifetime 1h for IKE Phase P2
  ikelifetime=8h           # IKE Lifetime 8h for IKE Phase P1 
  ikev2=no                 # do not use IKEv2&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In this example the libreswan connection name is: &lt;STRONG&gt;Company-IPSEC&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;4) edit the /etc/ipsec.d/ra.secrets file&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;Put in the Pre-Shared Secret from SmartConsole.&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&lt;FONT color="#FF0000"&gt;Global Properties - Remote Access - VPN - Authentication - Support Authentication - Support L2TP with Pre-Shared Key&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# sudo vi /etc/ipsec.d/ra.secrets&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;: PSK "L2TP-Pre-Shared Key"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="5"&gt;&lt;STRONG&gt;XL2TPD Configuration&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;The xl2tpd configuration file is located in /etc/xl2tpd.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;1) edit the main configuration file /etc/xl2tpd/xl2tpd.conf&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# sudo vi /etc/xl2tpd/xl2tpd.conf&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;[global]
access control = yes
port = 1701
;
[lac Company-L2TP]
lns = 46.89.4.xxx                            ; put here your Gateway IP Address 
pppoptfile = /etc/ppp/options.l2tpd.client   ; File for User Authentication
autodial = yes
tunnel rws = 8
tx bps = 100000000
rx bps = 100000000&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this example the L2TP connection name is: "&lt;STRONG&gt;Company-L2TP&lt;/STRONG&gt;".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="5"&gt;&lt;STRONG&gt;PPP Configuration&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;The configuration files are stored under /etc/ppp/&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&lt;BR /&gt;1) create the file /etc/ppp/options.l2tpd.client&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# sudo vi /etc/ppp/options.l2tpd.client&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;nodetach
#show-password            # enable for debugging 
#debug                    # enable for debugging
usepeerdns
noipdefault
nodefaultroute
noauth
noccp
refuse-eap                # no EAP
refuse-chap               # no CHAP
refuse-mschap             # no MSCHAP
refuse-mschap-v2          # no MSCHAPv2
lcp-echo-failure 0
lcp-echo-interval 0
mru 1400
mtu 1400
user macbook              # Username - Check Point User
password PUTUSERPASSWORD  # Password - Check Point User&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;EM&gt;Check Point supports only PAP for PPP Authentication. I checked the iPhone L2TP debugs in vpnd.elg and also the Windows L2TP over IPSEC guide uses only PAP.&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="5"&gt;Initiate the Connection&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;It is very important to start the L2TP over IPSEC connection with all the mentioned commands above. First we need to start libreswan and the xl2tpd. The we bring up the VPN connection.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# systemctl start libreswan
# systemctl start xl2tpd
# sudo ipsec auto --up Company-IPSEC
# sudo echo "c Company-L2TP" |sudo tee /var/run/xl2tpd/l2tp-control&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;If everything works well, it should look like this:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Libreswan&lt;/STRONG&gt;:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;002 "Company-IPSEC" #1: initiating Main Mode
104 "Company-IPSEC" #1: STATE_MAIN_I1: initiate
106 "Company-IPSEC" #1: STATE_MAIN_I2: sent MI2, expecting MR2
108 "Company-IPSEC" #1: STATE_MAIN_I3: sent MI3, expecting MR3
002 "Company-IPSEC" #1: Peer ID is ID_IPV4_ADDR: '192.168.0.1'
004 "Company-IPSEC" #1: STATE_MAIN_I4: ISAKMP SA established {auth=PRESHARED_KEY cipher=aes_256 integ=sha group=MODP1024}
002 "Company-IPSEC" #2: initiating Quick Mode PSK+ENCRYPT+UP+IKEV1_ALLOW+SAREF_TRACK+IKE_FRAG_ALLOW+ESN_NO {using isakmp#1 msgid:4e756e62 proposal=AES_CBC_128-HMAC_SHA1_96 pfsgroup=no-pfs}
117 "Company-IPSEC" #2: STATE_QUICK_I1: initiate
003 "Company-IPSEC" #2: our client peer returned protocol id does not match my proposal - us0 vs them: 17
003 "Company-IPSEC" #2: Allowing questionable proposal anyway [ALLOW_MICROSOFT_BAD_PROPOSAL]
004 "Company-IPSEC" #2: STATE_QUICK_I2: sent QI2, IPsec SA established transport mode {ESP/NAT=&amp;gt;0xb8685cf2 &amp;lt;0x3dcf0898 xfrm=AES_CBC_128-HMAC_SHA1_96 NATOA=none NATD=46.89.4.xxx:4500 DPD=passive}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;xl2tpd:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;soren@mint-laptop:~/Desktop$ systemctl restart xl2tpd
soren@mint-laptop:~/Desktop$ sudo echo "c Comapny-L2TP" |sudo tee /var/run/xl2tpd/l2tp-control 
c Comapny-L2TP&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Interface ppp0 was created:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;ppp0: flags=4305&amp;lt;UP,POINTOPOINT,RUNNING,NOARP,MULTICAST&amp;gt;  mtu 1400
        inet 192.168.1.38  netmask 255.255.255.255  destination 192.168.0.1
        ppp  txqueuelen 3  (Point-to-Point Protocol)
        RX packets 4  bytes 52 (52.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 4  bytes 64 (64.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="5"&gt;Disconnect the Connection&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;The followings commands are used to terminate the L2TP VPN connection.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# sudo echo "d Company-L2TP" |sudo tee /var/run/xl2tpd/l2tp-control
# sudo ipsec auto --down Company-IPSEC
# systemctl stop libreswan
# systemctl stop xl2tpd&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;*for troubleshooting use "restart" instead of "stop".&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;FONT size="5"&gt;Routing&lt;/FONT&gt;&lt;BR /&gt;After the VPN connection is established, the traffic won't be routed through the VPN Tunnel.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;1) Example Route table using an iPhone Hotspot&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;soren@mint-laptop:~/Desktop$ netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         172.20.10.1     0.0.0.0         UG        0 0          0 ens33
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 ens33
172.20.10.0     0.0.0.0         255.255.255.240 U         0 0          0 ens33
192.168.0.1     0.0.0.0         255.255.255.255 UH        0 0          0 ppp0&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;2) Route Only the Encryption Domain&lt;/P&gt;&lt;P&gt;First try to route only your Encryption Domain through the VPN Tunnel, for example 192.168.0.0/24. The next hop is the IP Address of the ppp0 Interface, in this example 192.168.1.38&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# sudo ip route add 192.168.0.0/24 via 192.168.1.38 dev ppp0&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Routing Table:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;soren@mint-laptop:~/Desktop$ netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         172.20.10.1     0.0.0.0         UG        0 0          0 ens33
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 ens33
172.20.10.0     0.0.0.0         255.255.255.240 U         0 0          0 ens33
192.168.0.0     192.168.1.38    255.255.255.0   UG        0 0          0 ppp0
192.168.0.1     0.0.0.0         255.255.255.255 UH        0 0          0 ppp0&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try to reach any host in the Encryption Domain&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;FONT size="5"&gt;Troubleshooting&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;For troubleshooting and configuration changes&amp;nbsp;&lt;U&gt;&lt;STRONG&gt;always&lt;/STRONG&gt;&lt;/U&gt; restart both services!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# systemctl restart ipsec
# systemctl restart xl2tpd&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Logfiles are in /var/log/pluto.log (libreswan) and /var/log/syslog (xl2tpd)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="5"&gt;Scripts&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;It is very useful to use a script to do all the mentioned steps above. The mentioned script is from the &lt;A href="https://wiki.archlinux.org/index.php/Openswan_L2TP/IPsec_VPN_client_setup" target="_self"&gt;Arch Wiki&lt;/A&gt;. This script starts libreswan, xl2tpd and changes the routing to route all traffic through the tunnel.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;#!/bin/bash
if [ $# != 1 ] ; then
	echo "Usage: (sudo) sh $0 {start|stop}" 
	exit 1;
fi

VPN_ADDR=46.89.4.xxx  # put here your Firewall IP
IFACE=ens33           # LAN /Wifi Interface

function getIP(){
	ip addr show $1 | grep "inet " | awk '{print $2}' | sed 's:/.*::'       
}

function getGateWay(){
	route -n | grep -m 1 "^0\.0\.0\.0" | awk '{print $2}'
}
function getVPNGateWay(){
	route -n | grep -m 1 "$VPN_ADDR" | awk '{print $2}'
}

GW_ADDR=$(getGateWay)  


function start(){
	systemctl restart ipsec
	sleep 1    #delay to ensure that IPsec is started before overlaying L2TP
	systemctl restart xl2tpd
	ipsec auto --up Company-IPSEC                       
        sleep 1	
	echo "c Company-L2TP" | sudo tee /var/run/xl2tpd/l2tp-control     
	sleep 4    #delay again to make that the PPP connection is up.

	route add $VPN_ADDR gw $GW_ADDR $IFACE
	route add default gw $(getIP ppp0)
	route delete default gw $GW_ADDR
}

function stop(){
	ipsec auto --down Company-IPSEC
	echo "d Company-L2TP" | sudo tee /var/run/xl2tpd/l2tp-control
	
	VPN_GW=$(getVPNGateWay)
	route delete $VPN_ADDR gw $VPN_GW $IFACE
	route add default gw $VPN_GW
}

$1
exit 0&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Save the script under the name&amp;nbsp;&lt;STRONG&gt;vpn.sh&lt;/STRONG&gt; and use it like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# sudo ./vpn.sh start
# sudo ./vpn.sh stop&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If any error comes up running the script, run "# sudo ./vpn stop" to change the routing back to normal.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 17 Feb 2020 12:38:33 GMT</pubDate>
    <dc:creator>Soeren_Rothe</dc:creator>
    <dc:date>2020-02-17T12:38:33Z</dc:date>
    <item>
      <title>C2S - L2TP over IPSEC Linux VPN with R80.30 - working</title>
      <link>https://community.checkpoint.com/t5/SASE-and-Remote-Access/C2S-L2TP-over-IPSEC-Linux-VPN-with-R80-30-working/m-p/68069#M11728</link>
      <description>&lt;P&gt;*************************************************&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;The easiest way to configure L2TP over IPSEC in Linux is to use the&lt;/STRONG&gt; &lt;A href="https://community.checkpoint.com/t5/Remote-Access-Solutions/L2TP-over-IPSec-Linux-VPN/m-p/67225/highlight/true#M2134" target="_self"&gt;Network Manager with the L2TP gnome Plugin as described here&lt;/A&gt;. Use at least Network Manager L2TP Plugin Version 1.7.2, otherwise you can't configure IKE Lifetime (8h) and SA Lifetime (1h) which is very important for a stable connection.&lt;/FONT&gt;&lt;BR /&gt;*************************************************&lt;/P&gt;&lt;P&gt;This guide show every step how &lt;STRONG&gt;L2TP over IPSEC&lt;/STRONG&gt; works in Linux. There are three binaries involved: libreswan, xl2tpd and ppp. At the end you should be able to connect to your Check Point Firewall using the L2TP Pre-shared Key and Username + Password.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;FONT size="5"&gt;&lt;STRONG&gt;Check Point&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/U&gt;&lt;BR /&gt;&lt;SPAN&gt;Before you begin, please make sure you have a working Remote Access environment with Office Mode using one of the Check Point Endpoint Clients (Windows / MacOS). For Authentication use username and password.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;In R80.x, when the L2TP Client is behind a NAT device, the connection won't work, see&lt;A href="https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&amp;amp;solutionid=sk145895" target="_self" rel="nofollow noopener noreferrer"&gt;&amp;nbsp;&lt;/A&gt;&lt;A href="https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&amp;amp;solutionid=sk145895" target="_self" rel="nofollow noopener noreferrer"&gt;&lt;U&gt;sk145895&lt;/U&gt;&lt;/A&gt;. Without this hotfix the L2TP connection won't be establish.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;My Setup:&lt;/U&gt;&lt;STRONG&gt;&lt;BR /&gt;R80.30&amp;nbsp;&lt;/STRONG&gt;Standalone with&lt;STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Jumbo Take 76&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/STRONG&gt;and&lt;STRONG&gt;&amp;nbsp;Hotfix:&amp;nbsp;&lt;/STRONG&gt;&lt;SPAN&gt;&lt;STRONG&gt;fw1_wrapper_HOTFIX_R80_30_T71_JHF_470_MAIN_GA_FULL.tgz&lt;/STRONG&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;U&gt;Requirements Check Point:&lt;/U&gt;&lt;/P&gt;&lt;P&gt;1)&lt;BR /&gt;- Global Properties - Remote Access - VPN - Authentication - Support Authentication - Support Legacy Authentication for SC&lt;BR /&gt;-&amp;nbsp;Global Properties - Remote Access - VPN - Authentication - Support Authentication - Support L2TP with Pre-Shared Key&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="l2tp1.png" style="width: 999px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/3224iD0A66BD2BB790758/image-size/large?v=v2&amp;amp;px=999" role="button" title="l2tp1.png" alt="l2tp1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;2)&lt;BR /&gt;- Gateway Object - Properties - VPN Clients - Remote Access - Support L2TP&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="l2tp2.png" style="width: 999px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/3225i9082A15F79882341/image-size/large?v=v2&amp;amp;px=999" role="button" title="l2tp2.png" alt="l2tp2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="5"&gt;&lt;U&gt;&lt;STRONG&gt;Linux&lt;/STRONG&gt;&lt;/U&gt;&lt;/FONT&gt;&lt;BR /&gt;This guide is based on Linux Mint 19.2 which uses Libreswan 3.23 and xl2tpd 1.3.10.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The L2TP over IPSEC connections depends on&amp;nbsp;&lt;STRONG&gt;libreswan&lt;/STRONG&gt;, &lt;STRONG&gt;xl2tpd&lt;/STRONG&gt;, &lt;STRONG&gt;ppp&lt;/STRONG&gt; and changing the &lt;STRONG&gt;routes&lt;/STRONG&gt; manually.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;1) libreswan&lt;BR /&gt;Is used to establish the IPSEC connection, the transport layer. Install the latest binary by running:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# sudo apt install libreswan&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;2) xl2tpd&amp;nbsp;&lt;BR /&gt;Is used to handle the L2TP authentication with PPP.&amp;nbsp;Install the latest binary by running:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# sudo apt install xl2tpd&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;3) ppp&lt;BR /&gt;Is used for User authentication (Username + Password).&amp;nbsp;Install the latest binary by running:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# sudo apt install ppp   # usually pre-installed&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;4) Routes&lt;BR /&gt;After the L2TP over IPSEC connection was established, routing have to be changed manually.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="4"&gt;&lt;FONT size="5"&gt;Libreswan Configuration&lt;/FONT&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;Libreswan uses files located in /etc/ipsec.d and the main configuration file /etc/ipsec.conf.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;1)&lt;BR /&gt;Edit the main configuration file &lt;STRONG&gt;/etc/ipsec.conf&lt;/STRONG&gt; and add only the logging option. Leave the rest like it is.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;config setup
	# Normally, pluto logs via syslog. If you want to log to a file,
	# specify below or to disable logging, eg for embedded systems, use
	# the file name /dev/null
	# Note: SElinux policies might prevent pluto writing to a log file at
	#       an unusual location.
	logfile=/var/log/pluto.log&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;2)&amp;nbsp;Create a new file called "ra.conf" and "ra.secrets" in /etc/ipsec.d/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;#sudo touch /etc/ipsec.d/ra.conf
#sudo touch /etc/ipsec.d/ra.secrets&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;3) edit the /etc/ipsec.d/ra.conf file&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# sudo vi /etc/ipsec.d/ra.conf&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;conn Company-IPSEC
  auto=add
  type=transport           # IPSEC transport layer
  authby=secret
  keyingtries=0
  left=%defaultroute       # Client IP Address or use the Defaultroute Interface
  right=46.89.4.xxx        # put here your Gateway IP Address
  rightid=192.168.0.1      # Check Point responds with the Main IP Address from the FW Object
  rightprotoport=udp/l2tp  # Use L2TP
  pfs=no                   # no PFS is IKE Phase 2
  ike=aes256-sha1;modp1024 # IKE Phase 1; AES256, SHA1, DH Group2
  phase2alg=aes128-sha1    # IKE Phase 2; AES128, SHA1
  salifetime=1h            # A Lifetime 1h for IKE Phase P2
  ikelifetime=8h           # IKE Lifetime 8h for IKE Phase P1 
  ikev2=no                 # do not use IKEv2&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In this example the libreswan connection name is: &lt;STRONG&gt;Company-IPSEC&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;4) edit the /etc/ipsec.d/ra.secrets file&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;Put in the Pre-Shared Secret from SmartConsole.&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&lt;FONT color="#FF0000"&gt;Global Properties - Remote Access - VPN - Authentication - Support Authentication - Support L2TP with Pre-Shared Key&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# sudo vi /etc/ipsec.d/ra.secrets&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;: PSK "L2TP-Pre-Shared Key"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="5"&gt;&lt;STRONG&gt;XL2TPD Configuration&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;The xl2tpd configuration file is located in /etc/xl2tpd.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;1) edit the main configuration file /etc/xl2tpd/xl2tpd.conf&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# sudo vi /etc/xl2tpd/xl2tpd.conf&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;[global]
access control = yes
port = 1701
;
[lac Company-L2TP]
lns = 46.89.4.xxx                            ; put here your Gateway IP Address 
pppoptfile = /etc/ppp/options.l2tpd.client   ; File for User Authentication
autodial = yes
tunnel rws = 8
tx bps = 100000000
rx bps = 100000000&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this example the L2TP connection name is: "&lt;STRONG&gt;Company-L2TP&lt;/STRONG&gt;".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="5"&gt;&lt;STRONG&gt;PPP Configuration&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;The configuration files are stored under /etc/ppp/&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&lt;BR /&gt;1) create the file /etc/ppp/options.l2tpd.client&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# sudo vi /etc/ppp/options.l2tpd.client&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;nodetach
#show-password            # enable for debugging 
#debug                    # enable for debugging
usepeerdns
noipdefault
nodefaultroute
noauth
noccp
refuse-eap                # no EAP
refuse-chap               # no CHAP
refuse-mschap             # no MSCHAP
refuse-mschap-v2          # no MSCHAPv2
lcp-echo-failure 0
lcp-echo-interval 0
mru 1400
mtu 1400
user macbook              # Username - Check Point User
password PUTUSERPASSWORD  # Password - Check Point User&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;EM&gt;Check Point supports only PAP for PPP Authentication. I checked the iPhone L2TP debugs in vpnd.elg and also the Windows L2TP over IPSEC guide uses only PAP.&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="5"&gt;Initiate the Connection&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;It is very important to start the L2TP over IPSEC connection with all the mentioned commands above. First we need to start libreswan and the xl2tpd. The we bring up the VPN connection.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# systemctl start libreswan
# systemctl start xl2tpd
# sudo ipsec auto --up Company-IPSEC
# sudo echo "c Company-L2TP" |sudo tee /var/run/xl2tpd/l2tp-control&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;If everything works well, it should look like this:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Libreswan&lt;/STRONG&gt;:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;002 "Company-IPSEC" #1: initiating Main Mode
104 "Company-IPSEC" #1: STATE_MAIN_I1: initiate
106 "Company-IPSEC" #1: STATE_MAIN_I2: sent MI2, expecting MR2
108 "Company-IPSEC" #1: STATE_MAIN_I3: sent MI3, expecting MR3
002 "Company-IPSEC" #1: Peer ID is ID_IPV4_ADDR: '192.168.0.1'
004 "Company-IPSEC" #1: STATE_MAIN_I4: ISAKMP SA established {auth=PRESHARED_KEY cipher=aes_256 integ=sha group=MODP1024}
002 "Company-IPSEC" #2: initiating Quick Mode PSK+ENCRYPT+UP+IKEV1_ALLOW+SAREF_TRACK+IKE_FRAG_ALLOW+ESN_NO {using isakmp#1 msgid:4e756e62 proposal=AES_CBC_128-HMAC_SHA1_96 pfsgroup=no-pfs}
117 "Company-IPSEC" #2: STATE_QUICK_I1: initiate
003 "Company-IPSEC" #2: our client peer returned protocol id does not match my proposal - us0 vs them: 17
003 "Company-IPSEC" #2: Allowing questionable proposal anyway [ALLOW_MICROSOFT_BAD_PROPOSAL]
004 "Company-IPSEC" #2: STATE_QUICK_I2: sent QI2, IPsec SA established transport mode {ESP/NAT=&amp;gt;0xb8685cf2 &amp;lt;0x3dcf0898 xfrm=AES_CBC_128-HMAC_SHA1_96 NATOA=none NATD=46.89.4.xxx:4500 DPD=passive}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;xl2tpd:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;soren@mint-laptop:~/Desktop$ systemctl restart xl2tpd
soren@mint-laptop:~/Desktop$ sudo echo "c Comapny-L2TP" |sudo tee /var/run/xl2tpd/l2tp-control 
c Comapny-L2TP&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Interface ppp0 was created:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;ppp0: flags=4305&amp;lt;UP,POINTOPOINT,RUNNING,NOARP,MULTICAST&amp;gt;  mtu 1400
        inet 192.168.1.38  netmask 255.255.255.255  destination 192.168.0.1
        ppp  txqueuelen 3  (Point-to-Point Protocol)
        RX packets 4  bytes 52 (52.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 4  bytes 64 (64.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="5"&gt;Disconnect the Connection&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;The followings commands are used to terminate the L2TP VPN connection.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# sudo echo "d Company-L2TP" |sudo tee /var/run/xl2tpd/l2tp-control
# sudo ipsec auto --down Company-IPSEC
# systemctl stop libreswan
# systemctl stop xl2tpd&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;*for troubleshooting use "restart" instead of "stop".&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;FONT size="5"&gt;Routing&lt;/FONT&gt;&lt;BR /&gt;After the VPN connection is established, the traffic won't be routed through the VPN Tunnel.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;1) Example Route table using an iPhone Hotspot&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;soren@mint-laptop:~/Desktop$ netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         172.20.10.1     0.0.0.0         UG        0 0          0 ens33
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 ens33
172.20.10.0     0.0.0.0         255.255.255.240 U         0 0          0 ens33
192.168.0.1     0.0.0.0         255.255.255.255 UH        0 0          0 ppp0&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;2) Route Only the Encryption Domain&lt;/P&gt;&lt;P&gt;First try to route only your Encryption Domain through the VPN Tunnel, for example 192.168.0.0/24. The next hop is the IP Address of the ppp0 Interface, in this example 192.168.1.38&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# sudo ip route add 192.168.0.0/24 via 192.168.1.38 dev ppp0&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Routing Table:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;soren@mint-laptop:~/Desktop$ netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         172.20.10.1     0.0.0.0         UG        0 0          0 ens33
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 ens33
172.20.10.0     0.0.0.0         255.255.255.240 U         0 0          0 ens33
192.168.0.0     192.168.1.38    255.255.255.0   UG        0 0          0 ppp0
192.168.0.1     0.0.0.0         255.255.255.255 UH        0 0          0 ppp0&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try to reach any host in the Encryption Domain&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;FONT size="5"&gt;Troubleshooting&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;For troubleshooting and configuration changes&amp;nbsp;&lt;U&gt;&lt;STRONG&gt;always&lt;/STRONG&gt;&lt;/U&gt; restart both services!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# systemctl restart ipsec
# systemctl restart xl2tpd&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Logfiles are in /var/log/pluto.log (libreswan) and /var/log/syslog (xl2tpd)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="5"&gt;Scripts&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;It is very useful to use a script to do all the mentioned steps above. The mentioned script is from the &lt;A href="https://wiki.archlinux.org/index.php/Openswan_L2TP/IPsec_VPN_client_setup" target="_self"&gt;Arch Wiki&lt;/A&gt;. This script starts libreswan, xl2tpd and changes the routing to route all traffic through the tunnel.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;#!/bin/bash
if [ $# != 1 ] ; then
	echo "Usage: (sudo) sh $0 {start|stop}" 
	exit 1;
fi

VPN_ADDR=46.89.4.xxx  # put here your Firewall IP
IFACE=ens33           # LAN /Wifi Interface

function getIP(){
	ip addr show $1 | grep "inet " | awk '{print $2}' | sed 's:/.*::'       
}

function getGateWay(){
	route -n | grep -m 1 "^0\.0\.0\.0" | awk '{print $2}'
}
function getVPNGateWay(){
	route -n | grep -m 1 "$VPN_ADDR" | awk '{print $2}'
}

GW_ADDR=$(getGateWay)  


function start(){
	systemctl restart ipsec
	sleep 1    #delay to ensure that IPsec is started before overlaying L2TP
	systemctl restart xl2tpd
	ipsec auto --up Company-IPSEC                       
        sleep 1	
	echo "c Company-L2TP" | sudo tee /var/run/xl2tpd/l2tp-control     
	sleep 4    #delay again to make that the PPP connection is up.

	route add $VPN_ADDR gw $GW_ADDR $IFACE
	route add default gw $(getIP ppp0)
	route delete default gw $GW_ADDR
}

function stop(){
	ipsec auto --down Company-IPSEC
	echo "d Company-L2TP" | sudo tee /var/run/xl2tpd/l2tp-control
	
	VPN_GW=$(getVPNGateWay)
	route delete $VPN_ADDR gw $VPN_GW $IFACE
	route add default gw $VPN_GW
}

$1
exit 0&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Save the script under the name&amp;nbsp;&lt;STRONG&gt;vpn.sh&lt;/STRONG&gt; and use it like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# sudo ./vpn.sh start
# sudo ./vpn.sh stop&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If any error comes up running the script, run "# sudo ./vpn stop" to change the routing back to normal.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2020 12:38:33 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/SASE-and-Remote-Access/C2S-L2TP-over-IPSEC-Linux-VPN-with-R80-30-working/m-p/68069#M11728</guid>
      <dc:creator>Soeren_Rothe</dc:creator>
      <dc:date>2020-02-17T12:38:33Z</dc:date>
    </item>
    <item>
      <title>Re: C2S - L2TP over IPSEC Linux VPN with R80.30 - working</title>
      <link>https://community.checkpoint.com/t5/SASE-and-Remote-Access/C2S-L2TP-over-IPSEC-Linux-VPN-with-R80-30-working/m-p/68085#M11729</link>
      <description>&lt;P&gt;Sounds nice, but where to get the&amp;nbsp;&lt;STRONG&gt;fw1_wrapper_HOTFIX_R80_30_T71_JHF_470_MAIN_GA_FULL.tgz&lt;/STRONG&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Nov 2019 08:31:59 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/SASE-and-Remote-Access/C2S-L2TP-over-IPSEC-Linux-VPN-with-R80-30-working/m-p/68085#M11729</guid>
      <dc:creator>G_W_Albrecht</dc:creator>
      <dc:date>2019-11-22T08:31:59Z</dc:date>
    </item>
    <item>
      <title>Re: C2S - L2TP over IPSEC Linux VPN with R80.30 - working</title>
      <link>https://community.checkpoint.com/t5/SASE-and-Remote-Access/C2S-L2TP-over-IPSEC-Linux-VPN-with-R80-30-working/m-p/68087#M11730</link>
      <description>&lt;P&gt;You have to open a chat or case with Check Point support.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Nov 2019 08:36:32 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/SASE-and-Remote-Access/C2S-L2TP-over-IPSEC-Linux-VPN-with-R80-30-working/m-p/68087#M11730</guid>
      <dc:creator>Soeren_Rothe</dc:creator>
      <dc:date>2019-11-22T08:36:32Z</dc:date>
    </item>
    <item>
      <title>Re: C2S - L2TP over IPSEC Linux VPN with R80.30 - working</title>
      <link>https://community.checkpoint.com/t5/SASE-and-Remote-Access/C2S-L2TP-over-IPSEC-Linux-VPN-with-R80-30-working/m-p/68101#M11731</link>
      <description>&lt;P&gt;Write that inside your post and all is fine 8)&lt;/img&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Nov 2019 09:56:24 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/SASE-and-Remote-Access/C2S-L2TP-over-IPSEC-Linux-VPN-with-R80-30-working/m-p/68101#M11731</guid>
      <dc:creator>G_W_Albrecht</dc:creator>
      <dc:date>2019-11-22T09:56:24Z</dc:date>
    </item>
  </channel>
</rss>

