Ahoy, > [...] > Same for the openVPN. I use privateinternetaccess service. I ran > "openvpn US\ Seattle.ovpn" to start the vpn and that gives me the tun0 > with IP on it. Then I have run the following to move the tun0 to the > rdomain200 manually. > [...] > However, when the openvpn times out or reconnects, it gives tun0 new > IP and puts tun0 back in the default rdomain (0?). So I have to > manually do this all over again... So anyway to configure it, maybe by > editing the ovpn file? > [...]
OpenVPN has a mechanism that allows using a user supplied script to do the device configuration instead of having OpenVPN do that by itself. I use the following for my IPredator VPN: # --- 8< --- SNIP --- 8< --- script-security 2 # Allows OpenVPN to execute scripts ifconfig-noexec route-noexec route-up /etc/openvpn/ipredator/up.sh up /etc/openvpn/ipredator/up.sh # --- 8< --- SNAP --- 8< --- The script looks like this: # --- 8< --- SNIP --- 8< --- #!/bin/ksh case "${script_type}" in up) /sbin/ifconfig "${dev}" "${ifconfig_local}" \ netmask "${ifconfig_netmask}" mtu "${tun_mtu}" rdomain 3 ;; route-up) route -T3 add default ${route_vpn_gateway} ;; *) echo "Unknown script type ${script_type}" | logger -t up ;; esac # --- 8< --- SNAP --- 8< --- -- Gregor