<?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 Re: Disable interface and kill its sessions by schedule... in General Topics</title>
    <link>https://live.paloaltonetworks.com/t5/general-topics/disable-interface-and-kill-its-sessions-by-schedule/m-p/456541#M101731</link>
    <description>&lt;P&gt;Thank you for the post&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/12561"&gt;@LCMember4427&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You mentioned about creating a scheduler for the security policy, but your concern is how to clear already established sessions. I would assume that "&lt;STRONG&gt;Rematch Sessions&lt;/STRONG&gt;" under:&lt;STRONG&gt; Device &amp;gt; Setup &amp;gt; Sessions &amp;gt; Session Setting&lt;/STRONG&gt;, will match new policy to deny that traffic after you enable/disable security rule you mentioned in your post.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If policy&amp;nbsp;"Rematch Sessions" will not take an effect, then as a next thing, I would try to follow this KB to leverage API against System/Configuration log:&amp;nbsp;&lt;A href="https://knowledgebase.paloaltonetworks.com/KCSArticleDetail?id=kA14u000000HBmqCAG" target="_blank"&gt;https://knowledgebase.paloaltonetworks.com/KCSArticleDetail?id=kA14u000000HBmqCAG&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I assume that once, security policy is enabled/disabled by scheduler, there will be a system or configuration log. Note down string of the log that is being generated and use it in Step No.4, then in Step No.6/7 use: "&amp;lt;clear&amp;gt;&amp;lt;session&amp;gt;&amp;lt;all&amp;gt;&amp;lt;filter&amp;gt;from DormsNetZone". I think you can follow that KB as it is. Follow steps 1 and 2, skip step: 3, in step 4 look for corresponding log, follow step 5 (Only use right API call to clear sessions), follow step 6 (Only use right filter), follow step 7.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the above is not right solution, you can always create an API script, for example below and run it as a scheduled task from server with schedule for example 1 minute after scheduler takes action for your security policy.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;A href="https://firewall/api/?type=op&amp;amp;cmd=" target="_blank"&gt;https://firewall/api/?type=op&amp;amp;cmd=&lt;/A&gt;&amp;lt;clear&amp;gt;&amp;lt;session&amp;gt;&amp;lt;all&amp;gt;&amp;lt;filter&amp;gt;from DormsNetZone&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;Pavel&lt;/P&gt;</description>
    <pubDate>Mon, 03 Jan 2022 23:06:23 GMT</pubDate>
    <dc:creator>PavelK</dc:creator>
    <dc:date>2022-01-03T23:06:23Z</dc:date>
    <item>
      <title>Disable interface and kill its sessions by schedule...</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/disable-interface-and-kill-its-sessions-by-schedule/m-p/456388#M101713</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;This is a boarding school situation.&amp;nbsp; By mutual agreement we close internet access to the dorms from midnight to 6AM.&amp;nbsp; Several years ago we tried to control the DormsNetZone rules by a schedule.&amp;nbsp; However as this didn't kill the active sessions it was of little use for us.&amp;nbsp; Now we interrupt the AC power to the DormsNet distribution switch to achieve a complete closedown of this network zone.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However it would be far more elegant and not so brutal to control this with our VM-100 features.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can set a schedule from midnight to 6AM on the rules and do a "clear session all filter from DormsNetZone" from CLI but the latter must be done manually as I'm aware of no cron features in the CLI...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I assume that it would be no use to create a scheduled DENY ALL rule from DormsNetZone to UnTrust during the nights either....&lt;BR /&gt;&lt;BR /&gt;Any suggestion on how to automatically 'disable an interface' in PanOS governed by a schedule is highly appreciated&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jan 2022 12:35:40 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/disable-interface-and-kill-its-sessions-by-schedule/m-p/456388#M101713</guid>
      <dc:creator>LCMember4427</dc:creator>
      <dc:date>2022-01-03T12:35:40Z</dc:date>
    </item>
    <item>
      <title>Re: Disable interface and kill its sessions by schedule...</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/disable-interface-and-kill-its-sessions-by-schedule/m-p/456424#M101717</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;You can setup a schedule to do what you want on a policy. This way you can set a policy "&lt;SPAN&gt;DENY ALL rule from DormsNetZone to UnTrust during the night" and have it enable during the time frame you want.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jan 2022 16:55:13 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/disable-interface-and-kill-its-sessions-by-schedule/m-p/456424#M101717</guid>
      <dc:creator>OtakarKlier</dc:creator>
      <dc:date>2022-01-03T16:55:13Z</dc:date>
    </item>
    <item>
      <title>Re: Disable interface and kill its sessions by schedule...</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/disable-interface-and-kill-its-sessions-by-schedule/m-p/456538#M101730</link>
      <description>&lt;P&gt;Hey &lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/12561"&gt;@LCMember4427&lt;/a&gt; ,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That is interesting situation. However I am not sure that&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/27580"&gt;@OtakarKlier&lt;/a&gt; suggestion, for creating "deny all" rule somewhere at the top with schedule, would work. I don't have rich experience with schedules, but at the bottom of &lt;A href="https://knowledgebase.paloaltonetworks.com/KCSArticleDetail?id=kA10g000000CmAxCAK" target="_self"&gt;this link&lt;/A&gt; is mentioned that sessions that are created before the schedule start are not affected (same reason why your schedule on allow rule, does not close the existing sessions).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have you consider using the firewall build-in API function? API allows you to send any command (that you can execute locally on the firewall), by automated script running on remote host. You can write a script that tells the firewall to either shutdown interface, or enable previously disabled "deny all" rule and commit all those changes. Then you can put the script somewhere to be executed automatically by schedule.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jan 2022 23:05:06 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/disable-interface-and-kill-its-sessions-by-schedule/m-p/456538#M101730</guid>
      <dc:creator>aleksandar.astardzhiev</dc:creator>
      <dc:date>2022-01-03T23:05:06Z</dc:date>
    </item>
    <item>
      <title>Re: Disable interface and kill its sessions by schedule...</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/disable-interface-and-kill-its-sessions-by-schedule/m-p/456541#M101731</link>
      <description>&lt;P&gt;Thank you for the post&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/12561"&gt;@LCMember4427&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You mentioned about creating a scheduler for the security policy, but your concern is how to clear already established sessions. I would assume that "&lt;STRONG&gt;Rematch Sessions&lt;/STRONG&gt;" under:&lt;STRONG&gt; Device &amp;gt; Setup &amp;gt; Sessions &amp;gt; Session Setting&lt;/STRONG&gt;, will match new policy to deny that traffic after you enable/disable security rule you mentioned in your post.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If policy&amp;nbsp;"Rematch Sessions" will not take an effect, then as a next thing, I would try to follow this KB to leverage API against System/Configuration log:&amp;nbsp;&lt;A href="https://knowledgebase.paloaltonetworks.com/KCSArticleDetail?id=kA14u000000HBmqCAG" target="_blank"&gt;https://knowledgebase.paloaltonetworks.com/KCSArticleDetail?id=kA14u000000HBmqCAG&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I assume that once, security policy is enabled/disabled by scheduler, there will be a system or configuration log. Note down string of the log that is being generated and use it in Step No.4, then in Step No.6/7 use: "&amp;lt;clear&amp;gt;&amp;lt;session&amp;gt;&amp;lt;all&amp;gt;&amp;lt;filter&amp;gt;from DormsNetZone". I think you can follow that KB as it is. Follow steps 1 and 2, skip step: 3, in step 4 look for corresponding log, follow step 5 (Only use right API call to clear sessions), follow step 6 (Only use right filter), follow step 7.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the above is not right solution, you can always create an API script, for example below and run it as a scheduled task from server with schedule for example 1 minute after scheduler takes action for your security policy.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;A href="https://firewall/api/?type=op&amp;amp;cmd=" target="_blank"&gt;https://firewall/api/?type=op&amp;amp;cmd=&lt;/A&gt;&amp;lt;clear&amp;gt;&amp;lt;session&amp;gt;&amp;lt;all&amp;gt;&amp;lt;filter&amp;gt;from DormsNetZone&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;Pavel&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jan 2022 23:06:23 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/disable-interface-and-kill-its-sessions-by-schedule/m-p/456541#M101731</guid>
      <dc:creator>PavelK</dc:creator>
      <dc:date>2022-01-03T23:06:23Z</dc:date>
    </item>
    <item>
      <title>Re: Disable interface and kill its sessions by schedule...</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/disable-interface-and-kill-its-sessions-by-schedule/m-p/456553#M101733</link>
      <description>&lt;P&gt;Either way I would use the API and a Python/Powershell script running on via Cron or a scheduled task if using Windows to accomplish this. I'd create the scheduled deny entry at the top of your rulebase as&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/27580"&gt;@OtakarKlier&lt;/a&gt;&amp;nbsp;mentioned previously. Then simply schedule the script to issue the following via the api.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;https://$firewall/api/?type=op&amp;amp;cmd=&amp;lt;clear&amp;gt;&amp;lt;session&amp;gt;&amp;lt;all&amp;gt;&amp;lt;filter&amp;gt;&amp;lt;from&amp;gt;$zone&amp;lt;/from&amp;gt;&amp;lt;/filter&amp;gt;&amp;lt;/all&amp;gt;&amp;lt;/session&amp;gt;&amp;lt;/clear&amp;gt;&amp;amp;key=$key&lt;/LI-CODE&gt;
