CPUG

The Check Point User Group

A Resource For The Check Point Community.  Fast.  Useful.  Independent.

1. CCSA/CCSE One-Week Dual-Certification Training Course with CPUG in San Francisco!
    Courses Starting 12/8, (2009) 1/19, 2/9, 3/9, 4/6, 5/4, 6/8, 7/6, 8/3.
2. Join Us On LinkedIn - We now have a CPUG group.


Go Back   CPUG: The Check Point User Group > Check Point Firewall-1/VPN-1 Platforms > Check Point SecurePlatform (SPLAT)
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 2006-05-31
Member
 
Join Date: 2006-02-17
Posts: 69
Rep Power: 3
stephan411 has an average reputation (10+)
Default delete SA and IKE priodly

Hallo,

it is possible that I can delete SA and IKE priodly such as by a cron job or by a script. I know that I mus use vpn tu to delete SA and IKE. But how can I work with the parameters 1 to 8?

Thank you,
Stephan
Reply With Quote
  #2 (permalink)  
Old 2006-05-31
Senior Member
 
Join Date: 2006-01-26
Location: Moscow, Russia
Posts: 706
Rep Power: 3
kva.kva has an average reputation (10+)
Default Re: delete SA and IKE priodly

https://secureknowledge.checkpoint.c....do?id=skI2004

If you want it, you can use fw tab -t table_name -x
table_name:
To delete IKE SAs, delete the IKE_SA_table.
To delete IPSEC SAs, delete the inbound_SPI table and the outbound_SPI table.

If you want cron script, use next syntax in it:
#!/bin/bash
fw tab -t IKE_SA_table -x <<EOC
yes
EOC
Reply With Quote
  #3 (permalink)  
Old 2006-05-31
Member
 
Join Date: 2006-02-17
Posts: 69
Rep Power: 3
stephan411 has an average reputation (10+)
Default Re: delete SA and IKE priodly

Thank you for your answer.

What does EOC means? And what does especialy >> EOC means?

Stephan
Reply With Quote
  #4 (permalink)  
Old 2006-05-31
Senior Member
 
Join Date: 2006-01-26
Location: Moscow, Russia
Posts: 706
Rep Power: 3
kva.kva has an average reputation (10+)
Default Re: delete SA and IKE priodly

EOC is a mark. << is "here document"

From Advanced Bash−Scripting Guide (very useful doc - http://tldp.org/LDP/abs/html/)

A "here document" is a special−purpose code block. It uses a form of I/O redirection to feed a command list to an interactive program or a command, such as ftp, cat, or the ex text editor.

COMMAND <<InputComesFromHERE
...
InputComesFromHERE

A limit string delineates (frames) the command list. The special symbol << designates the limit string. This has the effect of redirecting the output of a file into the stdin of the program or command. It is similar to

interactive-program < command−file, where command−file contains
command #1
command #2
...

The "here document" alternative looks like this:

#!/bin/bash
interactive−program <<LimitString
command #1
command #2
...
LimitString

Choose a limit string sufficiently unusual that it will not occur anywhere in the command list and confuse matters.
Note that here documents may sometimes be used to good effect with non−interactive utilities and commands.
Reply With Quote
  #5 (permalink)  
Old 2006-06-01
Member
 
Join Date: 2006-02-17
Posts: 69
Rep Power: 3
stephan411 has an average reputation (10+)
Default Re: delete SA and IKE priodly

Hi,

does this also work?

#!/bin/bash
fw tab -t IKE_SA_table -x
yes


Thank you,
Stephan
Reply With Quote
  #6 (permalink)  
Old 2006-06-01
Senior Member
 
Join Date: 2006-01-26
Location: Moscow, Russia
Posts: 706
Rep Power: 3
kva.kva has an average reputation (10+)
Default Re: delete SA and IKE priodly

No, you code will not work.
In your example yes is second command after first, isn't answer for 1'st command's question.
Reply With Quote
  #7 (permalink)  
Old 2006-06-01
Junior Member
 
Join Date: 2006-05-20
Posts: 28
Rep Power: 0
fdamstra has an average reputation (10+)
Default Re: delete SA and IKE priodly

In the "there's more than one way to do it" category, you could also do:
#! /bin/bash
echo yes | fw tab -t IKE_SA_table -x
Which to me is a bit clearer, provided you understand that the '|' character means "Send the output of this command to this other command."
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT -7. The time now is 06:47.


Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0