<?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 How to configure VPN Remote Access on non-default Internet Link in SASE and Remote Access</title>
    <link>https://community.checkpoint.com/t5/SASE-and-Remote-Access/How-to-configure-VPN-Remote-Access-on-non-default-Internet-Link/m-p/81991#M10664</link>
    <description>&lt;P&gt;Security Engineering Brazil&lt;/P&gt;
&lt;P&gt;April, 2020&lt;/P&gt;
&lt;P&gt;Version 02&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Author:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Thiago Mourao, SE and Cyber Security Evangelist&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Revision:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Henrique Moises, SE&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="5"&gt;Contents&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="#_Toc37824571" target="_blank" rel="noopener"&gt;How to configure VPN Remote Access on non-default Internet Link&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="#_Toc37824572" target="_blank" rel="noopener"&gt;Objective&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="#_Toc37824574" target="_blank" rel="noopener"&gt;Know Limitation and Requirements&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="#_Toc37824575" target="_blank" rel="noopener"&gt;Topology&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="#_Toc37824576" target="_blank" rel="noopener"&gt;Scripts&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="#_Toc37824577" target="_blank" rel="noopener"&gt;Step by Step&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="5"&gt;&lt;A target="_blank" name="_Toc37824572"&gt;&lt;/A&gt;&lt;STRONG&gt;Objective&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Configure Remote Access to respond for non-default Internet Link.&lt;/P&gt;
&lt;P&gt;As default configuration, when the first packet arrives from the non-default internet link, gateway will check its routing table and will reply those packets using the default route and after that the packets will be sent to the interface where the default route is configured. In many cases, those packets will be blocked by the next hop due to Out of State (SYN-ACK without SYN) or due to ingress routing filter that will check that the source do not belong to that route/network.&lt;/P&gt;
&lt;P&gt;PS: In a specific scenario this configuration might work with no further actions needed. In this scenario, the primary ISP link do not check Stateful Inspection or dot have Ingress Routing Filter to block spoofing/DDoS attacks, so in that case the security level is going to be lower, hence not recommended.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A target="_blank" name="_Toc37824574"&gt;&lt;/A&gt;&lt;FONT size="5"&gt;&lt;STRONG&gt;Know Limitation and Requirements&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;I have used static-route on this example instead of PBR that would be a more granular way to be done&lt;/LI&gt;
&lt;LI&gt;I have used a wrapper for cprid_util created by&amp;nbsp;&lt;a href="https://community.checkpoint.com/t5/user/viewprofilepage/user-id/21670"&gt;@HeikoAnkenbrand&lt;/a&gt;&amp;nbsp; (&lt;STRONG&gt;HeikoAnkenbrand&lt;/STRONG&gt;) on his article on Check Mates called “&lt;STRONG&gt;GAIA - Easy execute CLI commands from management on gateways&lt;/STRONG&gt;” (&lt;A href="https://community.checkpoint.com/t5/Enterprise-Appliances-and-Gaia/GAIA-Easy-execute-CLI-commands-from-management-on-gateways/m-p/50764/highlight/true#M3759" target="_blank" rel="noopener"&gt;https://community.checkpoint.com/t5/Enterprise-Appliances-and-Gaia/GAIA-Easy-execute-CLI-commands-from-management-on-gateways/m-p/50764/highlight/true#M3759&lt;/A&gt;) to execute command on gateway from the SMS&lt;/LI&gt;
&lt;LI&gt;For this PoC we assume that you already have configured a gateway with 2 (two) internet links where the first one is the default route and the second one is a backup link&lt;/LI&gt;
&lt;LI&gt;For this PoC we assume that you already configured Remote Access VPN (IPsec or Mobile Access) to respond with the IP of the secondary internet link&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="5"&gt;&lt;STRONG&gt;Topology&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;In this lab we are using R80.40 on both Security Gateway and Manager, and they were virtualized on VMware Workstation 12.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Virtual Environment:&lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;1 x Check Point Gateway R80.40&lt;/LI&gt;
&lt;LI&gt;1 x Check Point Manager R80.40&lt;/LI&gt;
&lt;LI&gt;1 x Microsoft Windows Server 2012 R2&lt;/LI&gt;
&lt;LI&gt;1 x Windows 7 Ultimate&lt;/LI&gt;
&lt;LI&gt;4 x Virtual Routers (VyOS)&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;Host Environment:&lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;1 x Notebook (Windows Professional) with VMWare Workstation 12&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;NAT:&lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;In this topology, Router &lt;STRONG&gt;RT_301&lt;/STRONG&gt; is doing source NAT &lt;STRONG&gt;FROM:&lt;/STRONG&gt; &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;192.168.250.1&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;TO:&lt;/STRONG&gt; &lt;FONT color="#339966"&gt;&lt;STRONG&gt;200.251.0.1&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Topology.png" style="width: 999px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/5619iD4AB8B060827A150/image-size/large?v=v2&amp;amp;px=999" role="button" title="Topology.png" alt="Topology.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;
&lt;P&gt;&lt;A target="_blank" name="_Toc37824576"&gt;&lt;/A&gt;&lt;STRONG&gt;&lt;FONT size="5"&gt;Scripts&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;FirstTimeSetup.sh&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;This script will prepare the environment to be run for the first time.&lt;/P&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="664"&gt;
&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;#!/bin/bash -f&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;source /opt/CPshrd-R80.40/tmp/.CPprofile.sh&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;#Script Directory&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;EXECDIR="/home/admin/VPNSecondaryLink"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;#User that will Execute the Scripts and Cron Job&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;EXECUSER="admin"&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "First time setup"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "Creating all files and Gaia configuration"&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "Creating Directories"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;mkdir $EXECDIR&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;mkdir $EXECDIR/log&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;mkdir $EXECDIR/tmp&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "Creating Files"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;touch $EXECDIR/CronJob_VPNSecondaryLinkCleanUp.sh&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;touch $EXECDIR/VPNSecondaryLinkCleanUp.sh&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;touch $EXECDIR/VPNSecondaryLink_alert.sh&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;touch $EXECDIR/log/CronJob_VPNSecondaryLinkCleanUp.sh.log&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;touch /var/log/VPNSecondaryLink_alert.log&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "Creating Symbolic Links"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;ln -s /var/log/VPNSecondaryLink_alert.log $EXECDIR/log/VPNSecondaryLink_alert.log&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;ln -s $EXECDIR/VPNSecondaryLink_alert.sh $FWDIR/bin/VPNSecondaryLink_alert&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "Copying Scripts to $EXECDIR"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;cp ./CronJob_VPNSecondaryLinkCleanUp.sh $EXECDIR/CronJob_VPNSecondaryLinkCleanUp.sh&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;cp ./VPNSecondaryLink_alert.sh $EXECDIR/VPNSecondaryLink_alert.sh&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "Changing Owner and Group" &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;chown $EXECUSER:bin $EXECDIR/CronJob_VPNSecondaryLinkCleanUp.sh&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;chown $EXECUSER:bin $EXECDIR/VPNSecondaryLink_alert.sh&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;chown $EXECUSER:bin $FWDIR/bin/VPNSecondaryLink_alert.sh&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo " Changing Permission"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;chmod 760 $EXECDIR/CronJob_VPNSecondaryLinkCleanUp.sh&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;chmod 760 $EXECDIR/VPNSecondaryLink_alert.sh&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;chmod 760 $FWDIR/bin/VPNSecondaryLink_alert.sh&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "Lock Database Override"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;clish -c "lock database override" &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "Adding Daily Based Recurrence for CronJob_VPNSecondaryLinkCleanUp at Cron Job to 2:00am"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;clish -c 'add cron job VPNSecondaryLinkCleanUp command "/home/admin/VPNSecondaryLink/CronJob_VPNSecondaryLinkCleanUp.sh &amp;gt;&amp;gt; /home/admin/VPNSecondaryLink/log/CronJob_VPNSecondaryLinkCleanUp.sh.log 2&amp;gt;&amp;amp;1" recurrence daily time 2:00'&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "Saving clish configuration"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;clish -c "save config"&lt;/FONT&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;VPNSecondaryLink_alert.sh&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;This Script will be called by the Track field of the &amp;nbsp;rule created in the SmartConsole, then the output is being parsed, creating the static route based on the source IP of the packet that hit the rule&lt;/P&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="664"&gt;
&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;#!/bin/bash -f&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;source /opt/CPshrd-R80.40/tmp/.CPprofile.sh&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;#Script Directory&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;DIR="/home/admin/VPNSecondaryLink"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;#User that will Execute the Scripts and Cron Job&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;EXECUSER="admin"&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;#Jump to Script Directory&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;cd $FWDIR/bin&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;#Global Variable&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;gateway_ip="10.0.50.100"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;secondary_gw="200.200.0.102"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;raw_pbr_error=0&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;error_msg1="Error: Object Name pattern founded on multiple Host Objects"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;error_msg2="Error: Static Route alreded configure"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;error_msg3="Error: Rule Name do not match"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;error_msg4="Error: Object not found on management Database"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;error_msg5="Error: Route Already Inserted on CleanUp Script"&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "#### Executing VPNSecondaryLink_alert at $(date -u) ####"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;[ $raw_pbr_error -gt 0 ] || {&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "Reading input from rule"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;read input&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;#echo "Troubleshooting enabled"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;#echo $input &amp;gt; $DIR/tmp/VPNSecondaryLink_alert_tr.log&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "Parsing Source Object Name"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "Checking if Source is using Object Name"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;raw_src_name=$(echo $input | sed -n 's/.* src: \(.*\); dst: .*/\1/p')&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;#echo "variavel raw_src_name=$raw_src_name"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "Checking if Source is using IP"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;raw_src_ip=$(echo "$input" | grep -o -P '.{0,5}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)' | grep src | sed -n 's/^src: \(.*\)/\1/p' )&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;#echo "variavel raw_src_ip=$raw_src_ip"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;firstocteto=$(echo "$raw_src_ip" | sed -n 's/\(^[[:digit:]]*\)\..*\..*\..*/\1/p')&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;#echo "variavel firstocteto=$firstocteto"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;if [ -z $firstocteto ] || [ $firstocteto -gt 223 ]; then&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "Cannot match with IP parsing... Trying to find IP on Management Object Database"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;raw_src_ip=$(mgmt_cli -r true show objects limit 2 offset 0 order.1.ASC "name" in.1 "name" in.2 "$raw_src_name" order.2.DESC "objId" type "host" --format json | jq '.objects[]."ipv4-address"')&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;if [ -z $raw_src_ip ] ; then&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo $error_msg4;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;raw_pbr_error=1;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;exit 1;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;elif [ $(echo "$raw_src_ip" | wc -l) -gt 1 ] ; then&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo $error_msg1;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;raw_pbr_error=1;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;exit 1;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "IP Founded"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;raw_src_ip=$(echo "$raw_src_ip"| tr -d \");&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "Source IP: $raw_src_ip"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;fi&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "IP has no object in Database, using IP from Log"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "Source IP: $raw_src_ip"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;fi&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "Parsing Destination Object Name"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;raw_dst_ip=$eth1&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "Destination IP: $raw_dst_ip"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "Check if Route already exist"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;if [ $(/usr/local/bin/g_cli 10.0.50.100 show configuration static-route | grep "$raw_src_ip" | wc -l) -gt 0 ] ; then&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo $error_msg2;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;raw_pbr_error=1;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;exit 0;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;touch $DIR/VPNSecondaryLinkCleanUp.sh&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;chmod +x $DIR/VPNSecondaryLinkCleanUp.sh&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "Creating Routing for $raw_src_ip/32"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;/usr/local/bin/g_cli $gateway_ip "set static-route $raw_src_ip/32 nexthop gateway address $secondary_gw on"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "Checking file VPNSecondaryLinkCleanUp.sh"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;if [ $(cat /tmp/VPNSecondaryLinkCleanUp.sh | grep $raw_src_ip | wc -l ) -gt 0 ] ; then&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo $error_msg5;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;raw_pbr_error=1;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;exit 1; &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "Adding new route to VPNSecondaryLinkCleanUp.sh"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "/usr/local/bin/g_cli $gateway_ip set static-route $raw_src_ip/32 off" &amp;gt;&amp;gt; $DIR/VPNSecondaryLinkCleanUp.sh&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;fi&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;fi&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "#### End of Execution of VPNSecondaryLink_alert at $(date -u) ####"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo -e '\n\n'&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;exit 1;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;}&lt;/FONT&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;CronJob_VPNSecondaryLinkCleanUp.sh&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;This script will be executed by the Job called VPNSecondaryLinkCleanUp on Crontab to backup current VPNSecondaryLinkCleanUp.sh to save for historical purpose and run the current VPNSecondaryLinkCleanUp.sh to Clean Up the routing table every day.&lt;/P&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="664"&gt;
&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;#!/bin/bash -f&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;source /opt/CPshrd-R80.40/tmp/.CPprofile.sh&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;#Script Directory&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;DIR="/home/admin/VPNSecondaryLink"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;#User that will Execute the Scripts and Cron Job&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;EXECUSER="admin"&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;#Jump to Script Directory&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;cd $DIR&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;touch $DIR/VPNSecondaryLinkCleanUp.sh&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;if [ $(cat $DIR/VPNSecondaryLinkCleanUp.sh | wc -l ) -gt 0 ] ; then&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "Coping old VPNSecondaryLinkCleanUp to TMP Diretory for historical purpose"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;cp $DIR/VPNSecondaryLinkCleanUp.sh $DIR/tmp/VPNSecondaryLinkCleanUp-$(date +%s).txt&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "Executing VPNSecondaryLinkCleanUp.sh to CleanUp Routes"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;$DIR/VPNSecondaryLinkCleanUp.sh&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "Erasing Old VPNSecondaryLinkCleanUp.sh"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;gt; $DIR/VPNSecondaryLinkCleanUp.sh&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "Current VPNSecondaryLinkCleanUp.sh is already empty. No routes to be cleaned"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;fi&lt;/FONT&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A target="_blank" name="_Toc37824577"&gt;&lt;/A&gt;&lt;FONT size="5"&gt;&lt;STRONG&gt;Step by Step&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Copy the 3 (three) scripts to the Manager Server (SMS)&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thiago_Mourao_1-1586956223939.png" style="width: 400px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/5590i676D4050AB847965/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Thiago_Mourao_1-1586956223939.png" alt="Thiago_Mourao_1-1586956223939.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Change permission of “FirstTimeSetup.sh”&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thiago_Mourao_2-1586956223941.png" style="width: 400px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/5591i50BE5A72F785AC69/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Thiago_Mourao_2-1586956223941.png" alt="Thiago_Mourao_2-1586956223941.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;[Expert@Management:0]# chmod 760 FirstTimeSetup.sh&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;[Expert@Management:0]# ls –l FirstTimeSetup.sh&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Execute the “FirstTimeSetup.sh”&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thiago_Mourao_3-1586956223943.png" style="width: 400px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/5592iEC9397DF7F4BF90F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Thiago_Mourao_3-1586956223943.png" alt="Thiago_Mourao_3-1586956223943.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;[Expert@Management:0]# ./FirstTimeSetup.sh&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Check if CRON JOB was created&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thiago_Mourao_4-1586956223947.png" style="width: 400px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/5593iEF89C48C7E8CC30F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Thiago_Mourao_4-1586956223947.png" alt="Thiago_Mourao_4-1586956223947.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;[Expert@Management:0]# more /var/spool/cron/admin&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Create an Access Control Rule with the following pattern:&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;From:&lt;/STRONG&gt; &lt;EM&gt;ANY&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;To:&lt;/STRONG&gt; &lt;EM&gt;IP_of_the_Backup_Interface (My Example: 200.200.0.100)&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Services:&lt;/STRONG&gt; &lt;EM&gt;HTTP and HTTPS&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Action:&lt;/STRONG&gt; &lt;EM&gt;Permit&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Track:&lt;/STRONG&gt; &lt;EM&gt;Log / Alert:User Alert 1&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thiago_Mourao_5-1586956223952.png" style="width: 999px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/5594iD7174C53033A7CEA/image-size/large?v=v2&amp;amp;px=999" role="button" title="Thiago_Mourao_5-1586956223952.png" alt="Thiago_Mourao_5-1586956223952.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thiago_Mourao_6-1586956223952.png" style="width: 200px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/5595i47B05A3C4AAFD2BE/image-size/small?v=v2&amp;amp;px=200" role="button" title="Thiago_Mourao_6-1586956223952.png" alt="Thiago_Mourao_6-1586956223952.png" /&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thiago_Mourao_7-1586956223953.png" style="width: 200px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/5596iCA1DEEB4F71AC25B/image-size/small?v=v2&amp;amp;px=200" role="button" title="Thiago_Mourao_7-1586956223953.png" alt="Thiago_Mourao_7-1586956223953.png" /&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thiago_Mourao_8-1586956223953.png" style="width: 200px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/5597i5767B3AD7DF7C919/image-size/small?v=v2&amp;amp;px=200" role="button" title="Thiago_Mourao_8-1586956223953.png" alt="Thiago_Mourao_8-1586956223953.png" /&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thiago_Mourao_9-1586956223954.png" style="width: 200px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/5598i9152F2E08F584EA0/image-size/small?v=v2&amp;amp;px=200" role="button" title="Thiago_Mourao_9-1586956223954.png" alt="Thiago_Mourao_9-1586956223954.png" /&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thiago_Mourao_10-1586956223955.png" style="width: 200px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/5600i0F74D6D1C65CD756/image-size/small?v=v2&amp;amp;px=200" role="button" title="Thiago_Mourao_10-1586956223955.png" alt="Thiago_Mourao_10-1586956223955.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thiago_Mourao_11-1586956223955.png" style="width: 400px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/5599i2763F44D6430EA22/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Thiago_Mourao_11-1586956223955.png" alt="Thiago_Mourao_11-1586956223955.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thiago_Mourao_12-1586956223957.png" style="width: 400px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/5601i9B8B57D6B9DBACA2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Thiago_Mourao_12-1586956223957.png" alt="Thiago_Mourao_12-1586956223957.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;UL class="lia-list-style-type-disc"&gt;
&lt;LI&gt;Check the Alert Commands Parameters on &lt;STRONG&gt;Global Properties&lt;/STRONG&gt; → &lt;STRONG&gt;Log and Alert&lt;/STRONG&gt; → &lt;STRONG&gt;Alerts&lt;/STRONG&gt;:
&lt;UL&gt;
&lt;LI&gt;“Send user Defined alert no. 1 to SmartView Monitor”&lt;/LI&gt;
&lt;LI&gt;“Run UserDefined script”
&lt;UL&gt;
&lt;LI&gt;&lt;EM&gt;VPNSecondaryLink_alert &amp;gt;&amp;gt; /var/log/VPNSecondaryLink_alert.log 2&amp;gt;&amp;amp;1&amp;nbsp; &lt;/EM&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thiago_Mourao_13-1586956223963.png" style="width: 400px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/5602iC4A46DB52CBC4924/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Thiago_Mourao_13-1586956223963.png" alt="Thiago_Mourao_13-1586956223963.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Creating a VPN on Remote Client using IP from the non-default interface (Ex.: Eth1 – 200.200.0.100)&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thiago_Mourao_14-1586956223970.png" style="width: 400px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/5603i2D1B6F78853683A2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Thiago_Mourao_14-1586956223970.png" alt="Thiago_Mourao_14-1586956223970.png" /&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thiago_Mourao_15-1586956223977.png" style="width: 400px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/5604i0B5A60DD6E832272/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Thiago_Mourao_15-1586956223977.png" alt="Thiago_Mourao_15-1586956223977.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thiago_Mourao_16-1586956223982.png" style="width: 400px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/5606i869F7E81FF3FFFF2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Thiago_Mourao_16-1586956223982.png" alt="Thiago_Mourao_16-1586956223982.png" /&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thiago_Mourao_17-1586956223987.png" style="width: 400px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/5605i5CABBD038EF72445/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Thiago_Mourao_17-1586956223987.png" alt="Thiago_Mourao_17-1586956223987.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thiago_Mourao_18-1586956223992.png" style="width: 400px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/5607i4654258F9090B21E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Thiago_Mourao_18-1586956223992.png" alt="Thiago_Mourao_18-1586956223992.png" /&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thiago_Mourao_19-1586956224001.png" style="width: 400px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/5608iD97DD331CEE6BEDE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Thiago_Mourao_19-1586956224001.png" alt="Thiago_Mourao_19-1586956224001.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Connecting to the VPN&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thiago_Mourao_20-1586956224011.png" style="width: 400px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/5609iD11E1DABCB3F9898/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Thiago_Mourao_20-1586956224011.png" alt="Thiago_Mourao_20-1586956224011.png" /&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thiago_Mourao_21-1586956224018.png" style="width: 400px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/5610iED9372D3130604E3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Thiago_Mourao_21-1586956224018.png" alt="Thiago_Mourao_21-1586956224018.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Checking if Remote Client connected successfully and got Office Mode IP from the Pool&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thiago_Mourao_22-1586956224020.png" style="width: 400px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/5611iC775BBBE41E01E5B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Thiago_Mourao_22-1586956224020.png" alt="Thiago_Mourao_22-1586956224020.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Checking access to internal resource (Ex.: &lt;EM&gt;Ubuntu Server 01&lt;/EM&gt;)&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thiago_Mourao_23-1586956224045.png" style="width: 400px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/5612i90D7A1A94BBAC2B3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Thiago_Mourao_23-1586956224045.png" alt="Thiago_Mourao_23-1586956224045.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;&lt;EM&gt;PS: This page was created to check de IP address from Client&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;&lt;EM&gt;PPS: This is the server called&amp;nbsp;&lt;STRONG&gt;Ubuntu Server 01&lt;/STRONG&gt; and its private IP is &lt;STRONG&gt;10.100.0.101&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Checking on the&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;VPNSecondaryLink_alert.log&lt;/EM&gt;&lt;/STRONG&gt; file to see if the scripts are running&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thiago_Mourao_24-1586956224049.png" style="width: 400px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/5613iCFBB4A26BA32B745/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Thiago_Mourao_24-1586956224049.png" alt="Thiago_Mourao_24-1586956224049.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;[Expert@Management:0]# tail –f log/VPNSecondaryLink_Alert.log&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;&lt;EM&gt;PS: There is a symbolic link on $EXECDIR/log/&lt;/EM&gt; &lt;EM&gt;VPNSecondaryLink_alert.log. The original file was created on /var/log/VPNSecondaryLink_alert.log&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Checking the Behavior&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;You can see on &lt;EM&gt;fw monitor&lt;/EM&gt; output that VPN Client started to send packets to 200.200.0.100 that arrived on interface Eth1 and the gateway Gw-01 responded those packets through interface Eth0. Due to Stateful Inspection on route RT_101, packets were drop and never reach the VPN Client.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thiago_Mourao_25-1586956224054.png" style="width: 400px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/5614i0954CDABE093C3E8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Thiago_Mourao_25-1586956224054.png" alt="Thiago_Mourao_25-1586956224054.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;When the script run a static route is inserted and then packets from gateway Gw-01 to the IP 200.250.0.1 started to be routed through interface Eth1.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thiago_Mourao_26-1586956224056.png" style="width: 400px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/5615i52D9B9EEE276DF8D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Thiago_Mourao_26-1586956224056.png" alt="Thiago_Mourao_26-1586956224056.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;After responding to TCP 80 (HTTP), visitor mode could be reached creating the site on the VPN Client.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thiago_Mourao_27-1586956224059.png" style="width: 400px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/5616i989B728178DFDED2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Thiago_Mourao_27-1586956224059.png" alt="Thiago_Mourao_27-1586956224059.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Checking the new routing table on gateway&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thiago_Mourao_28-1586956224062.png" style="width: 400px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/5617i7B42ABFC7E41B2CA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Thiago_Mourao_28-1586956224062.png" alt="Thiago_Mourao_28-1586956224062.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;Gw-01&amp;gt; show configuration static-route&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Running the Clean Up Script (&lt;STRONG&gt;&lt;EM&gt;CronJob_VPNSecondaryLinkCleanUp.sh&lt;/EM&gt;&lt;/STRONG&gt;)&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thiago_Mourao_29-1586956224063.png" style="width: 400px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/5618i1838622D56AF3D58/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Thiago_Mourao_29-1586956224063.png" alt="Thiago_Mourao_29-1586956224063.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;[Expert@Management:0]# ./CronJob_VPNSecondaryLinkCleanUp.sh&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 24 Apr 2020 13:43:57 GMT</pubDate>
    <dc:creator>Thiago_Mourao</dc:creator>
    <dc:date>2020-04-24T13:43:57Z</dc:date>
    <item>
      <title>How to configure VPN Remote Access on non-default Internet Link</title>
      <link>https://community.checkpoint.com/t5/SASE-and-Remote-Access/How-to-configure-VPN-Remote-Access-on-non-default-Internet-Link/m-p/81991#M10664</link>
      <description>&lt;P&gt;Security Engineering Brazil&lt;/P&gt;
&lt;P&gt;April, 2020&lt;/P&gt;
&lt;P&gt;Version 02&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Author:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Thiago Mourao, SE and Cyber Security Evangelist&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Revision:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Henrique Moises, SE&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="5"&gt;Contents&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="#_Toc37824571" target="_blank" rel="noopener"&gt;How to configure VPN Remote Access on non-default Internet Link&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="#_Toc37824572" target="_blank" rel="noopener"&gt;Objective&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="#_Toc37824574" target="_blank" rel="noopener"&gt;Know Limitation and Requirements&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="#_Toc37824575" target="_blank" rel="noopener"&gt;Topology&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="#_Toc37824576" target="_blank" rel="noopener"&gt;Scripts&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="#_Toc37824577" target="_blank" rel="noopener"&gt;Step by Step&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="5"&gt;&lt;A target="_blank" name="_Toc37824572"&gt;&lt;/A&gt;&lt;STRONG&gt;Objective&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Configure Remote Access to respond for non-default Internet Link.&lt;/P&gt;
&lt;P&gt;As default configuration, when the first packet arrives from the non-default internet link, gateway will check its routing table and will reply those packets using the default route and after that the packets will be sent to the interface where the default route is configured. In many cases, those packets will be blocked by the next hop due to Out of State (SYN-ACK without SYN) or due to ingress routing filter that will check that the source do not belong to that route/network.&lt;/P&gt;
&lt;P&gt;PS: In a specific scenario this configuration might work with no further actions needed. In this scenario, the primary ISP link do not check Stateful Inspection or dot have Ingress Routing Filter to block spoofing/DDoS attacks, so in that case the security level is going to be lower, hence not recommended.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A target="_blank" name="_Toc37824574"&gt;&lt;/A&gt;&lt;FONT size="5"&gt;&lt;STRONG&gt;Know Limitation and Requirements&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;I have used static-route on this example instead of PBR that would be a more granular way to be done&lt;/LI&gt;
&lt;LI&gt;I have used a wrapper for cprid_util created by&amp;nbsp;&lt;a href="https://community.checkpoint.com/t5/user/viewprofilepage/user-id/21670"&gt;@HeikoAnkenbrand&lt;/a&gt;&amp;nbsp; (&lt;STRONG&gt;HeikoAnkenbrand&lt;/STRONG&gt;) on his article on Check Mates called “&lt;STRONG&gt;GAIA - Easy execute CLI commands from management on gateways&lt;/STRONG&gt;” (&lt;A href="https://community.checkpoint.com/t5/Enterprise-Appliances-and-Gaia/GAIA-Easy-execute-CLI-commands-from-management-on-gateways/m-p/50764/highlight/true#M3759" target="_blank" rel="noopener"&gt;https://community.checkpoint.com/t5/Enterprise-Appliances-and-Gaia/GAIA-Easy-execute-CLI-commands-from-management-on-gateways/m-p/50764/highlight/true#M3759&lt;/A&gt;) to execute command on gateway from the SMS&lt;/LI&gt;
&lt;LI&gt;For this PoC we assume that you already have configured a gateway with 2 (two) internet links where the first one is the default route and the second one is a backup link&lt;/LI&gt;
&lt;LI&gt;For this PoC we assume that you already configured Remote Access VPN (IPsec or Mobile Access) to respond with the IP of the secondary internet link&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="5"&gt;&lt;STRONG&gt;Topology&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;In this lab we are using R80.40 on both Security Gateway and Manager, and they were virtualized on VMware Workstation 12.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Virtual Environment:&lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;1 x Check Point Gateway R80.40&lt;/LI&gt;
&lt;LI&gt;1 x Check Point Manager R80.40&lt;/LI&gt;
&lt;LI&gt;1 x Microsoft Windows Server 2012 R2&lt;/LI&gt;
&lt;LI&gt;1 x Windows 7 Ultimate&lt;/LI&gt;
&lt;LI&gt;4 x Virtual Routers (VyOS)&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;Host Environment:&lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;1 x Notebook (Windows Professional) with VMWare Workstation 12&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;NAT:&lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;In this topology, Router &lt;STRONG&gt;RT_301&lt;/STRONG&gt; is doing source NAT &lt;STRONG&gt;FROM:&lt;/STRONG&gt; &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;192.168.250.1&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;TO:&lt;/STRONG&gt; &lt;FONT color="#339966"&gt;&lt;STRONG&gt;200.251.0.1&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Topology.png" style="width: 999px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/5619iD4AB8B060827A150/image-size/large?v=v2&amp;amp;px=999" role="button" title="Topology.png" alt="Topology.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;
&lt;P&gt;&lt;A target="_blank" name="_Toc37824576"&gt;&lt;/A&gt;&lt;STRONG&gt;&lt;FONT size="5"&gt;Scripts&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;FirstTimeSetup.sh&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;This script will prepare the environment to be run for the first time.&lt;/P&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="664"&gt;
&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;#!/bin/bash -f&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;source /opt/CPshrd-R80.40/tmp/.CPprofile.sh&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;#Script Directory&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;EXECDIR="/home/admin/VPNSecondaryLink"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;#User that will Execute the Scripts and Cron Job&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;EXECUSER="admin"&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "First time setup"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "Creating all files and Gaia configuration"&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "Creating Directories"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;mkdir $EXECDIR&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;mkdir $EXECDIR/log&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;mkdir $EXECDIR/tmp&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "Creating Files"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;touch $EXECDIR/CronJob_VPNSecondaryLinkCleanUp.sh&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;touch $EXECDIR/VPNSecondaryLinkCleanUp.sh&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;touch $EXECDIR/VPNSecondaryLink_alert.sh&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;touch $EXECDIR/log/CronJob_VPNSecondaryLinkCleanUp.sh.log&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;touch /var/log/VPNSecondaryLink_alert.log&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "Creating Symbolic Links"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;ln -s /var/log/VPNSecondaryLink_alert.log $EXECDIR/log/VPNSecondaryLink_alert.log&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;ln -s $EXECDIR/VPNSecondaryLink_alert.sh $FWDIR/bin/VPNSecondaryLink_alert&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "Copying Scripts to $EXECDIR"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;cp ./CronJob_VPNSecondaryLinkCleanUp.sh $EXECDIR/CronJob_VPNSecondaryLinkCleanUp.sh&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;cp ./VPNSecondaryLink_alert.sh $EXECDIR/VPNSecondaryLink_alert.sh&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "Changing Owner and Group" &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;chown $EXECUSER:bin $EXECDIR/CronJob_VPNSecondaryLinkCleanUp.sh&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;chown $EXECUSER:bin $EXECDIR/VPNSecondaryLink_alert.sh&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;chown $EXECUSER:bin $FWDIR/bin/VPNSecondaryLink_alert.sh&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo " Changing Permission"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;chmod 760 $EXECDIR/CronJob_VPNSecondaryLinkCleanUp.sh&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;chmod 760 $EXECDIR/VPNSecondaryLink_alert.sh&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;chmod 760 $FWDIR/bin/VPNSecondaryLink_alert.sh&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "Lock Database Override"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;clish -c "lock database override" &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "Adding Daily Based Recurrence for CronJob_VPNSecondaryLinkCleanUp at Cron Job to 2:00am"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;clish -c 'add cron job VPNSecondaryLinkCleanUp command "/home/admin/VPNSecondaryLink/CronJob_VPNSecondaryLinkCleanUp.sh &amp;gt;&amp;gt; /home/admin/VPNSecondaryLink/log/CronJob_VPNSecondaryLinkCleanUp.sh.log 2&amp;gt;&amp;amp;1" recurrence daily time 2:00'&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "Saving clish configuration"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;clish -c "save config"&lt;/FONT&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;VPNSecondaryLink_alert.sh&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;This Script will be called by the Track field of the &amp;nbsp;rule created in the SmartConsole, then the output is being parsed, creating the static route based on the source IP of the packet that hit the rule&lt;/P&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="664"&gt;
&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;#!/bin/bash -f&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;source /opt/CPshrd-R80.40/tmp/.CPprofile.sh&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;#Script Directory&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;DIR="/home/admin/VPNSecondaryLink"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;#User that will Execute the Scripts and Cron Job&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;EXECUSER="admin"&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;#Jump to Script Directory&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;cd $FWDIR/bin&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;#Global Variable&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;gateway_ip="10.0.50.100"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;secondary_gw="200.200.0.102"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;raw_pbr_error=0&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;error_msg1="Error: Object Name pattern founded on multiple Host Objects"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;error_msg2="Error: Static Route alreded configure"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;error_msg3="Error: Rule Name do not match"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;error_msg4="Error: Object not found on management Database"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;error_msg5="Error: Route Already Inserted on CleanUp Script"&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "#### Executing VPNSecondaryLink_alert at $(date -u) ####"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;[ $raw_pbr_error -gt 0 ] || {&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "Reading input from rule"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;read input&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;#echo "Troubleshooting enabled"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;#echo $input &amp;gt; $DIR/tmp/VPNSecondaryLink_alert_tr.log&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "Parsing Source Object Name"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "Checking if Source is using Object Name"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;raw_src_name=$(echo $input | sed -n 's/.* src: \(.*\); dst: .*/\1/p')&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;#echo "variavel raw_src_name=$raw_src_name"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "Checking if Source is using IP"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;raw_src_ip=$(echo "$input" | grep -o -P '.{0,5}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)' | grep src | sed -n 's/^src: \(.*\)/\1/p' )&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;#echo "variavel raw_src_ip=$raw_src_ip"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;firstocteto=$(echo "$raw_src_ip" | sed -n 's/\(^[[:digit:]]*\)\..*\..*\..*/\1/p')&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;#echo "variavel firstocteto=$firstocteto"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;if [ -z $firstocteto ] || [ $firstocteto -gt 223 ]; then&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "Cannot match with IP parsing... Trying to find IP on Management Object Database"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;raw_src_ip=$(mgmt_cli -r true show objects limit 2 offset 0 order.1.ASC "name" in.1 "name" in.2 "$raw_src_name" order.2.DESC "objId" type "host" --format json | jq '.objects[]."ipv4-address"')&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;if [ -z $raw_src_ip ] ; then&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo $error_msg4;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;raw_pbr_error=1;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;exit 1;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;elif [ $(echo "$raw_src_ip" | wc -l) -gt 1 ] ; then&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo $error_msg1;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;raw_pbr_error=1;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;exit 1;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "IP Founded"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;raw_src_ip=$(echo "$raw_src_ip"| tr -d \");&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "Source IP: $raw_src_ip"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;fi&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "IP has no object in Database, using IP from Log"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "Source IP: $raw_src_ip"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;fi&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "Parsing Destination Object Name"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;raw_dst_ip=$eth1&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "Destination IP: $raw_dst_ip"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "Check if Route already exist"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;if [ $(/usr/local/bin/g_cli 10.0.50.100 show configuration static-route | grep "$raw_src_ip" | wc -l) -gt 0 ] ; then&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo $error_msg2;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;raw_pbr_error=1;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;exit 0;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;touch $DIR/VPNSecondaryLinkCleanUp.sh&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;chmod +x $DIR/VPNSecondaryLinkCleanUp.sh&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "Creating Routing for $raw_src_ip/32"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;/usr/local/bin/g_cli $gateway_ip "set static-route $raw_src_ip/32 nexthop gateway address $secondary_gw on"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "Checking file VPNSecondaryLinkCleanUp.sh"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;if [ $(cat /tmp/VPNSecondaryLinkCleanUp.sh | grep $raw_src_ip | wc -l ) -gt 0 ] ; then&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo $error_msg5;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;raw_pbr_error=1;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;exit 1; &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "Adding new route to VPNSecondaryLinkCleanUp.sh"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "/usr/local/bin/g_cli $gateway_ip set static-route $raw_src_ip/32 off" &amp;gt;&amp;gt; $DIR/VPNSecondaryLinkCleanUp.sh&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;fi&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;fi&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "#### End of Execution of VPNSecondaryLink_alert at $(date -u) ####"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo -e '\n\n'&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;exit 1;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;}&lt;/FONT&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;CronJob_VPNSecondaryLinkCleanUp.sh&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;This script will be executed by the Job called VPNSecondaryLinkCleanUp on Crontab to backup current VPNSecondaryLinkCleanUp.sh to save for historical purpose and run the current VPNSecondaryLinkCleanUp.sh to Clean Up the routing table every day.&lt;/P&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="664"&gt;
&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;#!/bin/bash -f&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;source /opt/CPshrd-R80.40/tmp/.CPprofile.sh&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;#Script Directory&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;DIR="/home/admin/VPNSecondaryLink"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;#User that will Execute the Scripts and Cron Job&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;EXECUSER="admin"&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;#Jump to Script Directory&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;cd $DIR&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;touch $DIR/VPNSecondaryLinkCleanUp.sh&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;if [ $(cat $DIR/VPNSecondaryLinkCleanUp.sh | wc -l ) -gt 0 ] ; then&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "Coping old VPNSecondaryLinkCleanUp to TMP Diretory for historical purpose"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;cp $DIR/VPNSecondaryLinkCleanUp.sh $DIR/tmp/VPNSecondaryLinkCleanUp-$(date +%s).txt&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "Executing VPNSecondaryLinkCleanUp.sh to CleanUp Routes"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;$DIR/VPNSecondaryLinkCleanUp.sh&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "Erasing Old VPNSecondaryLinkCleanUp.sh"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;gt; $DIR/VPNSecondaryLinkCleanUp.sh&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;echo "Current VPNSecondaryLinkCleanUp.sh is already empty. No routes to be cleaned"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;fi&lt;/FONT&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A target="_blank" name="_Toc37824577"&gt;&lt;/A&gt;&lt;FONT size="5"&gt;&lt;STRONG&gt;Step by Step&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Copy the 3 (three) scripts to the Manager Server (SMS)&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thiago_Mourao_1-1586956223939.png" style="width: 400px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/5590i676D4050AB847965/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Thiago_Mourao_1-1586956223939.png" alt="Thiago_Mourao_1-1586956223939.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Change permission of “FirstTimeSetup.sh”&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thiago_Mourao_2-1586956223941.png" style="width: 400px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/5591i50BE5A72F785AC69/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Thiago_Mourao_2-1586956223941.png" alt="Thiago_Mourao_2-1586956223941.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;[Expert@Management:0]# chmod 760 FirstTimeSetup.sh&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;[Expert@Management:0]# ls –l FirstTimeSetup.sh&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Execute the “FirstTimeSetup.sh”&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thiago_Mourao_3-1586956223943.png" style="width: 400px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/5592iEC9397DF7F4BF90F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Thiago_Mourao_3-1586956223943.png" alt="Thiago_Mourao_3-1586956223943.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;[Expert@Management:0]# ./FirstTimeSetup.sh&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Check if CRON JOB was created&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thiago_Mourao_4-1586956223947.png" style="width: 400px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/5593iEF89C48C7E8CC30F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Thiago_Mourao_4-1586956223947.png" alt="Thiago_Mourao_4-1586956223947.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;[Expert@Management:0]# more /var/spool/cron/admin&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Create an Access Control Rule with the following pattern:&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;From:&lt;/STRONG&gt; &lt;EM&gt;ANY&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;To:&lt;/STRONG&gt; &lt;EM&gt;IP_of_the_Backup_Interface (My Example: 200.200.0.100)&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Services:&lt;/STRONG&gt; &lt;EM&gt;HTTP and HTTPS&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Action:&lt;/STRONG&gt; &lt;EM&gt;Permit&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Track:&lt;/STRONG&gt; &lt;EM&gt;Log / Alert:User Alert 1&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thiago_Mourao_5-1586956223952.png" style="width: 999px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/5594iD7174C53033A7CEA/image-size/large?v=v2&amp;amp;px=999" role="button" title="Thiago_Mourao_5-1586956223952.png" alt="Thiago_Mourao_5-1586956223952.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thiago_Mourao_6-1586956223952.png" style="width: 200px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/5595i47B05A3C4AAFD2BE/image-size/small?v=v2&amp;amp;px=200" role="button" title="Thiago_Mourao_6-1586956223952.png" alt="Thiago_Mourao_6-1586956223952.png" /&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thiago_Mourao_7-1586956223953.png" style="width: 200px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/5596iCA1DEEB4F71AC25B/image-size/small?v=v2&amp;amp;px=200" role="button" title="Thiago_Mourao_7-1586956223953.png" alt="Thiago_Mourao_7-1586956223953.png" /&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thiago_Mourao_8-1586956223953.png" style="width: 200px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/5597i5767B3AD7DF7C919/image-size/small?v=v2&amp;amp;px=200" role="button" title="Thiago_Mourao_8-1586956223953.png" alt="Thiago_Mourao_8-1586956223953.png" /&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thiago_Mourao_9-1586956223954.png" style="width: 200px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/5598i9152F2E08F584EA0/image-size/small?v=v2&amp;amp;px=200" role="button" title="Thiago_Mourao_9-1586956223954.png" alt="Thiago_Mourao_9-1586956223954.png" /&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thiago_Mourao_10-1586956223955.png" style="width: 200px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/5600i0F74D6D1C65CD756/image-size/small?v=v2&amp;amp;px=200" role="button" title="Thiago_Mourao_10-1586956223955.png" alt="Thiago_Mourao_10-1586956223955.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thiago_Mourao_11-1586956223955.png" style="width: 400px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/5599i2763F44D6430EA22/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Thiago_Mourao_11-1586956223955.png" alt="Thiago_Mourao_11-1586956223955.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thiago_Mourao_12-1586956223957.png" style="width: 400px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/5601i9B8B57D6B9DBACA2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Thiago_Mourao_12-1586956223957.png" alt="Thiago_Mourao_12-1586956223957.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;UL class="lia-list-style-type-disc"&gt;
&lt;LI&gt;Check the Alert Commands Parameters on &lt;STRONG&gt;Global Properties&lt;/STRONG&gt; → &lt;STRONG&gt;Log and Alert&lt;/STRONG&gt; → &lt;STRONG&gt;Alerts&lt;/STRONG&gt;:
&lt;UL&gt;
&lt;LI&gt;“Send user Defined alert no. 1 to SmartView Monitor”&lt;/LI&gt;
&lt;LI&gt;“Run UserDefined script”
&lt;UL&gt;
&lt;LI&gt;&lt;EM&gt;VPNSecondaryLink_alert &amp;gt;&amp;gt; /var/log/VPNSecondaryLink_alert.log 2&amp;gt;&amp;amp;1&amp;nbsp; &lt;/EM&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thiago_Mourao_13-1586956223963.png" style="width: 400px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/5602iC4A46DB52CBC4924/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Thiago_Mourao_13-1586956223963.png" alt="Thiago_Mourao_13-1586956223963.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Creating a VPN on Remote Client using IP from the non-default interface (Ex.: Eth1 – 200.200.0.100)&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thiago_Mourao_14-1586956223970.png" style="width: 400px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/5603i2D1B6F78853683A2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Thiago_Mourao_14-1586956223970.png" alt="Thiago_Mourao_14-1586956223970.png" /&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thiago_Mourao_15-1586956223977.png" style="width: 400px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/5604i0B5A60DD6E832272/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Thiago_Mourao_15-1586956223977.png" alt="Thiago_Mourao_15-1586956223977.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thiago_Mourao_16-1586956223982.png" style="width: 400px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/5606i869F7E81FF3FFFF2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Thiago_Mourao_16-1586956223982.png" alt="Thiago_Mourao_16-1586956223982.png" /&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thiago_Mourao_17-1586956223987.png" style="width: 400px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/5605i5CABBD038EF72445/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Thiago_Mourao_17-1586956223987.png" alt="Thiago_Mourao_17-1586956223987.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thiago_Mourao_18-1586956223992.png" style="width: 400px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/5607i4654258F9090B21E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Thiago_Mourao_18-1586956223992.png" alt="Thiago_Mourao_18-1586956223992.png" /&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thiago_Mourao_19-1586956224001.png" style="width: 400px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/5608iD97DD331CEE6BEDE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Thiago_Mourao_19-1586956224001.png" alt="Thiago_Mourao_19-1586956224001.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Connecting to the VPN&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thiago_Mourao_20-1586956224011.png" style="width: 400px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/5609iD11E1DABCB3F9898/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Thiago_Mourao_20-1586956224011.png" alt="Thiago_Mourao_20-1586956224011.png" /&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thiago_Mourao_21-1586956224018.png" style="width: 400px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/5610iED9372D3130604E3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Thiago_Mourao_21-1586956224018.png" alt="Thiago_Mourao_21-1586956224018.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Checking if Remote Client connected successfully and got Office Mode IP from the Pool&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thiago_Mourao_22-1586956224020.png" style="width: 400px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/5611iC775BBBE41E01E5B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Thiago_Mourao_22-1586956224020.png" alt="Thiago_Mourao_22-1586956224020.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Checking access to internal resource (Ex.: &lt;EM&gt;Ubuntu Server 01&lt;/EM&gt;)&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thiago_Mourao_23-1586956224045.png" style="width: 400px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/5612i90D7A1A94BBAC2B3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Thiago_Mourao_23-1586956224045.png" alt="Thiago_Mourao_23-1586956224045.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;&lt;EM&gt;PS: This page was created to check de IP address from Client&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;&lt;EM&gt;PPS: This is the server called&amp;nbsp;&lt;STRONG&gt;Ubuntu Server 01&lt;/STRONG&gt; and its private IP is &lt;STRONG&gt;10.100.0.101&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Checking on the&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;VPNSecondaryLink_alert.log&lt;/EM&gt;&lt;/STRONG&gt; file to see if the scripts are running&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thiago_Mourao_24-1586956224049.png" style="width: 400px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/5613iCFBB4A26BA32B745/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Thiago_Mourao_24-1586956224049.png" alt="Thiago_Mourao_24-1586956224049.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;[Expert@Management:0]# tail –f log/VPNSecondaryLink_Alert.log&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;&lt;EM&gt;PS: There is a symbolic link on $EXECDIR/log/&lt;/EM&gt; &lt;EM&gt;VPNSecondaryLink_alert.log. The original file was created on /var/log/VPNSecondaryLink_alert.log&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Checking the Behavior&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;You can see on &lt;EM&gt;fw monitor&lt;/EM&gt; output that VPN Client started to send packets to 200.200.0.100 that arrived on interface Eth1 and the gateway Gw-01 responded those packets through interface Eth0. Due to Stateful Inspection on route RT_101, packets were drop and never reach the VPN Client.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thiago_Mourao_25-1586956224054.png" style="width: 400px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/5614i0954CDABE093C3E8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Thiago_Mourao_25-1586956224054.png" alt="Thiago_Mourao_25-1586956224054.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;When the script run a static route is inserted and then packets from gateway Gw-01 to the IP 200.250.0.1 started to be routed through interface Eth1.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thiago_Mourao_26-1586956224056.png" style="width: 400px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/5615i52D9B9EEE276DF8D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Thiago_Mourao_26-1586956224056.png" alt="Thiago_Mourao_26-1586956224056.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;After responding to TCP 80 (HTTP), visitor mode could be reached creating the site on the VPN Client.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thiago_Mourao_27-1586956224059.png" style="width: 400px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/5616i989B728178DFDED2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Thiago_Mourao_27-1586956224059.png" alt="Thiago_Mourao_27-1586956224059.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Checking the new routing table on gateway&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thiago_Mourao_28-1586956224062.png" style="width: 400px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/5617i7B42ABFC7E41B2CA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Thiago_Mourao_28-1586956224062.png" alt="Thiago_Mourao_28-1586956224062.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;Gw-01&amp;gt; show configuration static-route&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Running the Clean Up Script (&lt;STRONG&gt;&lt;EM&gt;CronJob_VPNSecondaryLinkCleanUp.sh&lt;/EM&gt;&lt;/STRONG&gt;)&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thiago_Mourao_29-1586956224063.png" style="width: 400px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/5618i1838622D56AF3D58/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Thiago_Mourao_29-1586956224063.png" alt="Thiago_Mourao_29-1586956224063.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;[Expert@Management:0]# ./CronJob_VPNSecondaryLinkCleanUp.sh&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Apr 2020 13:43:57 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/SASE-and-Remote-Access/How-to-configure-VPN-Remote-Access-on-non-default-Internet-Link/m-p/81991#M10664</guid>
      <dc:creator>Thiago_Mourao</dc:creator>
      <dc:date>2020-04-24T13:43:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to configure VPN Remote Access on non-default Internet Link</title>
      <link>https://community.checkpoint.com/t5/SASE-and-Remote-Access/How-to-configure-VPN-Remote-Access-on-non-default-Internet-Link/m-p/82253#M10665</link>
      <description>&lt;P&gt;Great stuff,&amp;nbsp;&lt;a href="https://community.checkpoint.com/t5/user/viewprofilepage/user-id/4755"&gt;@Thiago_Mourao&lt;/a&gt;&amp;nbsp;! Well done!&lt;/P&gt;</description>
      <pubDate>Fri, 17 Apr 2020 14:58:43 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/SASE-and-Remote-Access/How-to-configure-VPN-Remote-Access-on-non-default-Internet-Link/m-p/82253#M10665</guid>
      <dc:creator>_Val_</dc:creator>
      <dc:date>2020-04-17T14:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to configure VPN Remote Access on non-default Internet Link</title>
      <link>https://community.checkpoint.com/t5/SASE-and-Remote-Access/How-to-configure-VPN-Remote-Access-on-non-default-Internet-Link/m-p/82255#M10666</link>
      <description>Thanks Loukine!</description>
      <pubDate>Fri, 17 Apr 2020 15:01:54 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/SASE-and-Remote-Access/How-to-configure-VPN-Remote-Access-on-non-default-Internet-Link/m-p/82255#M10666</guid>
      <dc:creator>Thiago_Mourao</dc:creator>
      <dc:date>2020-04-17T15:01:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to configure VPN Remote Access on non-default Internet Link</title>
      <link>https://community.checkpoint.com/t5/SASE-and-Remote-Access/How-to-configure-VPN-Remote-Access-on-non-default-Internet-Link/m-p/83647#M10667</link>
      <description>&lt;P&gt;Could Policy-Based Routing be used to accomplish the same goal?&lt;/P&gt;</description>
      <pubDate>Wed, 29 Apr 2020 17:36:45 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/SASE-and-Remote-Access/How-to-configure-VPN-Remote-Access-on-non-default-Internet-Link/m-p/83647#M10667</guid>
      <dc:creator>Braden_Bersik</dc:creator>
      <dc:date>2020-04-29T17:36:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to configure VPN Remote Access on non-default Internet Link</title>
      <link>https://community.checkpoint.com/t5/SASE-and-Remote-Access/How-to-configure-VPN-Remote-Access-on-non-default-Internet-Link/m-p/108870#M10668</link>
      <description>&lt;P&gt;There is limitation between PBR and Remote Access VPN/S2S VPN...&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2021 12:57:29 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/SASE-and-Remote-Access/How-to-configure-VPN-Remote-Access-on-non-default-Internet-Link/m-p/108870#M10668</guid>
      <dc:creator>KostasGR</dc:creator>
      <dc:date>2021-01-26T12:57:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to configure VPN Remote Access on non-default Internet Link</title>
      <link>https://community.checkpoint.com/t5/SASE-and-Remote-Access/How-to-configure-VPN-Remote-Access-on-non-default-Internet-Link/m-p/172928#M10669</link>
      <description>&lt;P&gt;Thank you for this nice set of scripts + documentation!&lt;/P&gt;&lt;P&gt;I found some flaws:&lt;BR /&gt;a) all provided scripts are not FW version independent:&amp;nbsp; use /opt/CPshared/5.0/tmp/.CPprofile.sh to&amp;nbsp; source the environment variables&lt;BR /&gt;b)&amp;nbsp;FirstTimeSetup.sh : in this script you create a symbolic link to&amp;nbsp;$FWDIR/bin/VPNSecondaryLink_alert&lt;BR /&gt;&amp;nbsp; &amp;nbsp; but later on you&amp;nbsp; refer&amp;nbsp; to&amp;nbsp;$FWDIR/bin/VPNSecondaryLink_alert&lt;STRONG&gt;.sh &lt;/STRONG&gt;( see lines with "chown" and "chmod")&lt;/P&gt;&lt;P&gt;c) /usr/local/bin/g_cli (from Wolfgang) does not find all gateway IPs (line range too narrow with grep, Fix: use "grep -A 25"&amp;nbsp; )&lt;/P&gt;&lt;P&gt;d) there is no hint about ISP redundancy feature - typically customers are using this feature, too - when having two ISP links.&lt;/P&gt;&lt;P&gt;An additional objective for this subject is ,that users have only 1 VPN RA site created, but if the primary IP/link goes down, it should use the second link ( failover to the secondary link automatically) - like MEP is working, (when having more than 1 GW )&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2023 01:42:13 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/SASE-and-Remote-Access/How-to-configure-VPN-Remote-Access-on-non-default-Internet-Link/m-p/172928#M10669</guid>
      <dc:creator>Martin_Hofbauer</dc:creator>
      <dc:date>2023-02-28T01:42:13Z</dc:date>
    </item>
  </channel>
</rss>