&lt;P&gt;Replace the $firewall with your MGMT IP, $zone with&amp;nbsp;&lt;SPAN&gt;DormsNetZone to match your source zone, and $key with your API and schedule the script. This will allow the schedule to work as intended and clear all previously allowed traffic so any ongoing sessions are closed and hit the scheduled Deny rule.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jan 2022 23:18:50 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/disable-interface-and-kill-its-sessions-by-schedule/m-p/456553#M101733</guid>
      <dc:creator>BPry</dc:creator>
      <dc:date>2022-01-03T23:18:50Z</dc:date>
    </item>
    <item>
      <title>Re: Disable interface and kill its sessions by schedule...</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/disable-interface-and-kill-its-sessions-by-schedule/m-p/1238537#M125201</link>
      <description>&lt;P&gt;I have achieved this function using policy based forwarding. I have created a schedule for when I want the internet for a specific zone to be disabled. Basically every evening at the scheduled time the policy goes into effect and routes to a black hole address and all traffic immediately stops from that zone. No CLI, no Session Clearing, no scripts. Just my kids groaning that the internet has stopped working after whatever game starts to hang.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. Create a black hole interface.&lt;/P&gt;
&lt;P&gt;2. Create a schedule of when you want the network to stop working.&lt;/P&gt;
&lt;P&gt;3. Create a Policy Based Forwarding rule.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;a. Specify source zone.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;b. Specify black hole interface.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;c. apply schedule.&lt;/P&gt;
&lt;P&gt;4. Test&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I know this thread is old, hopefully this helps someone in the future.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Sep 2025 17:21:49 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/disable-interface-and-kill-its-sessions-by-schedule/m-p/1238537#M125201</guid>
      <dc:creator>jtemple</dc:creator>
      <dc:date>2025-09-22T17:21:49Z</dc:date>
    </item>
  </channel>
</rss>

