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

FS#2867 - proto_add_host_dependency inject wrong route to wrong gateway #7650

Open
openwrt-bot opened this issue Feb 28, 2020 · 2 comments
Open
Labels

Comments

@openwrt-bot
Copy link

morzexxx:

Every time when any interface that using proto_add_host_dependency function (PPTP, L2TP, 6in4) comes up the system automatically adds route for VPN server. That's nice, but the problem is that the function does not realy alalyze the routing table. It uses first default gateway. This causes serious errors in configurations with a complex routing table or multi-wan configurations. it is necessary to refine this function so that it analyzes the routing table and all routes and also the metrics and adds a route to the real gateway for this host, not only first defalt gateway.

@openwrt-bot
Copy link
Author

yogo1212:

i've encountered that problem as well.

my "solution" was to add an option to specify the uplink using uci.
downside is that you'll have to change the netifd-proto files.
see the attached example ("uplink network").

if you're interested, we could work out something more sophisticated using netifd.
i'm up for some programming ;-)

@openwrt-bot
Copy link
Author

champtar:

Just hit the same issue

default via 192.168.14.1 dev wanmaison1 proto static metric 10
default via 192.168.21.1 dev wancamp1 proto static metric 20
default via 192.168.20.1 dev wancave proto static metric 60
...
1.2.3.4 via 192.168.21.1 dev wancamp1 proto static metric 20

where 1.2.3.4 is the vpn endpoint

The only way to find the correct interfaces is to use ip r get or equivalent netlink call before setting up the vpn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant