Hello good evening,
I am self-taught and I am starting in the world of OpenVPN, I have a php system of inventory and sales,
which several clients are registered, I want to add a ticket printer for each client (It is a printer for tax calculation), the printer
To connect it with PHP you need to use Sockets locally it works fine, but when I try to use the vpn it gives me a connection error, I think the error
It is in the port selected for the default printer, the printer uses the 8090 and the vpn network uses the 2021 (I don't know if that is the error).
I have an instance on Vultr.com and my client is on windows I use debian.
Printer Configuration
My VPN Client configuration
client
;dev tap
dev tun
;dev-node MyTap
proto tcp
;proto udp
remote XXX.XXX.XXX.XXX 2021
;remote my-server-2 1194
;remote-random
resolv-retry infinite
nobind
;user nobody
;group nobody
persist-key
persist-tun
;http-proxy-retry # retry on connection failures
;http-proxy [proxy server] [proxy port #]
;mute-replay-warnings
;ca /etc/openvpn/keys/ca.crt
<ca>
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----
</ca>
;cert /etc/openvpn/keys/zeuser-01.crt
<cert>
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----
</cert>
;key /etc/openvpn/keys/zeuser-01.key
<key>
-----BEGIN PRIVATE KEY-----
-----END PRIVATE KEY-----
</key>
#cert /etc/openvpn/keys/yonadiez.crt
#key /etc/openvpn/keys/yonadiez.key
;ns-cert-type server
;tls-auth ta.key 1
;cipher x
comp-lzo
verb 3
;mute 20
VPN Server Configuration
port 2021
proto tcp
dev tun
ca /etc/openvpn/key-server/ca.crt # generated keys
cert /etc/openvpn/key-server/server.crt
key /etc/openvpn/key-server/server.key # keep secret
dh /etc/openvpn/key-server/dh2048.pem
server 10.1.100.0 255.255.255.0 # internal tun0 connection IP
#ifconfig-pool-persist ipp.txt
keepalive 10 120
comp-lzo # Compression - must be turned on at both end
persist-key
persist-tun
client-config-dir ccd
status /etc/openvpn/log/openvpn-status.log
log /etc/openvpn/log/openvpn.log
log-append /etc/openvpn/log/openvpn.log
verb 3 # verbose mode
client-to-client
Php error when trying to connect
Warning: socket_connect(): unable to connect [110]: Connection timed out in /var/www/fiscal/htdocs/TfhkaPHPTCP.php on line 31
socket_connect() falló. Razón: () Connection timed out
Really my question is how do I use the php sockets over VPN?
Any connection that I make through the VPN, do I have to use port 2021 that I use for VPN, or can other ports be used when I am already connected to the VPN?