forked from WantClue/Helium-VPS
-
Notifications
You must be signed in to change notification settings - Fork 1
/
install.sh
46 lines (34 loc) · 1.96 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
apt update
apt upgrade -y
apt install iptables -y
wget https://raw.githubusercontent.com/Angristan/openvpn-install/master/openvpn-install.sh
chmod +x openvpn-install.sh
AUTO_INSTALL=y APPROVE_INSTALL=y APPROVE_IP=y IPV6_SUPPORT=y PORT_CHOICE=1 PROTOCOL_CHOICE=1 DNS=3 COMPRESSION_ENABLED=n CUSTOMIZE_ENC=n CLIENT=Helium-Mango PASS=1 ENDPOINT=$(curl -4 ifconfig.co) ./openvpn-install.sh
export MENU_OPTION="1"
export CLIENT="Helium-PC"
export PASS="1"
./openvpn-install.sh
iptables -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --set-mss 1240
iptables -A FORWARD -i tun0 -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -A FORWARD -i eth0 -o tun0 -p tcp --syn --dport 44158 -m conntrack --ctstate NEW -j ACCEPT
iptables -A FORWARD -i eth0 -o tun0 -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 44158 -j DNAT --to-destination 10.8.0.2
echo net.ipv4.ip_forward=1 >> /etc/sysctl.conf
sysctl -p
apt-get install iptables-persistent -y
netfilter-persistent save
netfilter-persistent reload
touch /etc/openvpn/ccd/Helium-Mango
touch /etc/openvpn/ccd/Helium-PC
echo "# static IP for the Client (Client-IP Subnet)" > /etc/openvpn/ccd/Helium-Mango
echo ifconfig-push 10.8.0.2 255.255.255.0 >> /etc/openvpn/ccd/Helium-Mango
echo "# static IP for the PC (PC-IP Subnet)" > /etc/openvpn/ccd/Helium-PC
echo ifconfig-push 10.8.0.4 255.255.255.0 >> /etc/openvpn/ccd/Helium-PC
echo "# Location of the config files" >> /etc/openvpn/server.conf
echo client-config-dir ccd >> /etc/openvpn/server.conf
echo "# Route to the network from host to OVPN Server" >>/etc/openvpn/server.conf
echo route 192.168.8.0 255.255.255.0 >> /etc/openvpn/server.conf
echo "# Tell all clients the Home address" >>/etc/openvpn/server.conf
echo push '"route 192.168.8.0 255.255.255.0"' >> /etc/openvpn/server.conf
echo "# DNS-Server for Clients (Mango)">>/etc/openvpn/server.conf
echo push '"dhcp-option DNS 192.168.8.1"' >> /etc/openvpn/server.conf