Connection to Apache server don't pass from openVPN tunnel

This forum is for general conversation and user-user networking.

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

Post Reply
artin kennedy
OpenVpn Newbie
Posts: 2
Joined: Tue Aug 16, 2022 6:49 am

Connection to Apache server don't pass from openVPN tunnel

Post by artin kennedy » Tue Aug 16, 2022 6:53 am

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.

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

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

Post by TinCanTech » Tue Aug 16, 2022 12:51 pm

It looks like you are trying to connect to apache without going via openvpn port-share ..

artin kennedy
OpenVpn Newbie
Posts: 2
Joined: Tue Aug 16, 2022 6:49 am

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

Post by artin kennedy » Wed Aug 17, 2022 3:50 am

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?

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

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

Post by TinCanTech » Wed Aug 17, 2022 9:06 am

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

Post Reply