How to bring interface up from pfsense commandline?
-
Hi all,
I think i have a simple question.
How can I bring up an interface from the pfsense commandline?I tried:
[2.0.1-RELEASE][root@firewall]/(74): php ./status_interfaces.php?action=Connect&if=opt1
But that doesn't work.
Who can help me?thanks,
Bas -
Why?
If the interface has already been enabled in the web GUI it should come "up" automatically if it sees carrier from the interface on the other end of the cable. Maybe you have a cable fault.
-
Why?
If the interface has already been enabled in the web GUI it should come "up" automatically if it sees carrier from the interface on the other end of the cable. Maybe you have a cable fault.
It's for my UMTS 3G modem. Once in a while it disconnects itself, and pfsense is not able to bring it up again.
If i then disconnect and connect again, the ppp-connection is up again.and i want to automate that via the command interface (cron-job or so)
-
It's for my UMTS 3G modem. Once in a while it disconnects itself, and pfsense is not able to bring it up again.
You mean pfSense doesn't automatically recover? Have you tried the Disconnect and Reconnect buttons in the appropriate interface section of the Status -> Interfaces page?
If i then disconnect and connect again, the ppp-connection is up again.
By "disconnect and connect again" do you mean "remove the modem from USB connector and reinsert"? If not, what do you mean?
and i want to automate that via the command interface (cron-job or so)
You'll run a crob job every few minutes to stop/start ppp on the modem?
-
maybe you could try some command like this in your crontab file:
/sbin/ifconfig ppp0 | /usr/bin/egrep '10.[12].*' || /sbin/ifconfig ppp0 up >/dev/null 2>&1ramaramadingding
-
I don't think it will work using ifconfig directly.
Try using:/etc/rc.linkup opt1 start
Steve
-
I have modified Steve's solution as follows and it works on [2.2.2-RELEASE]:
/etc/rc.linkup interface=opt1 action=start
Matt
-