You are not logged in.

#1 2013-03-07 14:09:28

ddelpino
Member
Registered: 2011-03-07
Posts: 7

[Resolved] OpenVPN not resolv address in boot

Hi

I have a problem, long time ago I have OpenVPN configured for connect to many remote networks in system boot, I use Systemd and Netcfg with the service net-auto-wired. All worked good until yesterday when my router is broken and I have connect it my computer direct to Internet modem. Now OpenVPN can't connect to remote networks, this is error I see in journalctl:

mar 07 09:55:10 Mi_Arch openvpn@red1[429]: RESOLVE: Cannot resolve host address: server1.empresa1.xt: Name or service not known
mar 07 09:55:15 Mi_Arch openvpn@red2[435]: RESOLVE: Cannot resolve host address: server1.empresa2.xt: Name or service not known
mar 07 09:55:15 Mi_Arch openvpn@red3[436]: RESOLVE: Cannot resolve host address: server1.empresa3.xt: Name or service not known

It say can't resolved it name host, but if I do ping to name host...

PING server1.empresa1.xt (1x2.12x.1x3.x54) 56(84) bytes of data.
64 bytes from 1x2-12x-1x3-x54.static.provider.xt (1x2.12x.1x3.x54): icmp_seq=1 ttl=56 time=13.9 ms
64 bytes from 1x2-12x-1x3-x54.static.provider.xt (1x2.12x.1x3.x54): icmp_seq=2 ttl=56 time=14.9 ms
64 bytes from 1x2-12x-1x3-x54.static.provider.xt (1x2.12x.1x3.x54): icmp_seq=3 ttl=56 time=12.5 ms
--- server1.empresa2.xt ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2001ms
rtt min/avg/max/mdev = 12.586/13.836/14.944/0.967 ms

After if I stop the service and I do start manually, OpenVPN connect immediately.

sudo systemctl stop openvpn@red1
sudo systemctl start openvpn@red1

If I not restarting manually the service never connect it, service try repeated times with the same error.

Last edited by ddelpino (2013-03-31 20:11:33)

Offline

#2 2013-03-30 23:08:58

TheAmigo
Member
Registered: 2008-04-08
Posts: 61

Re: [Resolved] OpenVPN not resolv address in boot

I have the same problem.  I haven't found a solution yet sad

I'm seeing this on a system that I just installed Arch on from scratch... so it's fully systemd and never had an rc.conf.

I had other issues too, like after install, when the system booted, it didn't bring the network up.  I enabled the dhcpcd service, but I may have missed something else.

Offline

#3 2013-03-31 20:10:51

ddelpino
Member
Registered: 2011-03-07
Posts: 7

Re: [Resolved] OpenVPN not resolv address in boot

Hi. My problem is resolved. After reboot many times OpenVPN connect without problems. I don't now that happen.

Last edited by ddelpino (2013-03-31 20:11:50)

Offline

#4 2015-04-02 02:19:50

asg1448
Member
Registered: 2014-04-12
Posts: 67

Re: [Resolved] OpenVPN not resolv address in boot

TheAmigo wrote:

I have the same problem.  I haven't found a solution yet sad

I'm seeing this on a system that I just installed Arch on from scratch... so it's fully systemd and never had an rc.conf.

I had other issues too, like after install, when the system booted, it didn't bring the network up.  I enabled the dhcpcd service, but I may have missed something else.

Here's one little tweak i did - modify openvpn unit file ( /usr/lib/systemd/system/openvpn@.service ) to depend on networkd , and to restart after fail:

    [Unit]
    Description=OpenVPN connection to %i
    After=systemd-networkd.service


    [Service]
    Type=forking
    ExecStart=/usr/bin/openvpn --cd /etc/openvpn --config /etc/openvpn/%i.conf --daemon openvpn@%i --writepid /run/openvpn@%i.pid
    PIDFile=/run/openvpn@%i.pid
    Restart=always
    RestartSec=15

    [Install]
    WantedBy=multi-user.target

Offline

#5 2015-04-04 23:00:37

Stunts
Member
From: Portugal
Registered: 2009-03-28
Posts: 297
Website

Re: [Resolved] OpenVPN not resolv address in boot

Thanks!
This seems to have done the trick!
However, I would recommend doing:

cp  /usr/lib/systemd/system/openvpn@.service /etc/systemd/system/

And writing the mentioned changes in that new file. Afterwards, don't forget to disable and re-enable the service.
This way, the manual changes will not be overwritten by the next systemd or openvpn update.

Last edited by Stunts (2015-04-04 23:02:09)

Offline

Board footer

Powered by FluxBB