[OpenVPN home] [Date Prev] [Date Index] [Date Next]
[OpenVPN mailing lists] [Thread Prev] [Thread Index] [Thread Next]
Google
 
Web openvpn.net

Re: [Openvpn-users] pushing server's dns to client


  • Subject: Re: [Openvpn-users] pushing server's dns to client
  • From: Nathaniel Powning <nat@xxxxxxxxxxx>
  • Date: Thu, 8 Feb 2007 04:39:14 -0800 (PST)

Hmm, that looks good to me except perhaps you might use a full path for 
the scripts in client.conf.

On Thu, 8 Feb 2007, kwame.bahena@xxxxxxxxxxx wrote:

> -------------- Original message ----------------------
> From: Nathaniel Powning <nat@xxxxxxxxxxx>
>> The values are only available to the script specified by the --up option,
>> not your shell sessions.  You could have a post-connect script rewrite
>> your resolv.conf file using the foreign_option_{n} values.
>>
>
> That's what I'm tring to d. At the end of my
> /etc/openvpn/client.conf looks like this:
>
> # Scripts can be used to do various
> # things (change nameservers, for
> # example.
> up scripts/vpn_up.sh
> down scripts/vpn_down.sh
>
> the vpn_up.sh script looks like this:
>
> #!/bin/bash
>
> env | \
> fgrep foreign_option_ | \
> sed 's/^.* DOMAIN/search/
>      s/^.* DNS/nameserver/' > /tmp/resolv.conf
>
> cp /etc/resolv.conf /etc/resolv.conf.novpn
>
> cp /tmp/resolv.conf /etc/resolv.conf
>
> exit 0
>
> But when I try to establish connection I get this in my /var/log/messages:
> Feb  8 09:33:15 desktop-home openvpn[2711]: OPTIONS IMPORT: timers and/or timeouts modified
> Feb  8 09:33:15 desktop-home openvpn[2711]: OPTIONS IMPORT: --ifconfig/up options modified
> Feb  8 09:33:15 desktop-home openvpn[2711]: OPTIONS IMPORT: route options modified
> Feb  8 09:33:15 desktop-home openvpn[2711]: OPTIONS IMPORT: --ip-win32 and/or --dhcp-option options modified
> Feb  8 09:33:15 desktop-home openvpn[2711]: TUN/TAP device tun0 opened
> Feb  8 09:33:15 desktop-home openvpn[2711]: TUN/TAP TX queue length set to 100
> Feb  8 09:33:15 desktop-home openvpn[2711]: /sbin/ip link set dev tun0 up mtu 1500
> Feb  8 09:33:15 desktop-home openvpn[2711]: /sbin/ip addr add dev tun0 local 10.1.4.14 peer 10.1.4.13
> Feb  8 09:33:15 desktop-home openvpn[2711]: scripts/vpn_up.sh tun0 1500 1541 10.1.4.14 10.1.4.13 init
> Feb  8 09:33:15 desktop-home openvpn[2711]: script failed: shell command exited with error status: 126
> Feb  8 09:33:15 desktop-home openvpn[2711]: Exiting
>
> So, something is wrong there, any help?
>
> Best regards,
> -- 
> Kwame Bahena
>
______________________
OpenVPN mailing lists
https://lists.sourceforge.net/lists/listinfo/openvpn-users