Multiple OpenVpn Server Instance

Hi all,
is possible to configure multiple instance of OpenVpn server on different port with different paramenter?

example:
openvpn1 - routed - port 1194 - route for green1
openvpn2 - bridged - port 11194 - bridge on green2

Thank you

1 Like

i have try this

GUI Openvpn

Enable Roadwarrior Server
Certificate
Bridged Mode
br1 / 192.168.0.251 / 192.168.0.252
UDP Port 11194
Submit

CONSOLE

cd /etc/openvpn/
cp host-to-net.conf host-to-net-bridge.conf

GUI Openvpn

Enable Roadwarrior Server
Certificate
Routed Mode
192.168.180.0 / 255.255.255.0
UDP Port 1194
Submit

CONSOLE

/usr/sbin/openvpn --cd /etc/openvpn/ --config host-to-net-bridge.conf &

ps -ef |grep openvpn
root     21466     1  0 10:39 ?        00:00:00 /usr/sbin/openvpn --cd /etc/openvpn/ --config host-to-net.conf
root     26418     1  0 11:17 ?        00:00:00 /usr/sbin/openvpn --cd /etc/openvpn/ --config host-to-net-bridge.conf

GUI Firewall Rules

Accept / RED / Firewall / UDP 11194
Apply

On Client
copy config.ovpn in bridge.ovpn and only change port in 11194

One question…option to run

/usr/sbin/openvpn --cd /etc/openvpn/ --config host-to-net-bridge.conf

at every time update option in gui?

You need to inform systemd about the new openvpn instance:

touch /etc/systemd/system/openvpn@.service.d/host-to-net-bridge.conf
/usr/bin/systemctl daemon-reload
/usr/bin/systemctl -f enable openvpn@host-to-net-bridge
/usr/bin/systemctl restart openvpn@host-to-net-bridge
1 Like

thanks @giacomo
i receive an error with

/usr/bin/systemctl -f enable host-to-net-bridge

i try

/usr/bin/systemctl -f enable openvpn@host-to-net-bridge.service

is correct?

Yes, my bad.

I just fixed the command in the previous post.