OPENVPN is not connecting to internet

Hello,

I’m having problem with my ci/cd that is behind vpn server, only that vpn server can access the actually server via vpn.

I want to do this scenario :

Other servers only allow access when you connect to the vpn

I have tested myself by connecting to my vpn server using openvpn connect and got successful internet connection

When i connect via gitlab ci/cd i’m not able to connect and ping any other websites or ip addresses (public internet access) or server that allows only connection from vpn.

What can be the reason?

I have before:script those paramteres

  - apt-get install -y nmcli
  - cat <<< $GITLAB_PUSH_OPENVPN > /etc/openvpn/client.conf (importing from variable ready .openvpn file)
  - cat <<< "log /etc/openvpn/client.log" >> /etc/openvpn/client.conf
  - openvpn --config /etc/openvpn/client.conf --daemon
  - sleep 30s
  - echo "Giving some info after daemon is getting started."
  - cat /etc/openvpn/client.log
  - ping -c 1 8.8.8.8

Anyone? BUMB

You need to configure your OpenVPN server to work as a split-tunnel, so that it can access your private network over VPN as well as the internet. Otherwise, you have to provide firewall rules from the side where you are connecting to so that it allows you access to the internet. But that has nothing to do with gitlab, this should help: openvpn split tunnel - Google Search

So either you need to make sure firewall rules, and or DNS is available so that the hosts can access the internet while connected to the VPN, or make split tunneling on the OpenVPN server, so that it only connects and allows access to the resources on that internal network.