My goal is to set up OpenVPN server on my PC as a guest in a virtual machine.  I would like to use that OpenVPN server to join my home network from anywhere. On my PC (host) machine ( I set a new vagrant box (OpenVPN server):

config.vm.define "node1" do |node1|
node1.vm.box = "generic/ubuntu1904"
node1.vm.network "public_network", ip: ""

So my OpenVPN server sits on my home network with local IP Here is the output from "ip a" command (eth0 is created default by VirtualBox):

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet scope host lo
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 08:00:27:11:de:a1 brd ff:ff:ff:ff:ff:ff
    inet brd scope global dynamic eth0
       valid_lft 84383sec preferred_lft 84383sec
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 08:00:27:d2:71:a0 brd ff:ff:ff:ff:ff:ff
    inet brd scope global eth1
       valid_lft forever preferred_lft forever

I installed and configured OpenVPN server via command:

wget https://git.io/vpn -O openvpn-install.sh && bash openvpn-install.sh

Script "openvpn-install.sh" needs from me the IPv4 address of the network interface you want OpenVPN listening to. My question is that what IP should put there? or public IP from https://ipchicken.com/?

  • Looking at the script it appears you want to input and then you will be asked for the public IP. – jordanm Jun 23 at 17:33
  • Thanks for the reply! I opened the generated ovpn file with my phone (connected to 4g), but it got timeout. Here is snippet from the client ovpn file: client dev tun proto udp sndbuf 0 rcvbuf 0 remote <public_ip> 1194 etc... – Criaz91 Jun 23 at 18:01
  • My phone is trying to connect to my "public_ip" on port 1194, I also opened a port forwarding on my router for internal ip (openvpn server) - for port 1194, but it doesn't help :/ – Criaz91 Jun 23 at 18:08
  • Ok, I managed to connect from my phone (4G) to my OpenVPN server ... I can ping connected devices on my home network from my phone....but my phone doesn't have internet :/ – Criaz91 Jun 26 at 7:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.