clowwindy / ShadowVPN

Removed according to regulations.
1.47k stars 1.06k forks source link

fix ip route add error #149

Closed rains31 closed 9 years ago

rains31 commented 9 years ago

route add will not work when there are multiple default routes, we should choose the one who has the minimum metric. % ip route show 0/0 default via 10.11.0.254 dev lan0 metric 203 default via 10.11.0.254 dev wlan0 metric 302

clowwindy commented 9 years ago

@everyone

Please try if this command shows the default route on your machine or router.

ip route show 0/0 | sort -k 7 | head -n 1 | sed -e 's/.* via \([^ ]*\).*/\1/'
aa65535 commented 9 years ago

passed

clowwindy commented 9 years ago

Merged, thanks!