Commit Graph

314 Commits

Author SHA1 Message Date
hwdsl2
365d87d577 Improve VPN setup
- Install package libcrypt-dev on Ubuntu/Debian, and package
  libxcrypt-devel on CentOS 8+, which are needed for Libreswan
  compilation. This change fixes VPN setup on Ubuntu 26.04.
2026-04-25 21:55:17 -05:00
hwdsl2
5414cdfb71 Improve IPv6 setup
- Use a /116 subnet (4096 addresses) for IPv6.
- Set IPv6 forwarding in rc.local, in addition to sysctl.conf.
  In some cases, setting it in sysctl.conf may not work reliably.
2026-03-20 01:42:03 -05:00
hwdsl2
b02d196ad2 Improve IPv6 check 2026-03-18 22:14:04 -05:00
hwdsl2
8167d54c44 Add IPv6 support
- Add initial IPv6 support for IKEv2 mode. For VPN servers with
  a public (global unicast) IPv6 address, IPv6 support for
  IKEv2 clients is automatically enabled during VPN setup.
- Currently tested on Android using the strongSwan VPN client.
  Other platforms (e.g. Windows, macOS, iOS) may have limitations
  or require additional configuration for IPv6 to work.
2026-03-17 00:21:43 -05:00
hwdsl2
ad61b354c5 Improve VPN config
- Clean up obsolete Libreswan keywords
2025-09-02 00:38:03 -05:00
hwdsl2
f1dfa0d213 New Libreswan version
- Use new Libreswan version 5.3.
2025-07-06 11:13:56 -05:00
hwdsl2
909bf12175 Update OS support
- Add CentOS Stream 10
- Add a check for Ubuntu 25.04, which is not currently supported.
2025-05-13 00:28:40 -05:00
hwdsl2
25da664874 Improve Libreswan install
- Check that folder /etc/ipsec.d exists after install.
2025-05-12 22:56:33 -05:00
hwdsl2
7c76a7aa37 Improve Libreswan check
- If folder /etc/ipsec.d does not exist, don't skip
  Libreswan installation.
2025-04-09 23:26:08 -05:00
hwdsl2
f07fd46985 New Libreswan version
- Use new Libreswan version 5.2.
2025-03-05 23:54:12 -06:00
hwdsl2
d7c20b818f Fix for CentOS
- Fixed an issue with adding VPN related firewall rules on CentOS,
  Rocky Linux and similar Linux distributions, when firewalld is
  configured to be the sole owner of nftables.
- Closes #1678. Thanks @CaptainFrosty!
2025-02-10 23:19:53 -06:00
hwdsl2
97189acf97 Cleanup 2024-10-15 22:37:34 -05:00
hwdsl2
2991302d57 Improve nftables rules
- Fixed an issue where AlmaLinux 9 users may encounter the error
  "unsupported xtables compat expression" for xt target "MASQUERADE",
  which prevents nftables rules from loading. This could happen if the
  server already has OpenVPN and/or WireGuard installed before
  installing the IPsec VPN.
2024-10-15 22:35:39 -05:00
hwdsl2
21ba11505a New Libreswan version
- Use new Libreswan version 5.1.
2024-10-14 21:53:17 -05:00
hwdsl2
9a625dba29 Update OS support
- Remove CentOS 7 and CentOS 8 Stream, which have reached EOL.
- Add Alpine Linux 3.20 and remove 3.18.
2024-07-28 17:52:03 -05:00
hwdsl2
bea8597b02 Add new option
- Add an option for specifying a Libreswan version to install,
  using variable VPN_SWAN_VER. Currently supported values are
  4.15 and 5.0. This could be useful for users who want to
  install the older Libreswan version 4.
2024-05-03 22:18:08 -05:00
hwdsl2
6f2efd3b59 New Libreswan version
- Use new Libreswan version 5.0.
  Ref: https://lists.libreswan.org/pipermail/swan-announce/2024/000058.html
