# OpenVPN Server with UDP + TCP + Squid Proxy + ShadowSocksR

**URL:** <https://onehack.st/t/openvpn-server-with-udp-tcp-squid-proxy-shadowsocksr/54377>\
**Category:** Tools & Scripts\
**Tags:** tools, privacy, networking\
**Created:** [August 21, 2019, 9:58am UTC](https://onehack.st/t/openvpn-server-with-udp-tcp-squid-proxy-shadowsocksr/54377 "2019-08-21T09:58:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aina](https://onehack.st/user_avatar/onehack.st/aina/32/167469_2.png) [@Aina](https://onehack.st/u/Aina)\
**Post date:** [August 21, 2019, 9:58am UTC](https://onehack.st/t/openvpn-server-with-udp-tcp-squid-proxy-shadowsocksr/54377/1 "2019-08-21T09:58:26Z")

</div>

**Configuring OpenVPN with UDP VPN + TCP VPN**

**First, get the script and make it executable :**

Code:

```auto
curl -O https://raw.githubusercontent.com/Angristan/openvpn-install/master/openvpn-install.sh
chmod +x openvpn-install.sh

```

**Then run it :**

Code:

```auto
./openvpn-install.sh

```

**Configuring Steps:**

**Add IPTables:**

Code:

```auto
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:

```auto
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:

```auto
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:

```auto
service openvpn@udpvpn restart

service openvpn@tcpvpn restart

service openvpn@squidvpn restart

```

**Configuring Squid Proxy Server**

Code:

```auto
sudo apt-get update

sudo apt-get install squid

sudo apt-get install squid3

```

**Change directory**

Code:

```auto
cd /etc/squid

cd /etc/squid3

```

**Open squid.conf**

Code:

```auto
nano squid.conf

```

**Search http\_port 3128**

**Change the 3128 to any port eg. 5421**

**Uncomment:**

Code:

```auto
http_access deny all

```

**Add:**

Code:

```auto
http_access allow all

acl Safe_ports port number(replace with port number)

acl SSL_ports port number(replace with port number)

```

**These are the lines you add or change:**

Code:

```auto
http_port 5421

http_access allow all

acl Safe_ports port number(replace with port number)

acl SSL_ports port number(replace with port number)

```

**Restart Squid Server:**

Code:

```auto
sudo service squid restart

sudo service squid3 restart

```

**Configuring ShadowsocksR Super Fast Secure Proxy**

Log in as the root user and run the following command:

Code:

```auto
wget --no-check-certificate https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocksR.sh
chmod +x shadowsocksR.sh
./shadowsocksR.sh 2>&1 | tee shadowsocksR.log

```

Or Try the four in One Script

Code:

```auto
wget --no-check-certificate https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocks-all.sh
chmod +x shadowsocks-all.sh
./shadowsocks-all.sh 2>&1 | tee shadowsocks-all.log

```

After the installation is complete, the script prompts as follows:

Code:

```auto
Congratulations, ShadowsocksR server install completed!
Your Server IP :your_server_ip
Your Server Port :your_server_port
Your Password :your_password
Your Protocol :your_protocol
Your obfs :your_obfs
Your Encryption Method:your_encryption_method

Welcome to visit:https://shadowsocks.be/9.html
Enjoy it!

```

**Uninstall method:**  
Log in as root and run the following command:

Code:

```auto
./shadowsocksR.sh uninstall

```

After the installation is complete, ShadowsocksR is started in the background and runs:

Code:

```auto
/etc/init.d/shadowsocks status

```

You can see if the ShadowsocksR process has started.  
After the script is installed, ShadowsocksR has been automatically added to boot and self-start.

**Use the command:**

Code:

```auto
Start: /etc/init.d/shadowsocks start
Stop: /etc/init.d/shadowsocks stop
Restart: /etc/init.d/shadowsocks restart
Status: /etc/init.d/shadowsocks status

Configuration file path: /etc/shadowsocks.json
log file path: /var/log/shadowsocks.log
code installation directory: /usr/local/shadowsocks

```

**Multi-user configuration example:**

Code:

```auto
{
"server":"0.0.0.0",
"server_ipv6": "[::]",
"local_address":"127.0.0.1",
"local_port":1080,
"port_password":{
    "8989":"password1",
    "8990":"password2",
    "8991":"password3"
},
"timeout":300,
"method":"aes-256-cfb",
"protocol": "origin",
"protocol_param": "",
"obfs": "plain",
"obfs_param": "",
"redirect": "",
"dns_ipv6": false,
"fast_open": false,
"workers": 1
}

```

In case you want to modify the configuration file, get these:

```
https://github.com/shadowsocksr-backup/shadowsocks-rss/wiki/Server-Setup
https://github.com/shadowsocksr-backup/shadowsocks-rss/blob/master /ssr.md
https://github.com/shadowsocksr-backup/shadowsocks-rss/wiki/config.json

```

## ENJOY & HAVE A NICE DAY!

_Source: Unknown_

---

<div class="post-metadata">

**Author:** ![seandex](https://onehack.st/letter_avatar_proxy/v4/letter/s/9de053/32.png) [@seandex](https://onehack.st/u/seandex)\
**Post date:** [January 20, 2020, 12:42pm UTC](https://onehack.st/t/openvpn-server-with-udp-tcp-squid-proxy-shadowsocksr/54377/2 "2020-01-20T12:42:11Z")

</div>

I doubt this script works at all.

---

<div class="post-metadata">

**Author:** ![rawn7702](https://onehack.st/user_avatar/onehack.st/rawn7702/32/104678_2.png) [@rawn7702](https://onehack.st/u/rawn7702)\
**Post date:** [January 20, 2020, 1:19pm UTC](https://onehack.st/t/openvpn-server-with-udp-tcp-squid-proxy-shadowsocksr/54377/3 "2020-01-20T13:19:22Z")

</div>

Why so?  
Any specific reason?
