Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add another OpenVPN Port #542

Closed
johndave9296 opened this issue Feb 18, 2020 · 7 comments
Closed

Add another OpenVPN Port #542

johndave9296 opened this issue Feb 18, 2020 · 7 comments

Comments

@johndave9296
Copy link

Suggestion if it's possible if we'll add an additional feature that not only one port is open into a VPS but another port to be opened. For example, if we set a port 1194 then we're hoping to add another port which is 80. Hopefully there's a feature to the script.

@angristan
Copy link
Owner

Sorry, I'm not sure to understand your request.

@johndave9296
Copy link
Author

What I mean is for a possibility of establishing multiple OpenVPN Ports instead of only one.

@x0r2d2
Copy link

x0r2d2 commented Feb 19, 2020

What I mean is for a possibility of establishing multiple OpenVPN Ports instead of only one.

@johndave9296
For now you can add it manualy. Copy existing server.conf, change port and subnet to desired one e.g. 64000 and 10.9.0.1, rename it to server2.conf, add iptables rules and then start and enable it:

systemctl start openvpn@server2.service
systemctl enable openvpn@server2.service

I also wanted to ask @angristan regarding this feature request.

Dear @angristan is there any possibility to add this feature to script?
Options: keep same config or with different options (cipher, HMAC, tls-cipher), ability to choose port or use random one and ability to choose subnet.

@johndave9296
Copy link
Author

I think this would be possible. How about doing a custom line script such as

port 443
port 8080
port 80

@johndave9296
Copy link
Author

@hybtoy

Update: It's not working even though I added these two commands

systemctl start openvpn@server2.service systemctl enable openvpn@server2.service

It turns out that the tun device driver was somehow disabled in my server.

@johndave9296
Copy link
Author

johndave9296 commented Feb 28, 2020

Hello I would like to ask if my iptables are correctly executed.

#!/bin/sh
iptables -t nat -I POSTROUTING 1 -s 9.2.96.0/24 -o eth0 -j MASQUERADE
iptables -t nat -I POSTROUTING 1 -s 9.2.97.0/24 -o eth0 -j MASQUERADE
iptables -I INPUT 1 -i tun0 -j ACCEPT
iptables -I INPUT 1 -i tun1 -j ACCEPT
iptables -I FORWARD 1 -i eth0 -o tun0 -j ACCEPT
iptables -I FORWARD 1 -i eth0 -o tun1 -j ACCEPT
iptables -I FORWARD 1 -i tun0 -o eth0 -j ACCEPT
iptables -I FORWARD 1 -i tun1 -o eth0 -j ACCEPT
iptables -I INPUT 1 -i eth0 -p tcp --dport 1194 -j ACCEPT
iptables -I INPUT 1 -i eth0 -p udp --dport 53 -j ACCEPT

@randshell
Copy link
Contributor

The iptables should be fine. If you followed @hybtoy comment and it doesn't work I think the problem is with port 53 udp, some program might be using it. You can try changing it to confirm this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants