carsonip / cuhk-cse-vpn-ubuntu-scripts

9 stars 2 forks source link

Remove device before and after #1

Closed secure12 closed 6 years ago

secure12 commented 6 years ago

Currently the scripts do not remove device ppp0 after running vpn_disconnect.sh or the VPN accidentally goes down. After which sending "c connect" to l2tp-control will result in creation of new devices ppp* (ppp1, ppp2, so on). The VPN will then fail as it uses outdated device ppp0. Removing device ppp0 before start sending "c connect" to l2tp-control and at end of vpn_disconnect.sh solves the issues.

carsonip commented 6 years ago

Thanks for the PR. I cannot test this out already but I think your fix makes sense.