Configuring OpenVPN with UDP VPN + TCP VPN
First, get the script and make it executable :
Then run it :
Configuring Steps:
Add IPTables:
Copy Service:
Duplicate Files:
Edit Files:
nano udpvpn.conf
nano tcpvpn.conf
nano squidvpn.conf
Restart Services:
First, get the script and make it executable :
Code:
curl -O https://raw.githubusercontent.com/Angristan/openvpn-install/master/openvpn-install.sh
chmod +x openvpn-install.sh
Then run it :
Code:
./openvpn-install.sh
Configuring Steps:
Add IPTables:
Code:
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 10.9.0.0/24 -o eth0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 10.10.0.0/24 -o eth0 -j MASQUERADE
iptables -A INPUT -i eth0 -p udp --dport port -j ACCEPT
iptables -A INPUT -i eth0 -p tcp --dport port -j ACCEPT
iptables -A INPUT -i eth0 -p tcp --dport port -j ACCEPT
Copy Service:
Code:
cp /lib/systemd/system/openvpn\@.service /etc/systemd/system/tcpvpn\@.service
cp /lib/systemd/system/openvpn\@.service /etc/systemd/system/udpvpn\@.service
cp /lib/systemd/system/openvpn\@.service /etc/systemd/system/squidvpn\@.service
Duplicate Files:
Code:
cd /etc/openvpn/
cp server.conf udpvpn.conf
cp server.conf tcpvpn.conf
cp server.conf squidvpn.conf
Edit Files:
nano udpvpn.conf
---> Change 10.8.0.0 to 10.9.0.0
nano tcpvpn.conf
---> Change 10.8.0.0 to 10.9.0.0
nano squidvpn.conf
---> Change 10.8.0.0 to 10.10.0.0
Restart Services:
Code:
service openvpn@udpvpn restart
service openvpn@tcpvpn restart
service openvpn@squidvpn restart
Last edited: