InterNetCon - Internet par Satellite    

New visitor? See the services guide ...
PRÉSENTATION SERVICES PRODUITS DISTRIBUTEURS ASSISTANCE CONTACT

HOME

  Vous êtes ici: Home > Services > Internet par satellite > One Way > Documentation en ligne > Rebooter VPN linux
   English version Versiunea romana Italian version
  

SERVICES

  • Internet par satellite

ONE WAY

ONE WAY ISP ONE WAY FULL ROUTE
Courte présentation | Détails techniques | Test de la bande passante partagée | Documentation en ligne | Étude de cas | Prix | Distributeurs | Équipement | Couverture | Demande de compte de TEST | Demande de compte COMMERCIAL
 

Rebooter VPN linux - Documentation en ligne - Internet par satellite One Way

Cette documentation vous est offerte sans aucune autre obligation et nous ne nous assurons aucune responsabilité par rapport à son utilisation.

PLAIN TEXT VERSION

***********************************************************************
***   Documentation for establishing a LINUX VPN with InterNetCon        ***
***                                                    Linux                                                      ***
***                           Made By Cristian Raica (chris@sar.ro)                                ***
***********************************************************************

#!/bin/bash
# by Cristian Raica (:Chris Remy:) chris@sar.ro 06/2002
# Works on linux kernel >= 2.4
# Run this script as root
# You need (pptp) (ip) (squid)
# Configuration of dvb is standard
# This is for routing packets to vpn only for proxy web
# (squid on gateway server)
# All other trafic is normal routing to default gateway (eth0)


# Conect to server pptp with user xxx (your user account)
/sbin/pptp hsi.xanticbroadband.com user xxx
echo wait 10 seconds ...
sleep 10

# Get the local and remote IP of vpn
LOCALIP=`ip route show dev ppp0 | awk '{print $7}'`
REMOTEIP=`ip route show dev ppp0 | awk '{print $1}' `

# if no dev ppp0 exit
if [ "$LOCALIP" == "" ]; then
echo ppp0 not found.
exit 1
fi

echo Local IP : $LOCALIP
echo Remote IP : $REMOTEIP
echo -------------------

# This is the magic
# Put in /etc/iproute2/tables this line
# 200 vpn
# Add the default route for vpn the new gateway of remoteip on dev ppp0

ip route add default table vpn dev ppp0 via $REMOTEIP
ip route show table vpn
ip route flush cache

# Save old IP for first time run this not exist; don't worry;
OLDIP=`ip rule | awk '{ if ($5=="vpn") {print $3}}'`

# erase the old rule and add the new rule ( becose not exist the command
# replace)
ip rule del from $OLDIP pref 200 table vpn

# Add this new rule : all packets with source IP = LOCALIP routing ->
# REMOTEIP (table vpn)
ip rule add from $LOCALIP pref 200 table vpn
ip rule show

# This is for squid change the line tcp_outgoing_address aaa.bbb.ccc.ddd
# ( the local ip of vpn)
cat /etc/squid/squid.conf |
awk -vLIP=$LOCALIP '{ if ($1=="tcp_outgoing_address")
{ $2=LIP;}; print $0; } ' > /tmp/squid.tmp ; mv -f /tmp/squid.tmp
/etc/squid/squid.conf
service squid restart

# And this is for keep alive the vpn conection every 10 minutes
# add in crontab
# 0-59/10 * * * * root /bin/ping -c 3 -I ppp0 remoteip
cat /etc/crontab | awk -vRIP=$REMOTEIP '{ if ($7=="/bin/ping")
{ $12=RIP;}; print $0; } ' > /tmp/crontab ; mv -f /tmp/crontab /etc/crontab

# that's not all

Courte présentation | Détails techniques | Test de la bande passante partagée | Documentation en ligne | Étude de cas | Prix | Distribuiteurs | Équipement | Couverture | Demande de compte de TEST | Demande de compte COMMERCIAL

ONE WAY

ONE WAY ISP ONE WAY FULL ROUTE

Assistance

On-line documentation


Forum de discutions
Sur le forum vous pouvez discuter des problèmes au sujet de l’Internet par satellite, de design de Web et d’hébergement de Web, problèmes d’installation, de réglage, etc…


Questions fréquentes
Vous pouvez nous adresser une question ou revoir les problèmes des autres usagers concernant les services d'Internet par satellite.

Utilitaires

- Test de bande passante
- Recommande à un ami
- Questionnaires
- Newsletter

News

We cut-off the prices for unlimited services:
- Check out the new unlimited services prices











Home | Présentation | Services | Produits | | Distributeurs | Assistance | Contact | Carte du site

Termes et Conditions

© 2007 InterNetCon - Internet par Satellite.
Tous les droits réservés.
Firma de web design Cluj-Napoca