OESF Portables Forum

Everything Else => General Support and Discussion => Zaurus General Forums => Archived Forums => Security and Networking => Topic started by: bit_bucket on January 03, 2005, 06:02:00 pm

Title: Finally Got Vpnc To Work
Post by: bit_bucket on January 03, 2005, 06:02:00 pm
I have been having one heck of a time getting vpnc to work.  I initially got it to connect to the conc. 3000 server at my work and I even got an IP address, set up the P2P tun interface and set the default routes, but I could never get anywhere.

The solution was way to easy, I can't believe I did not see it right off the bat.  My problem was there where no DNS servers in the resolv.conf that could be found/used, so what I did was tack on the following lines of code to the end of the default vpnc-connect and disconnect scripts and voala, I am golden....

vpnc-connect (Add to the end of the file)

# Set up resolv.conf file
cp /etc/resolv.conf /etc/resolv.vpnc.sv
cat /dev/null > /etc/resolv.conf
echo "domain $CISCO_DEF_DOMAIN" > /etc/resolv.conf
echo 'search (insert search string here)' >> /etc/resolv.conf
for netmask in `echo $INTERNAL_IP4_DNS`
do
  echo "nameserver $netmask" >> /etc/resolv.conf
done
echo "$CISCO_BANNER"
exit 0

vpnc-disconnect (Add to the end of the file)
# Remove resolv.conf customizations
if [ -s /etc/resolv.vpnc.sv ]; then
        mv /etc/resolv.sera.sv /etc/resolv.conf
fi
exit 0

Note the final exit string was already in the script.  I just put my lines before it.  Your milage may very.  There are many other things you could set up if needs be, just take a look at some of the variables used in vpnc-connect..

enjoy..