OpenVPN as UDP-Server and UDP-Client on the same machine

Need help configuring your VPN? Just post here and you'll get that help.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
mniehren
OpenVpn Newbie
Posts: 4
Joined: Mon Jun 16, 2014 8:55 pm

OpenVPN as UDP-Server and UDP-Client on the same machine

Post by mniehren » Mon Jun 16, 2014 9:14 pm

Hi together,

subject say's it all. If i run an OpenVPN-Server on udp (Port 1194) and on the same machine try
to establish an UDP-OpenVPN to another server, which also listens on Port 1194, i got the following error:
TCP/UDP: Socket bind failed on local address [undef]: Address already in use

If i do the same with an OpenVPN-Server on tcp, i can establish on the same time an OpenVPN
TCP connection to another server. Here i can use the option
proto tcp-client
but on udp i can only use
proto udp

Does someone know a solution for this problem or is it not possible to run and OpenVPN-UDP-Server
and Client on the same machine ?

best regards,
Michael

Here is my server-upd.conf:
writepid /var/run/openvpn/server-udp.pid
port 1194
proto udp
dev tun
tun-mtu 1500
tls-server
ca /etc/openvpn/ca/cacert.pem
cert /etc/openvpn/certs/servercert.pem
key /etc/openvpn/certs/serverkey.pem
dh /etc/openvpn/ca/dh1024.pem
crl-verify /etc/openvpn/ca/crl.pem
topology subnet
server 10.35.0.0 255.255.255.0
ifconfig-pool-persist ipp-udp.txt 0
client-config-dir ccd
client-to-client
ccd-exclusive
script-security 3
auth-user-pass-verify /etc/openvpn/scripts/checklogin via-env
auth-user-pass-optional
client-connect /etc/openvpn/scripts/ovpn.up
client-disconnect /etc/openvpn/scripts/ovpn.down
keepalive 30 180
cipher AES-128-CBC
;comp-lzo
max-clients 2500
user root
group nobody
persist-key
persist-tun
status /var/log/ovpnserver.log 30
management localhost 7506
verb 3

and the udp-client.conf:
tls-client
client
route-nopull
dev tun
proto udp
tun-mtu 1500
remote x.x.x.x 1194
pkcs12 test.p12
script-security 2
up /etc/openvpn/scripts/ovpn-client.up
down /etc/openvpn/scripts/ovpn-client.down
cipher AES-128-CBC
verb 3

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: OpenVPN as UDP-Server and UDP-Client on the same machine

Post by TinCanTech » Thu Jul 20, 2017 5:37 pm

Use --nobind in the client ..

Post Reply