BizarNet - Satellite Internet Services

ABOUT SERVICES PRODUCTS RESELLERS SUPPORT CONTACT

HOME

  You are here: Home > Services > Satellite internet > One Way > On-line documentation > VPN settings linux
   Versiunea romana
  

SERVICES

  • Satellite internet

ONE WAY

ONE WAY ISP TWO WAY SMALL ISP TWO WAY AFRICA
Brief presentation | Technical details | Bandwidth test | On-line documentation | Case study | Prices Resellers | Equipment | Coverage | Test account request form | Comercial account request form
 

VPN settings linux - On-line documentation - Satellite internet

This documentation it is provided as it and we do not assume any responsibility over it.

PLAIN TEXT VERSION

***********************************************************************
***               Documentation for establishing a LINUX VPN with BizarNet               ***
***                                                    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 

Brief presentation | Technical details | Bandwidth test | On-line documentation | Case study | Prices Resellers | Equipment | Coverage | Test account request form | Comercial account request form

ONE WAY

ONE WAY ISP TWO WAY SMALL ISP TWO WAY AFRICA

Other services:

Support

Wireless
Satellite internet
Software
Web design


Discussion forum
On forum you can talk about almost all problems with satellite internet, web design and web hosting.


FAQ
You can ask a question, or see some problems that other users had regarding our Satellite Internet Services

Utils

- Bandwidth test
- Tell to a friend about this page
- Questionaire
- Newsletter

News

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


Home | About | Services | Products | Support | Resellers | Contact | Site map | Parametrii de Calitate
© 2007 BizarNet - Satellite Internet Services. All right reserved.
Terms and Conditions
One way Satellite Internet service provider


Firma de web design Cluj-Napoca