SELINUX=enforcing ########## System Information ##########
CPU model : Intel(R) Core(TM) i7-8559U CPU @ 2.70GHz Number of cores : 2 CPU frequency : 2711.687 MHz Total amount of ram : 1819 MB Total amount of swap : 2047 MB System uptime : 0days, 0:15:30 Load average : 0.00, 0.02, 0.05 OS : CentOS 7.6.1810 Arch : x86_64 (64 Bit) Kernel : 3.10.0-957.el7.x86_64 Hostname : localhost.localdomain IPv4 address : 192.168.172.193
############################################################### # L2TP VPN Auto Installer # # System Supported: CentOS 6+ / Debian 7+ / Ubuntu 12+ # # Intro: https://teddysun.com/448.html # # Author: Teddysun <i@teddysun.com> # ############################################################### If there is no [FAILED] above, you can connect to your L2TP VPN Server with the default Username/Password is below:
If you want to modify user settings, please use below command(s): l2tp -a (Add a user) l2tp -d (Delete a user) l2tp -l (List all users) l2tp -m (Modify a user password)
Welcome to visit our website: https://teddysun.com/448.html Enjoy it!
if [ -s /etc/selinux/config ] && grep 'SELINUX=enforcing' /etc/selinux/config; then sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config setenforce 0 fi
version_check
检查如果是CentOS 5的话,提示不支持
get_os_info
得到系统的一些信息
得到全局配置的公网IP, 如果要设置的局域网内网IP, 则需要手动指定
输出一些系统信息:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
echo "########## System Information ##########" echo echo "CPU model : ${cname}" echo "Number of cores : ${cores}" echo "CPU frequency : ${freq} MHz" echo "Total amount of ram : ${tram} MB" echo "Total amount of swap : ${swap} MB" echo "System uptime : ${up}" echo "Load average : ${load}" echo "OS : ${opsy}" echo "Arch : ${arch} (${lbit} Bit)" echo "Kernel : ${kern}" echo "Hostname : ${host}" echo "IPv4 address : ${IP}" echo echo "########################################"
echo echo "ServerIP:${IP}" echo "Server Local IP:${iprange}.1" echo "Client Remote IP Range:${iprange}.2-${iprange}.254" echo "PSK:${mypsk}" echo echo "Press any key to start... or press Ctrl + C to cancel."
cat > /etc/xl2tpd/xl2tpd.conf<<EOF [global] port = 1701
[lns default] ip range = ${iprange}.2-${iprange}.254 local ip = ${iprange}.1 require chap = yes refuse pap = yes require authentication = yes name = l2tpd ppp debug = yes pppoptfile = /etc/ppp/options.xl2tpd length bit = yes EOF
rm -f /etc/ppp/chap-secrets cat > /etc/ppp/chap-secrets<<EOF # Secrets for authentication using CHAP # client server secret IP addresses ${username} l2tpd ${password} * EOF
[root@localhost ~]# ipsec verify Verifying installed system and configuration files
Version check and ipsec on-path [OK] Libreswan 3.25 (netkey) on 3.10.0-957.el7.x86_64 Checking for IPsec support in kernel [OK] NETKEY: Testing XFRM related proc values ICMP default/send_redirects [OK] ICMP default/accept_redirects [OK] XFRM larval drop [OK] Pluto ipsec.conf syntax [OK] Two or more interfaces found, checking IP forwarding [OK] Checking rp_filter [OK] Checking that pluto is running [OK] Pluto listening for IKE on udp 500 [OK] Pluto listening for IKE/NAT-T on udp 4500 [OK] Pluto ipsec.secret syntax [OK] Checking 'ip' command [OK] Checking 'iptables' command [OK] Checking 'prelink' command does not interfere with FIPS [OK] Checking for obsolete ipsec.conf options [OK] [root@localhost ~]#