[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: kwame.bahena@xxxxxxxxxxx
  • Date: Thu, 08 Feb 2007 16:04:51 +0000

 -------------- 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