hello!
thank you for helping me to how to make a cron job for SecureNatEnable && SecureNatDisable ?
make a cron job for secureNat
-
- Posts: 288
- Joined: Wed Dec 28, 2022 9:10 pm
Re: make a cron job for secureNat
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?
-
- Posts: 3
- Joined: Sat Jan 07, 2023 1:23 pm
Re: make a cron job for secureNat
thank you!shakibamoshiri wrote: ↑Sat Jan 07, 2023 7:50 pmHi 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?
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!
-
- Posts: 1270
- Joined: Sun Feb 14, 2021 10:31 am
Re: make a cron job for secureNat
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
-
- Posts: 3
- Joined: Sat Jan 07, 2023 1:23 pm
Re: make a cron job for secureNat
thank you so much for the codes!solo wrote: ↑Sun Jan 08, 2023 2:37 amnano /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
it works perfectly!