-
Notifications
You must be signed in to change notification settings - Fork 326
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
Add hooks for when link goes up and down #986
Conversation
When the link has been established optionally run a supplied 'up-hook' and when it goes down run 'down-hook'. Allows simple interaction with other subsystems, in my case reconfiguring proxies.
I'm using ppp's if-up and if-down scripts for this purpose. What would be the advantage of this? |
How do you do that? |
That said, I think it might be worth setting routing and DNS in a separate script called by openfortivpn, ideally vpnc-scripts. When needed, it can be replaced by alternate scripts such as vpn-slice or a custom script. We would get IPv6 support and better DNS as a bonus. I just don't have the time to change openfortivpn myself these days. |
Yeah, if-up and if-down do this, so lets abandon this. |
@pschichtel omitting the details, can you share your scripts that set up DNS with the pppd hooks? |
@Tatsh that's my /etc/ppp/ip-up.d/* script #!/bin/bash
routes=(...)
dns_servers=(...)
search_domains=(...)
resolvectl dns "$1" "${dns_servers[@]}"
resolvectl domain "$1" "${search_domains[@]}"
for route in "${routes[@]}"
do
ip route add "$route" dev "$1"
done |
So all your routes and DNS etc are static and known beforehand? I would like to make the same kind of thing but I want to get it from the VPN. |
When the link has been established optionally run a supplied 'up-hook'
and when it goes down run 'down-hook'.
Allows simple interaction with other subsystems, in my case
reconfiguring proxies.