From bb0f9934f6bbe61be5fe497a9f1ad9da021ce6d0 Mon Sep 17 00:00:00 2001 From: littleguga Date: Fri, 24 Jun 2016 02:10:25 +0300 Subject: [PATCH 1/3] add uninstall instructions --- docs/uninstall.md | 61 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 docs/uninstall.md diff --git a/docs/uninstall.md b/docs/uninstall.md new file mode 100644 index 0000000..1af60c0 --- /dev/null +++ b/docs/uninstall.md @@ -0,0 +1,61 @@ +# Uninstall IPsec/L2TP VPN + +To remove the VPN: + +## First step +``` +service ipsec stop +service xl2tpd stop +rm -rf /usr/local/sbin/ipsec /usr/local/libexec/ipsec +rm -f /etc/init.d/ipsec /lib/systemd/system/ipsec.service +rm -rf /opt/src/libreswan-* +``` + +## Second step + +### For Ubuntu/Debian: + +`apt-get remove xl2tpd` + +### For CentOS/RHEL: + +`yum remove xl2tpd` + +## Third step + +### For Ubuntu/Debian: + +Edit `/etc/iptables.rules` and remove unneeded rules. +Your original rules (if any) are backed up as `/etc/iptables.rules.old-date-time`. +In addition, edit `/etc/iptables/rules.v4` if the file exists. +If using IPv6, also edit `/etc/ip6tables.rules` and `/etc/iptables/rules.v6`. + +### For CentOS/RHEL: + +Edit `/etc/sysconfig/iptables` and `/etc/sysconfig/ip6tables` + +## Fourth step + +Edit `/etc/sysctl.conf` and remove the lines after `# Added by hwdsl2 VPN script` + +Edit `/etc/rc.local` and remove the lines after `# Added by hwdsl2 VPN script`, *except exit 0 (if any)* + +## Optional + +Remove these config files: +* /etc/ipsec.conf +* /etc/ipsec.secrets +* /etc/xl2tpd/xl2tpd.conf +* /etc/ppp/options.xl2tpd +* /etc/ppp/chap-secrets +* /etc/ipsec.d/* +* /etc/pam.d/pluto +* /etc/sysconfig/pluto + +copy && paste for fast remove: + +`sudo rm -f /etc/ipsec.conf /etc/ipsec.secrets /etc/xl2tpd/xl2tpd.conf /etc/ppp/options.xl2tpd /etc/ppp/chap-secrets /etc/ipsec.d/* /etc/pam.d/pluto /etc/sysconfig/pluto` + +## When finished + +Reboot your server. From fe22af4d9d8777130442ea8f5368670ed496a81e Mon Sep 17 00:00:00 2001 From: littleguga Date: Fri, 24 Jun 2016 02:13:28 +0300 Subject: [PATCH 2/3] add link to uninstall guide --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a44945d..7aea1cc 100644 --- a/README.md +++ b/README.md @@ -115,6 +115,7 @@ The additional scripts ## See Also - [IPsec VPN Server on Docker](https://github.com/hwdsl2/docker-ipsec-vpn-server) +- [For uninstallation see this](/docs/uninstall.md) ## Author From f12457d70318874b45d11d1950d448ad9e01e898 Mon Sep 17 00:00:00 2001 From: littleguga Date: Fri, 24 Jun 2016 02:16:01 +0300 Subject: [PATCH 3/3] add table of content --- docs/uninstall.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/uninstall.md b/docs/uninstall.md index 1af60c0..4c059fd 100644 --- a/docs/uninstall.md +++ b/docs/uninstall.md @@ -2,6 +2,15 @@ To remove the VPN: +## Steps + +* [First step](#first-step) +* [Second step](#second-step) +* [Third step](#third-step) +* [Fourth step](#fourth-step) +* [Optional](#optional) +* [When finished](#when-finished) + ## First step ``` service ipsec stop