2024-05-02 20:44:54 -05:00
hwdsl2
bf965cfd18 Fix for CentOS 9
- Fixed an issue with nftables on CentOS 9/8, where users may
  encounter the error "unsupported xtables compat expression"
  during VPN setup.
2024-05-01 20:35:02 -05:00
hwdsl2
49ab3b60a6 New Libreswan version
- Use new Libreswan version 4.15.
  Ref: https://lists.libreswan.org/pipermail/swan-announce/2024/000056.html
2024-04-17 20:42:32 -05:00
hwdsl2
7ee03da7d0 New Libreswan version
- Use new Libreswan version 4.14.
  Ref: https://lists.libreswan.org/pipermail/swan-announce/2024/000055.html
2024-03-16 11:50:58 -05:00
hwdsl2
198bd98fbb Update year 2024-02-03 15:31:58 -06:00
hwdsl2
d522d42ba3 New Libreswan version
- Use new Libreswan version 4.12.
  Ref: https://lists.libreswan.org/pipermail/swan-announce/2023/000051.html
2023-08-11 00:07:11 -05:00
hwdsl2
8581057053 New Libreswan version
- Use new Libreswan version 4.11.
  Ref: https://lists.libreswan.org/pipermail/swan-announce/2023/000050.html
  Note: This project does not enable IKEv1 aggressive mode in the
        default configuration.
2023-05-04 23:58:54 -05:00
hwdsl2
1fb5c5be8c New Libreswan version
- Use new Libreswan version 4.10.
  Ref: https://lists.libreswan.org/pipermail/swan-announce/2023/000049.html
2023-03-01 08:53:03 -06:00
hwdsl2
dc32e28f47 Cleanup 2023-01-13 00:36:49 -06:00
hwdsl2
c356a75bca Update docs 2023-01-04 18:58:29 -06:00
hwdsl2
651c404bf6 Improve sysctl settings
- For enabling TCP BBR congestion control, add a check to make sure
  tcp_congestion_control exists.
2022-11-20 15:01:44 -06:00
hwdsl2
4174ffa3ef Improve VPN setup
- Improve download of VPN helper scripts during setup.
  Note: https://github.com/hwdsl2/setup-ipsec-vpn/raw/master/extras/...
  redirects to
  https://raw.githubusercontent.com/hwdsl2/setup-ipsec-vpn/master/extras/...
  Use the latter directly so that Wget can reuse the same connection
  for all 3 helper scripts.
- For Ubuntu 18.04, improve download of NSS packages and add fallback URLs.
2022-10-22 23:55:06 -05:00
hwdsl2
28d1f494f0 New Libreswan version
- Use new Libreswan version 4.9.
- Compilation of Libreswan 4.9 on Ubuntu 18.04 requires newer
  versions of NSS packages. They are installed in a similar way
  as apply_ubuntu1804_nss_fix in ikev2setup.sh.
  Ref: https://github.com/libreswan/libreswan/issues/892
2022-10-21 00:10:58 -05:00
hwdsl2
3dc675ba37 Add client validity option
- For IKEv2 mode, add a new variable VPN_CLIENT_VALIDITY for specifying
  the client certificate validity period (in months). Must be an integer
  between 1 and 120. Default value is 120. Users can define it as an
  environment variable when setting up IKEv2 in auto mode, or when
  adding a new IKEv2 client using "--addclient".
2022-10-16 00:45:45 -05:00
hwdsl2
ed359619bb Cleanup 2022-10-10 00:29:25 -05:00
hwdsl2
3bf17a75db Improve interface check
- Install iproute (for the "ip" command) in the unlikely cases that
  both "route" and "ip" commands are unavailable.
2022-10-04 22:52:37 -05:00
hwdsl2
6e596825e2 Improve VPN ciphers
- Improve security by removing support for modp1536 (DH group 5),
  which is less secure and rarely used by VPN clients. To do this,
  we specify modp2048 on the "ike=" line in ipsec.conf.
2022-09-30 01:11:18 -05:00
hwdsl2
025387df91 Improve VPN ciphers
- Improve security by removing support for modp1024 (DH group 2),
  which is less secure and no longer enabled in Libreswan by default.
