make a cron job for secureNat

Post your questions about SoftEther VPN software here. Please answer questions if you can afford.
Post Reply
EayanSct
Posts: 3
Joined: Sat Jan 07, 2023 1:23 pm

make a cron job for secureNat

Post by EayanSct » Sat Jan 07, 2023 1:34 pm

hello!
thank you for helping me to how to make a cron job for SecureNatEnable && SecureNatDisable ?

shakibamoshiri
Posts: 285
Joined: Wed Dec 28, 2022 9:10 pm

Re: make a cron job for secureNat

Post by shakibamoshiri » 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?

EayanSct
Posts: 3
Joined: Sat Jan 07, 2023 1:23 pm

Re: make a cron job for secureNat

Post by EayanSct » Sat Jan 07, 2023 11:21 pm

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!

solo
Posts: 1228
Joined: Sun Feb 14, 2021 10:31 am

Re: make a cron job for secureNat

Post by solo » 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

EayanSct
Posts: 3
Joined: Sat Jan 07, 2023 1:23 pm

Re: make a cron job for secureNat

Post by EayanSct » Sun Jan 08, 2023 4:52 am

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!

Post Reply