Open pickonedev opened 4 months ago
How do you do this via the OPNsense Web page? I don't use PPPOE so I'm not sure what the options there look like.
How do you do this via the OPNsense Web page? I don't use PPPOE so I'm not sure what the options there look like.
If @pickonedev means a "restart", I do reload of the PPPoE interface, that actually drops the current session and restarts a fresh one. I do it manually via the Interface Overview reload button, but I didn't check if there's an API call for that.
I checked, and I think this is the relevant API function:
How do you do this via the OPNsense Web page? I don't use PPPOE so I'm not sure what the options there look like.
If @pickonedev means a "restart", I do reload of the PPPoE interface, that actually drops the current session and restarts a fresh one. I do it manually via the Interface Overview reload button, but I didn't check if there's an API call for that.
This is fast, I didn't know about this restart button from Interface Overview :-O. But, there is any commnd line which can achieve the same fast result, from putty?
Edit: Oh, now I have read your second post. Now I need to know how to use API with opnsense :-D
But, there is any commnd line which can achieve the same fast result, from putty?
IDK, but you can search in OPNsense community forum. Meanwhile, did you test the reload to see if it does what you need?
Anyway, there's the API function for that, so it can be implemented in this integration as an action.
Yes, it does it very quick. That reload button works very good.
I think I found a way to use the api. It is working with this:
curl -k -u "keys" "https://192.168.0.1/api/interfaces/overview/reloadinterface/wan"
If you know any improvement to this shell command, it will be even better :-)
This is even faster than using the button
Edit: by the way, there is any shell command to achieve this reloadinterface function (to implement it in the home assistant addon)? Or I can just use curl locally, inside opnsense as a curl command? Is it right to do so?
You're calling the REST API function I mentioned previously, good that it works fine. :)
Now you just need to wait for @Snuffy2 to implement it and then you can call the action in HA as with all other actions (once known as "services").
The integration doesn't use shell commands, it integrates an http client to call the REST API that OPNsense provides.
I have done it in the intergration as well, and it is working, like this:
But yes, it will be great if Snuffy2 could integrate it directly 🥇
Thank you for everything, it is WOOOOOOORKING 🥇
No problem. We can close the issue.
UPDATE: I'll keep it open since @Snuffy2 might want to track it.
There is any chance to implement a switch for pppoe connection?
It would be great for keeping attackers away everytime they try someting, Like, connect/disconnect, in order for the dynamic external IP to get changed.
But something not through
service netif restart
because it is a very slow process… I better restart the router, it is faster. And not withifconfig wan down/up
as well, becaise it is not changing the external IPThank you!