Page 1 of 1
make a cron job for secureNat
Posted: Sat Jan 07, 2023 1:34 pm
by EayanSct
hello!
thank you for helping me to how to make a cron job for SecureNatEnable && SecureNatDisable ?
Re: make a cron job for secureNat
Posted: Sat Jan 07, 2023 7:50 pm
by shakibamoshiri
EayanSct wrote: ↑Sat Jan 07, 2023 1:34 pm
hello!
thank you for helping me to how to make a cron job for SecureNatEnable && SecureNatDisable ?
Hi and welcome
What do you mean by "cron job" ?
Secure NAT is a one time configuration. You enable it and you are done.
Cron jobs are for repetitively doing something over and over again.
What do you want to get/achieve configuring a cron job?
Re: make a cron job for secureNat
Posted: Sat Jan 07, 2023 11:21 pm
by EayanSct
shakibamoshiri wrote: ↑Sat Jan 07, 2023 7:50 pm
EayanSct wrote: ↑Sat Jan 07, 2023 1:34 pm
hello!
thank you for helping me to how to make a cron job for SecureNatEnable && SecureNatDisable ?
Hi and welcome
What do you mean by "cron job" ?
Secure NAT is a one time configuration. You enable it and you are done.
Cron jobs are for repetitively doing something over and over again.
What do you want to get/achieve configuring a cron job?
thank you!
because of filtering and **great firewall** that is running in country of my ppl ; I have to do this manually to reconnect to the server, which is why I thought maybe i can set up a cron job for enable & disable secureNat!
Re: make a cron job for secureNat
Posted: Sun Jan 08, 2023 2:37 am
by solo
nano /etc/crontab
Code: Select all
11 1 * * * root /usr/local/vpnserver/vpncmd localhost:port /server /password:&&& /adminhub:@@@ /cmd SecureNatDisable
1 11 * * * root /usr/local/vpnserver/vpncmd localhost:port /server /password:&&& /adminhub:@@@ /cmd SecureNatEnable
# replace: &&& with SE admin password; @@@ with VPN hub's name
# alt...
#.../cmd Offline
#.../cmd Online
Re: make a cron job for secureNat
Posted: Sun Jan 08, 2023 4:52 am
by EayanSct
solo wrote: ↑Sun Jan 08, 2023 2:37 am
nano /etc/crontab
Code: Select all
11 1 * * * root /usr/local/vpnserver/vpncmd localhost:port /server /password:&&& /adminhub:@@@ /cmd SecureNatDisable
1 11 * * * root /usr/local/vpnserver/vpncmd localhost:port /server /password:&&& /adminhub:@@@ /cmd SecureNatEnable
# replace: &&& with SE admin password; @@@ with VPN hub's name
# alt...
#.../cmd Offline
#.../cmd Online
thank you so much for the codes!
it works perfectly!