WobblyWes To the dear good people at openvpn, i am very new to this. I have been struggling for days to get a connection working between two Ubuntu VM's, one a server, the other a client. I keep getting a network unreachable error. Running sudo openvpn client.conf just hangs. However the server appears to be up and running ok (active, tun shows up in ip a). I would post the logs, however am unable to get them out of the VM at this point. I was wondering whether someone could look over my conf files, perhaps they will spot an error. Error from client log: write UDP - Network is unreachable (code101) Error from server log Socket bind failed on local address [AF inet] undef:1194 Address already in use (errno:98) Any help much appreciated. The client conf file has undergone numerous changes and the two lines key-direction 1 and remote-cert-tls server are the most recent experimental additions. client dev tun proto udp port 1194 remote 10.10.10.1 resolv-retry infinite persist-key persist-tun ca <path> cert <path> key <path> key-direction 1 cipher AES-256-CBC auth SHA512 auth-nocache user nobody group nogroup compress lz4 log <path> status <path> verb 4 remote-cert-tls server port 1194 proto udp dev tun ca <path> cert <path> key <path> dh <path> crl-verify <path> server 10.10.10.0 255.255.255.0 push "redirect-gateway def1" duplicate-cn cipher AES-256-CBC tls-version-min 1.2 tls-cipher TLS-etc>>> auth SHA512 auth-nocache keepalive 20 60 persist-key persist-tun compress lz4 daemon user nobody group nogroup log-append <path> verb 3
WobblyWes They are on a virtual interface, and can successfully ping each other. Port forwarding is on for both devices: net.ipv4.ip_forward=1 and on; sudo sysctl -p Tried with firewall disabled and with iptables rule to accept and forward any udp traffic on :1194 Both services are active(running) The client service is stuck at pre-initialisation. I cannot get a tun device on the client however as i understand it, it will only appear on successful connection.
TinCanTech Please see: https://forums.openvpn.net/viewtopic.php?f=30&t=22603#p68963 https://forums.openvpn.net/viewtopic.php?f=30&t=22603#p93575 Logs
WobblyWes I have been stuck on this for 3 days pulling my face out, and i have just changed the line in client.conf: remote 10.10.10.1 to the address of the virtual NIC: remote 192.168.30.1 and now i can ping 10.10.10.1 So i have simply misunderstood the requirement of client.conf: remote:<ip> Believing that it should be the ip that i assigned to the ovpn server? Does this sound correct. Regards.
TinCanTech WobblyWes wrote Does this sound correct No .. it sounds like you do not understand which IPs are actually assigned to your VMs because you do not yet understand how your VM software works, especially the bit about networking.
WobblyWes My virtual machines are both using the same isolated network. ClientVM@192.168.30.2 ServerVM@192.168.30.1 The openVpn server sits on the 10.10.10.0/24 network.
TinCanTech WobblyWes wrote I have been stuck on this for 3 days pulling my face out, and i have just changed the line in client.conf: remote 10.10.10.1 to the address of the virtual NIC: remote 192.168.30.1 and now i can ping 10.10.10.1 So i have simply misunderstood the requirement of client.conf: remote:<ip> Believing that it should be the ip that i assigned to the ovpn server? Does this sound correct. Regards. VirtualBox NAT .. @Mod Nothing to do with OpenVPN and no logs provided.
WobblyWes No not virtual box nat, it has everything to do with openvpn; Client.conf Remote <server ip> Is it the ip value set in server conf? Ie 10.10.10.1 in my case.. Or should it be the local private address of the virtual device. Thats the question, simply what value should be placed in remote <ip> in the client.conf.
TinCanTech OpenVPN will try to connect to what-ever IP you tell it to. If you give it the wrong IP then it will obviously fail.