Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have OpenVPN AS started as an rc.d script. I want Bind9 to bind to a virtual network interface that OpenVPN sets up.

However only after the script terminates some virtual devices names as0t0 and as0t1. Meanwhile, Bind9 (DNS server) is started and it can't bind to those interfaces since they don't exist at the time.

Changing LSB dependencies and Sxx numbers using update-rc.d didn't help, since the openvpn script finishes before actually bringing up the interfaces.

It seems that /etc/if-up.d/bind9 exists exactly for this purpose, but apparently it does not run when the virtual network interfaces are started.

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

The script /etc/if-up.d/bind9 is just running the command rndc reconfig >/dev/null 2>&1 || true.

It sure seems like you could adjust your OpenVPN server configuration to simply run that command after the daemon has started. You probably want to do that by specifying an --up script. You could add this to your OpenVPN configuration like this.

up /etc/network/if-up.d/bind9
script-security 2              # permit a script to called

On OpenVPN Access Server, those lines can be added through the Web UI. Go to Configuration -> Advanced VPN -> Server Config Directives.

share|improve this answer
    
To clarify, the bind9 is to be run on the server side of OpenVPN. I'm not sure where in OpenVPN configuration to add the lines you wrote. The thing is that the init.d script exits before the interface is actually up. –  thesamet Aug 14 '13 at 4:18
    
Yes, I understand that Bind is running, which is why that script in if-up.d is calling rndc reconfig, do re-configure it. As for the how to configure OpenVPN AS. See section 4.2.5.7 in the manual. –  Zoredache Aug 14 '13 at 4:25
    
This worked. Thanks! –  thesamet Aug 14 '13 at 18:01
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.