VPNScript

Introduction
In this tutorial, you will know how to make a VPN from a network bridge. (We will use OpenVPN to make the bridge but you can use PPP as well) In my University, I must keep active a web-browser on a special webpage to have access to the internet. So here we are: We must twice:
 * Redirect special IPs to the original network
 * Redirect other trafic to our bridge

Physical network
Assuming:
 * You wants to access you VPN from a laptop at work
 * Your VPN server has a static IP or a domain name ( go to http://www.dyndns.org to get a free one )
 * Your server as a OpenVPN server ready an accessible (type telnet server port and see if you see some strange characters)

Step1: setting our virtual ethernet device
As mentioned before, we will use OpenVPN to bring up a bridge:

Now, bring the /dev/tap0:

Set up your openvpn to work on the tap device

Step2: finding IP that must be accessed from the physical network of the laptop
In case you don't know the list of IPs, I made a script that grab them

vim /sbin/vpn-ipconfigurator

Okay, this big script only calls tcpdump on the specified interface, and write the IPs into /etc/vpn.resolv.conf We will the /etc/conf.d/vpnscript file later

Step3: Writting configuration file of your VPN
vim /etc/conf.d/vpnscript

Step4: Changing the routes
Now we had the configuration file, run :

vim /etc/init.d/vpnscript

That's all folks ! Now with

To stop the service, do
 * the virtual ethernet device will be brought up
 * openvpn will be started
 * only 'new' trafic will be redirected to the vpn tunnel