Interface Timer Suggestion?
-
You could probably achieve that by setting ppp to9 dial-on-demand and using a scheduled firewall rule to prevent demand whenever you don't want/need it.
Steve
-
Thanks guys, I should point out that im using a ethernet upstream gateway which is my internet gateway, which is the 4G router and does not support bridge mode.
Not sure if this makes a difference.
-
One other possibility is to get an ordinary timer and a 5 port switch. Place the switch between pfsense and your connection and have the timer turn it on & off as needed.
-
@jknott yea I did think of this, more of a AC power timer plug or something, would be much easier and cleaner if I could control the actual interface itself.
-
As I mentioned, shell scripts will do it. I haven't done much with scripts on BSD, but I have on Linux. You can have a script run at the appropriate time and use the ifconfig command to enable or disable the interface.
-
@jknott great thanks for the reply.
So using the Cron plugin, I would just issue commands as I would in Linux? Do they need to be run as root?
So a Cron job to run at desired time/interval
ifconfig ue0 down
Can I also issue other commands like this such as reboot and shutdown 0 etc?
Thanks
-
Yes, no and yes!
Just make sure to use the full path to the command. The user Cron runs as does not have the same paths as admin/root.
Personally I would look at using scheduled firewall rules and dial on demand though. It's a 'cleaner' solution if it works for you. All contained in the main config.
Steve
-
@stephenw10 Ok I have tested the commands in the command prompt, entered the commands and executed them and they worked fine. Tested
ifconfig ue0 down
ifconfig ue0 up
rebootall commands worked fine in command prompt, should I still use relative paths in cron?
Ideally, would like to figure out why pfSense keeps crashing.
Thanks
-
Cron is the usual method for time related activities. It runs as root and use the full path from /.
-
@deanfourie said in Interface Timer Suggestion?:
should I still use relative paths in cron?
Yes, use the full path. That's the most common reason custom cron jobs fail. The cron user does not have the same paths as root which is what the command prompt runs as.
Steve