- The native VPN client on Android devices uses modp1024 for the
  IPsec/L2TP and IPsec/XAuth ("Cisco IPsec") modes. After this change,
  Android users should instead connect using IKEv2 mode (recommended).
2022-09-29 22:52:40 -05:00
hwdsl2
cc99e18123 Cleanup 2022-09-24 18:56:27 -05:00
hwdsl2
32faed40d5 Improve IP check
- Instead of finding the server's public IP, use the IP address
  on the default route if it is not a private IP. This makes VPN
  setup slightly faster by skipping IP detection.
- Add a fallback URL for finding the server's public IP.
- Cleanup
2022-09-24 00:58:16 -05:00
hwdsl2
c5df950ea2 Improve VPN setup
- Continue VPN setup (instead of exiting) if fail2ban fails to install.
2022-09-09 23:53:13 -05:00
hwdsl2
db54638f5e Check kernel version
- Only enable TCP BBR congestion control if the server's Linux kernel
  version is 4.20 or newer.
- BBR requires the "fq" qdisc for older kernels < 4.20. That setting
  may not take effect on existing network interfaces without a reboot.
- References:
  https://github.com/google/bbr/blob/master/Documentation/bbr-quick-start.md
  0bb9d90
2022-09-08 00:29:18 -05:00
hwdsl2
6a525c6c10 Optimize TCP buffers
- Improve VPN performance by tuning TCP buffer sizes.
2022-09-07 23:29:10 -05:00
hwdsl2
0bb9d90668 Enable TCP BBR
- Improve VPN performance by enabling the TCP BBR congestion control
  algorithm on supported systems (e.g. Ubuntu 18.04+, Debian 10+,
  CentOS 8+) during VPN setup.
  References:
  https://cloud.google.com/blog/products/networking/tcp-bbr-congestion-control-comes-to-gcp-your-internet-just-got-faster
  https://github.com/hwdsl2/setup-ipsec-vpn/blob/master/docs/bbr.md
2022-09-07 02:32:12 -05:00
hwdsl2
d2e9b5ff91 Cleanup 2022-08-27 21:51:19 -05:00
hwdsl2
56078b0a1e Add an option to skip IKEv2 setup
- Add an option to skip IKEv2 setup when installing the IPsec VPN.
  Example: sudo VPN_SKIP_IKEV2=yes sh vpn.sh
- This allows users to set up an IKEv1-only VPN, or install IKEv2
  interactively using "sudo ikev2.sh" after VPN setup.
2022-08-27 15:59:43 -05:00
hwdsl2
e2f211c678 Improve OS detection
- Improve OS detection and clean up
2022-08-10 22:41:55 -05:00
hwdsl2
1dbf897500 Cleanup
- Fix OS checking: Don't show errors for /etc/redhat-release.
- Fixes #1211.
2022-08-09 19:34:32 -05:00
hwdsl2
95be4b83fb Fix NSS config
- Update NSS config on e.g. AlmaLinux 9 to allow the SHA1 signature
  algorithm. This fixes the issue where IKEv2 clients cannot connect.
- Fixes #1206.
2022-07-31 23:40:09 -05:00
hwdsl2
200da23776 Add Oracle Linux 9 2022-07-30 09:31:27 -05:00
hwdsl2
10d54262fb Add CentOS 9
- Add support for version 9 of CentOS Stream, RHEL, Rocky Linux
  and AlmaLinux.
2022-07-30 02:59:49 -05:00
hwdsl2
066cb14e14 Cleanup 2022-07-30 00:50:40 -05:00
hwdsl2
d36c435c95 Improve IPsec config
- IKEv2 mode uses retransmit-timeout instead of dpdtimeout.
- Increase timeouts from 120s to 300s, so that the VPN server can
  keep the VPN connection open if the client's network is unstable.
2022-06-15 00:28:21 -05:00
hwdsl2
0e24f8b086 Cleanup 2022-06-09 13:44:16 -05:00