<?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 Como configurar VPN para acesso remoto no link secundário de Internet in Português</title>
    <link>https://community.checkpoint.com/t5/Portugu%C3%AAs/Como-configurar-VPN-para-acesso-remoto-no-link-secund%C3%A1rio-de/m-p/81994#M14</link>
    <description>&lt;P&gt;Security Engineering Brazil&lt;/P&gt;
&lt;P&gt;Abril, 2020&lt;/P&gt;
&lt;P&gt;Version 01&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Autor:&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;Revisão:&lt;/STRONG&gt;&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="#_Toc37824572" target="_blank" rel="noopener"&gt;Objetivo&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="#_Toc37824574" target="_blank" rel="noopener"&gt;Limitações e Requisitos&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="#_Toc37824575" target="_blank" rel="noopener"&gt;Topologia&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;Passo-a-Passo&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;Objetivo&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Configurar o Acesso Remoto para responder pelo link não padrão de Internet (link secundário).&lt;/P&gt;
&lt;P&gt;Como configuração padrão, quando os primeiros pacotes chegarem através do link de internet não padrão (link secundário), o gateway verificará sua tabela de roteamento e responderá esses pacotes usando a rota padrão, ou seja,&amp;nbsp; o gateway responderá estes pacotes através da interface cuja qual a rota padrão está configurada e, em muitos casos, estes pacotes serão bloqueados pelo próximo salto devido a inspeção &lt;EM&gt;Stateful Inspection&lt;/EM&gt; (SYN-ACK sem SYN) ou devido ao filtro de roteamento de entrada (&lt;EM&gt;Ingress Routing Filter&lt;/EM&gt;) que verificará que a origem não pertence a essa rota/rede.&lt;/P&gt;
&lt;P&gt;OBS: Em alguns casos, essa configuração pode funcionar se o ISP do link primário não realizar Stateful Inspection ou o ISP não tiver um filtro de roteamento de entrada para bloquear ataques de spoofing e/ou Negação de Serviço (DoS/DDoS).&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;Limitações e Requisitos&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Eu usei rota estática neste exemplo ao em vez de PBR que poderia ser muito mais granular&lt;/LI&gt;
&lt;LI&gt;Eu usei uma ferramenta escrita encima do recurso cprid_util criado pelo &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;) no artigo que ele escreveu aqui na comunidade do CheckMates chamado “&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;) para executar comandos nos gateways a partir da gerência (SMS)&lt;/LI&gt;
&lt;LI&gt;Para este PoC, assumimos que você já configurou um gateway com 2 (dois) links da Internet, onde o primeiro é a rota padrão e o segundo é um link de backup&lt;/LI&gt;
&lt;LI&gt;Para este PoC, assumimos que você já configurou a VPN para acesso remoto (IPsec ou Mobile Access) para responder com o IP do link secundário de Internet&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;Topologia&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Em nosso laboratório, estamos usando o GloudGuard VE (&lt;/SPAN&gt;&lt;EM&gt;Virtual Edition&lt;/EM&gt;&lt;SPAN&gt;) na R80.40 tanto no Security Gateway quanto na Manager e o VMware Workstation 12 como plataforma de virtualização.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Ambiente Virtual:&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 Roteadores Virtuais (VyOS)&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;Ambiente Físico do Hospedeiro:&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;Nesta topologia, o roteador &lt;STRONG&gt;RT_301&lt;/STRONG&gt; está executando o &lt;STRONG&gt;NAT de origem&lt;/STRONG&gt; &lt;STRONG&gt;DE&lt;/STRONG&gt;: &lt;FONT color="#FF0000"&gt;192.168.250.1&lt;/FONT&gt; &lt;STRONG&gt;PARA&lt;/STRONG&gt;: &lt;FONT color="#339966"&gt;200.251.0.1&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;Este script irá preparar o ambiente pela primeira vez (First Time Wizard).&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;Este script será chamado pelo campo "Track" da regra, irá analisar a saída (&lt;EM&gt;log output&lt;/EM&gt;) e irá criar a rota estática com base no IP de origem do tráfego que bateu na regra&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;Esse script será chamado pelo "Job", chamado &lt;EM&gt;&lt;STRONG&gt;VPNSecondaryLinkCleanUp&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp;do &lt;EM&gt;Crontab&lt;/EM&gt; para fazer backup do &lt;EM&gt;&lt;STRONG&gt;VPNSecondaryLinkCleanUp.sh&lt;/STRONG&gt;&lt;/EM&gt; atual para salvar esta informação para fins de histórico e executar o &lt;EM&gt;&lt;STRONG&gt;VPNSecondaryLinkCleanUp.sh&lt;/STRONG&gt;&lt;/EM&gt; atual para limpar a tabela de roteamento ao menos 1 vez por dia.&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;Passo-a-Passo&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Copie os 3 (três) scripts para o Servidor de Gerência (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;Altere a permissão de execução do script “&lt;EM&gt;&lt;STRONG&gt;FirstTimeSetup.sh&lt;/STRONG&gt;&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_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;UL&gt;
&lt;LI&gt;Execute o script “&lt;EM&gt;&lt;STRONG&gt;FirstTimeSetup.sh&lt;/STRONG&gt;&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_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;UL&gt;
&lt;LI&gt;Verifique se o CRON JOB foi criado&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;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;&amp;nbsp;IP_da_Interface_do_link_de_backup/secundário_da_Internet&amp;nbsp;&lt;EM&gt;(No nosso caso: 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;Verifique os parâmetros dos comandos de alerta (&lt;EM&gt;Alert Commands&lt;/EM&gt;) em&amp;nbsp;&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;Selecione “Send user Defined alert no. 1 to SmartView Monitor”&lt;/LI&gt;
&lt;LI&gt;Selecione “Run UserDefined script”
&lt;UL&gt;
&lt;LI&gt;&lt;EM&gt;Configure o parâmetro para invocar o script: &lt;STRONG&gt;VPNSecondaryLink_alert &amp;gt;&amp;gt; /var/log/VPNSecondaryLink_alert.log 2&amp;gt;&amp;amp;1&lt;/STRONG&gt;&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;Criando uma VPN no Cliente Remoto usando IP da interface não padrão (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;Conectando à 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;Verificando se o Cliente Remoto se conectou com êxito e obteve um IP reservado do "&lt;EM&gt;&lt;STRONG&gt;Office Mode&lt;/STRONG&gt;&lt;/EM&gt;"&amp;nbsp;&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;Verificando o Acesso ao Recurso Interno (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;OBS 1: Eu criei esta página para verificar o IP de origem do cliente&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;&lt;EM&gt;OBS 2: Esta é o servidor "&lt;STRONG&gt;Ubuntu Server 01&lt;/STRONG&gt;" e seu IP privado é &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;Verificando no arquivo "&lt;EM&gt;&lt;STRONG&gt;VPNSecondaryLink_alert.log&lt;/STRONG&gt;&lt;/EM&gt;" para ver se os scripts executaram como o esperado e/ou identificar possíveis erros na execução&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 size="2"&gt;&lt;EM&gt;OBS: Existe um link simbólico &lt;STRONG&gt;$EXECDIR/log/VPNSecondaryLink_alert.log&lt;/STRONG&gt;. O arquivo original foi criado em&lt;/EM&gt;&lt;EM&gt;&amp;nbsp;&lt;STRONG&gt;/var/log/VPNSecondaryLink_alert.log&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Verificando o comportamento da VPN&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Você pode ver na saída do comando &lt;EM&gt;&lt;STRONG&gt;fw monitor&lt;/STRONG&gt;&lt;/EM&gt; que o Cliente VPN começou a enviar pacotes para 200.200.0.100 que chegaram na interface Eth1 e o gateway Gw-01 responde esses pacotes através da interface Eth0. Devido à inspeção &lt;EM&gt;Stateful Inspection&lt;/EM&gt; no roteador &lt;STRONG&gt;RT_101&lt;/STRONG&gt;, os pacotes foram descartados e nunca chegaram ao cliente VPN.&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;Depois, após a execução do script e a rota estática ser inserida, os pacotes do gateway Gw-01 para o IP &lt;STRONG&gt;200.250.0.1&lt;/STRONG&gt; começaram a ser roteados pela 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 respond to TCP 80 (HTTP), then visitor mode could be reached and site were created on 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 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;UL&gt;
&lt;LI&gt;Running the Clean Up Scrip (&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;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 24 Apr 2020 13:41:39 GMT</pubDate>
    <dc:creator>Thiago_Mourao</dc:creator>
    <dc:date>2020-04-24T13:41:39Z</dc:date>
    <item>
      <title>Como configurar VPN para acesso remoto no link secundário de Internet</title>
      <link>https://community.checkpoint.com/t5/Portugu%C3%AAs/Como-configurar-VPN-para-acesso-remoto-no-link-secund%C3%A1rio-de/m-p/81994#M14</link>
      <description>&lt;P&gt;Security Engineering Brazil&lt;/P&gt;
&lt;P&gt;Abril, 2020&lt;/P&gt;
&lt;P&gt;Version 01&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Autor:&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;Revisão:&lt;/STRONG&gt;&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="#_Toc37824572" target="_blank" rel="noopener"&gt;Objetivo&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="#_Toc37824574" target="_blank" rel="noopener"&gt;Limitações e Requisitos&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="#_Toc37824575" target="_blank" rel="noopener"&gt;Topologia&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;Passo-a-Passo&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;Objetivo&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Configurar o Acesso Remoto para responder pelo link não padrão de Internet (link secundário).&lt;/P&gt;
&lt;P&gt;Como configuração padrão, quando os primeiros pacotes chegarem através do link de internet não padrão (link secundário), o gateway verificará sua tabela de roteamento e responderá esses pacotes usando a rota padrão, ou seja,&amp;nbsp; o gateway responderá estes pacotes através da interface cuja qual a rota padrão está configurada e, em muitos casos, estes pacotes serão bloqueados pelo próximo salto devido a inspeção &lt;EM&gt;Stateful Inspection&lt;/EM&gt; (SYN-ACK sem SYN) ou devido ao filtro de roteamento de entrada (&lt;EM&gt;Ingress Routing Filter&lt;/EM&gt;) que verificará que a origem não pertence a essa rota/rede.&lt;/P&gt;
&lt;P&gt;OBS: Em alguns casos, essa configuração pode funcionar se o ISP do link primário não realizar Stateful Inspection ou o ISP não tiver um filtro de roteamento de entrada para bloquear ataques de spoofing e/ou Negação de Serviço (DoS/DDoS).&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;Limitações e Requisitos&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Eu usei rota estática neste exemplo ao em vez de PBR que poderia ser muito mais granular&lt;/LI&gt;
&lt;LI&gt;Eu usei uma ferramenta escrita encima do recurso cprid_util criado pelo &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;) no artigo que ele escreveu aqui na comunidade do CheckMates chamado “&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;) para executar comandos nos gateways a partir da gerência (SMS)&lt;/LI&gt;
&lt;LI&gt;Para este PoC, assumimos que você já configurou um gateway com 2 (dois) links da Internet, onde o primeiro é a rota padrão e o segundo é um link de backup&lt;/LI&gt;
&lt;LI&gt;Para este PoC, assumimos que você já configurou a VPN para acesso remoto (IPsec ou Mobile Access) para responder com o IP do link secundário de Internet&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;Topologia&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Em nosso laboratório, estamos usando o GloudGuard VE (&lt;/SPAN&gt;&lt;EM&gt;Virtual Edition&lt;/EM&gt;&lt;SPAN&gt;) na R80.40 tanto no Security Gateway quanto na Manager e o VMware Workstation 12 como plataforma de virtualização.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Ambiente Virtual:&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 Roteadores Virtuais (VyOS)&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;Ambiente Físico do Hospedeiro:&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;Nesta topologia, o roteador &lt;STRONG&gt;RT_301&lt;/STRONG&gt; está executando o &lt;STRONG&gt;NAT de origem&lt;/STRONG&gt; &lt;STRONG&gt;DE&lt;/STRONG&gt;: &lt;FONT color="#FF0000"&gt;192.168.250.1&lt;/FONT&gt; &lt;STRONG&gt;PARA&lt;/STRONG&gt;: &lt;FONT color="#339966"&gt;200.251.0.1&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;Este script irá preparar o ambiente pela primeira vez (First Time Wizard).&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;Este script será chamado pelo campo "Track" da regra, irá analisar a saída (&lt;EM&gt;log output&lt;/EM&gt;) e irá criar a rota estática com base no IP de origem do tráfego que bateu na regra&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;Esse script será chamado pelo "Job", chamado &lt;EM&gt;&lt;STRONG&gt;VPNSecondaryLinkCleanUp&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp;do &lt;EM&gt;Crontab&lt;/EM&gt; para fazer backup do &lt;EM&gt;&lt;STRONG&gt;VPNSecondaryLinkCleanUp.sh&lt;/STRONG&gt;&lt;/EM&gt; atual para salvar esta informação para fins de histórico e executar o &lt;EM&gt;&lt;STRONG&gt;VPNSecondaryLinkCleanUp.sh&lt;/STRONG&gt;&lt;/EM&gt; atual para limpar a tabela de roteamento ao menos 1 vez por dia.&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;Passo-a-Passo&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Copie os 3 (três) scripts para o Servidor de Gerência (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;Altere a permissão de execução do script “&lt;EM&gt;&lt;STRONG&gt;FirstTimeSetup.sh&lt;/STRONG&gt;&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_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;UL&gt;
&lt;LI&gt;Execute o script “&lt;EM&gt;&lt;STRONG&gt;FirstTimeSetup.sh&lt;/STRONG&gt;&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_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;UL&gt;
&lt;LI&gt;Verifique se o CRON JOB foi criado&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;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;&amp;nbsp;IP_da_Interface_do_link_de_backup/secundário_da_Internet&amp;nbsp;&lt;EM&gt;(No nosso caso: 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;Verifique os parâmetros dos comandos de alerta (&lt;EM&gt;Alert Commands&lt;/EM&gt;) em&amp;nbsp;&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;Selecione “Send user Defined alert no. 1 to SmartView Monitor”&lt;/LI&gt;
&lt;LI&gt;Selecione “Run UserDefined script”
&lt;UL&gt;
&lt;LI&gt;&lt;EM&gt;Configure o parâmetro para invocar o script: &lt;STRONG&gt;VPNSecondaryLink_alert &amp;gt;&amp;gt; /var/log/VPNSecondaryLink_alert.log 2&amp;gt;&amp;amp;1&lt;/STRONG&gt;&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;Criando uma VPN no Cliente Remoto usando IP da interface não padrão (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;Conectando à 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;Verificando se o Cliente Remoto se conectou com êxito e obteve um IP reservado do "&lt;EM&gt;&lt;STRONG&gt;Office Mode&lt;/STRONG&gt;&lt;/EM&gt;"&amp;nbsp;&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;Verificando o Acesso ao Recurso Interno (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;OBS 1: Eu criei esta página para verificar o IP de origem do cliente&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;&lt;EM&gt;OBS 2: Esta é o servidor "&lt;STRONG&gt;Ubuntu Server 01&lt;/STRONG&gt;" e seu IP privado é &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;Verificando no arquivo "&lt;EM&gt;&lt;STRONG&gt;VPNSecondaryLink_alert.log&lt;/STRONG&gt;&lt;/EM&gt;" para ver se os scripts executaram como o esperado e/ou identificar possíveis erros na execução&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 size="2"&gt;&lt;EM&gt;OBS: Existe um link simbólico &lt;STRONG&gt;$EXECDIR/log/VPNSecondaryLink_alert.log&lt;/STRONG&gt;. O arquivo original foi criado em&lt;/EM&gt;&lt;EM&gt;&amp;nbsp;&lt;STRONG&gt;/var/log/VPNSecondaryLink_alert.log&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Verificando o comportamento da VPN&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Você pode ver na saída do comando &lt;EM&gt;&lt;STRONG&gt;fw monitor&lt;/STRONG&gt;&lt;/EM&gt; que o Cliente VPN começou a enviar pacotes para 200.200.0.100 que chegaram na interface Eth1 e o gateway Gw-01 responde esses pacotes através da interface Eth0. Devido à inspeção &lt;EM&gt;Stateful Inspection&lt;/EM&gt; no roteador &lt;STRONG&gt;RT_101&lt;/STRONG&gt;, os pacotes foram descartados e nunca chegaram ao cliente VPN.&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;Depois, após a execução do script e a rota estática ser inserida, os pacotes do gateway Gw-01 para o IP &lt;STRONG&gt;200.250.0.1&lt;/STRONG&gt; começaram a ser roteados pela 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 respond to TCP 80 (HTTP), then visitor mode could be reached and site were created on 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 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;UL&gt;
&lt;LI&gt;Running the Clean Up Scrip (&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Apr 2020 13:41:39 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Portugu%C3%AAs/Como-configurar-VPN-para-acesso-remoto-no-link-secund%C3%A1rio-de/m-p/81994#M14</guid>
      <dc:creator>Thiago_Mourao</dc:creator>
      <dc:date>2020-04-24T13:41:39Z</dc:date>
    </item>
  </channel>
</rss>

