Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR]: Switch of pppoe connection #139

Closed
pickonedev opened this issue May 30, 2024 · 10 comments · Fixed by #276
Closed

[FR]: Switch of pppoe connection #139

pickonedev opened this issue May 30, 2024 · 10 comments · Fixed by #276
Labels
feature request Request for a new feature or enhancement question Further information is requested

Comments

@pickonedev
Copy link

pickonedev commented May 30, 2024

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 with ifconfig wan down/up as well, becaise it is not changing the external IP

Thank you!

@alexdelprete alexdelprete changed the title Feature: Switch of pppoe connection [FR]: Switch of pppoe connection Sep 7, 2024
@Snuffy2 Snuffy2 added the feature request Request for a new feature or enhancement label Sep 8, 2024
@Snuffy2
Copy link
Collaborator

Snuffy2 commented Sep 24, 2024

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.

@Snuffy2 Snuffy2 added the question Further information is requested label Sep 30, 2024
@alexdelprete
Copy link
Collaborator

alexdelprete commented Oct 12, 2024

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.

image

@alexdelprete
Copy link
Collaborator

I checked, and I think this is the relevant API function:

image

@pickonedev
Copy link
Author

pickonedev commented Oct 13, 2024

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.

image

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

@alexdelprete
Copy link
Collaborator

alexdelprete commented Oct 13, 2024

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.

@pickonedev
Copy link
Author

Yes, it does it very quick. That reload button works very good.

@pickonedev
Copy link
Author

pickonedev commented Oct 13, 2024

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?

@alexdelprete
Copy link
Collaborator

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.

@pickonedev
Copy link
Author

I have done it in the intergration as well, and it is working, like this:

image

But yes, it will be great if Snuffy2 could integrate it directly 🥇

Thank you for everything, it is WOOOOOOORKING 🥇

@alexdelprete
Copy link
Collaborator

alexdelprete commented Oct 13, 2024

No problem. We can close the issue.

UPDATE: I'll keep it open since @Snuffy2 might want to track it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Request for a new feature or enhancement question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants