Page 1 of 1

Connection to Apache server don't pass from openVPN tunnel

Posted: Tue Aug 16, 2022 6:53 am
by artin kennedy
I am working with two VMs in virtualbox. Both of them are in one Subnet 10.0.2.0. On the first VM I run client.conf and on other VM run server.conf and startup Apache Server. OpenVPN tunnel established successfully. But I want to make all traffic in the client go through the VPN tunnel. For testing this, I use port-share with Apache server port, open firefox browser and try to connect https://10.0.2.5:4433. But error unreachable occured. Unfortunately I can't find the problem.

here is my server.conf (with ip : 10.0.2.5):

#Network Configuration
mode server
proto tcp-server
dev tun
topology subnet
ifconfig xxxx 255.255.255.0
port 1194
port-share 10.0.2.5 4433
user nobody
group nogroup
persist-key
persist-tun
keepalive 10 120
dh none
# Control Configuration (Crypto)
tls-server
tls-version-min 1.3
tls-version-max 1.3

ca /home/files/ca.crt
cert /home/files/server.crt
key /home/files/server.key
tls-ciphersuites TLS_AES_256_GCM_SHA384

# Select a cryptographic cipher and Authentication in the network.
cipher AES-256-GCM
verb 5
push "redirect-gateway local def1"
push "route 10.0.2.5 255.255.255.0"
-------------------------------------------------------------------------------
and client.conf (with ip : 10.0.2.5):

#Network Configuration
;client

proto tcp-client
dev tun
pull
remote 10.0.2.5
port 1194
user nobody
group nogroup
persist-key
persist-tun
keepalive 10 120
# Control Configuration (Crypto)
tls-client
tls-version-min 1.3
tls-version-max 1.3
ca /home/ca.crt
cert /home/client.crt
key /home/client.key
tls-ciphersuites TLS_AES_256_GCM_SHA384
# Select a cryptographic cipher and Authentication in network.
cipher AES-256-GCM
verb 5
redirect-gateway local
dhcp-option DNS 10.0.2.5

Thanks in advance, hope you can help.

Re: Connection to Apache server don't pass from openVPN tunnel

Posted: Tue Aug 16, 2022 12:51 pm
by TinCanTech
It looks like you are trying to connect to apache without going via openvpn port-share ..

Re: Connection to Apache server don't pass from openVPN tunnel

Posted: Wed Aug 17, 2022 3:50 am
by artin kennedy
why? I add "port-share 10.0.2.5 4433" to server config. Are configs incomplete?
Can you help me to use from correct configs?

Re: Connection to Apache server don't pass from openVPN tunnel

Posted: Wed Aug 17, 2022 9:06 am
by TinCanTech
To test the shared port you would attempt to connect the the VPN server address/port with a browser.

See the manual for --port-share