1
0
mirror of synced 2024-12-02 01:26:03 +03:00
setup-ipsec-vpn/docs/uninstall.md

79 lines
1.8 KiB
Markdown
Raw Normal View History

# Uninstall the VPN
2016-06-24 02:10:25 +03:00
*Read this in other languages: [English](uninstall.md), [简体中文](uninstall-zh.md).*
Follow these steps to remove the VPN. Commands must be run as `root`, or with `sudo`.
2016-06-24 02:10:25 +03:00
2016-06-24 02:16:01 +03:00
## Steps
* [First step](#first-step)
* [Second step](#second-step)
* [Third step](#third-step)
* [Fourth step](#fourth-step)
* [Optional](#optional)
* [When finished](#when-finished)
2016-06-24 02:10:25 +03:00
## First step
2016-06-24 02:10:25 +03:00
```
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
```
## Second step
### Ubuntu/Debian
2016-06-24 02:10:25 +03:00
`apt-get remove xl2tpd`
### CentOS/RHEL
2016-06-24 02:10:25 +03:00
`yum remove xl2tpd`
## Third step
### Ubuntu/Debian
2016-06-24 02:10:25 +03:00
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.
2016-06-24 02:10:25 +03:00
### CentOS/RHEL
2016-06-24 02:10:25 +03:00
Edit `/etc/sysconfig/iptables` and remove unneeded rules.
2016-06-25 04:42:57 +03:00
Your original rules (if any) are backed up as `/etc/sysconfig/iptables.old-date-time`.
2016-06-24 02:10:25 +03:00
## Fourth step
Edit `/etc/sysctl.conf` and remove the lines after `# Added by hwdsl2 VPN script`.
2016-06-25 04:42:57 +03:00
Edit `/etc/rc.local` and remove the lines after `# Added by hwdsl2 VPN script`. DO NOT remove `exit 0` (if any).
2016-06-24 02:10:25 +03:00
## Optional
2016-06-25 04:42:57 +03:00
Note: This step is optional.
2016-06-24 02:10:25 +03:00
Remove these config files:
2016-06-24 02:10:25 +03:00
* /etc/ipsec.conf
* /etc/ipsec.secrets
* /etc/xl2tpd/xl2tpd.conf
* /etc/ppp/options.xl2tpd
* /etc/ppp/chap-secrets
* /etc/pam.d/pluto
* /etc/sysconfig/pluto
2016-06-25 04:42:57 +03:00
* /etc/ipsec.d (directory)
2016-06-24 02:10:25 +03:00
Copy and paste for fast removal:
2016-06-25 04:42:57 +03:00
```
rm -f /etc/ipsec.conf /etc/ipsec.secrets /etc/xl2tpd/xl2tpd.conf /etc/ppp/options.xl2tpd \
/etc/ppp/chap-secrets /etc/pam.d/pluto /etc/sysconfig/pluto
rm -rf /etc/ipsec.d
```
2016-06-24 02:10:25 +03:00
## When finished
Reboot your server.