On 2017-10-04 10:20 AM, Iliana Panagopoulou wrote:
> 
> 
> On 10/04/2017 04:45 PM, Simon Deziel wrote:
>> Hi Iliana,
>>
>> On 2017-10-04 09:10 AM, Iliana Panagopoulou wrote:
>>>     * What led up to the situation?
>>> Added 'dhcp-option DNS x.x.x.x' to my openvpn's server.conf but my
>>> Debian client could not get the DNS.
>> When added server side, "push" is required for this option to be sent to
>> the client.
>>
>>> One, I added a second line 'push dhcp-option DNS x.x.x.x' under the
>>> first one and then the script parsed it correctly and all worked as
>>> expected.
>> That's the right way to configure it as far as I know.
> 
> Originally I had a single push line like so:
> push "dhcp-option DNS X.X.X.X"
> 
> which didn't work so I started debugging the script only to find out
> that the value passed to resolvconf wasn't acceptable due to the
> lack of a newline at the "EOF"

That's weird as the relevant line in the script does add a newline by
having the double quote closed on the next line:

        for NS in $NMSRVRS ; do
                R="${R}nameserver $NS
"
        done
        echo -n "$R" | /sbin/resolvconf -a "${dev}.openvpn"

In order to debug this further, would you mind running those commands
(as root) and share the output:

ls -l /etc/resolv.conf
for f in /etc/resolv.conf /run/resolvconf/interface/*; do
  echo "pre $(basename $f):"
  cat "$f"
done
TRUNCATE_NAMESERVER_LIST_AFTER_LOOPBACK_ADDRESS=no \
  foreign_option_1='dhcp-option DNS 4.2.2.1' \
  dev=tun0 script_type=up \
  /etc/openvpn/update-resolv-conf

for f in /etc/resolv.conf /run/resolvconf/interface/*; do
  echo "up $(basename $f):"
  cat "$f"
done

TRUNCATE_NAMESERVER_LIST_AFTER_LOOPBACK_ADDRESS=no \
  foreign_option_1='dhcp-option DNS 4.2.2.1' \
  dev=tun0 script_type=down \
  /etc/openvpn/update-resolv-conf

for f in /etc/resolv.conf /run/resolvconf/interface/*; do
  echo "down $(basename $f):"
  cat "$f"
done


Thanks,
Simon

Reply via email to