Прежде чем начать настройку VPN, убедитесь, что у вас настроена внутренняя сеть провайдера, вам доступны внутренние ресурсы, вы прописали (у вас прописались автоматом в случае dhcp) ip, netmask, broadcast, gateway и dns сервер.
Важное дополнение! Если ваш dns и vpn сервера находятся в других подсетях до них ОБЯЗАТЕЛЬНО нужно прописать маршруты, как к хостам!
Первое, что надо сделать - это установить следующие пакеты:
1. pptp-linux
2. ppp
Обычно все это есть в стандартной поставке дистрибутивов.
Затем, переходим в консоль и набираем: pptp-command setup
Появится такое меню:
[root@localhost ~]# pptp-command setup
1.) Manage CHAP secrets
2.) Manage PAP secrets
3.) List PPTP Tunnels
4.) Add a NEW PPTP Tunnel
5.) a PPTP Tunnel
6.) Configure resolv.conf
7.) a default tunnel
8.) Quit
?:
Жмем на 1, чтобы зайти в Manage chap-secret:
?: 1
1.) List CHAP secrets
2.) Add a New CHAP secret
3.) a CHAP secret
4.) Quit
В новом меню жмем на 2, чтобы создать новый CHAP secret
?: 2
Add a NEW CHAP secret.
NOTE: Any backslashes () must be doubled ().
Local Name:
This is the 'local' identifier for CHAP authentication.
NOTE: If the server is a Windows NT machine, the local name
should be your Windows NT username including domain.
For example:
domainusername
Local Name:
Remote Name:
This is the 'remote' identifier for CHAP authentication.
In most cases, this can be left as the default. It must be
set if you have multiple CHAP secrets with the same local name
and different passwords. Just press ENTER to keep the default.
Remote Name [PPTP]:
Password:
This is the password or CHAP secret for the account specified. The
password will not be echoed.
Password:
Adding secret My_Login PPTP *****
1.) List CHAP secrets
2.) Add a New CHAP secret
3.) a CHAP secret
4.) Quit
?:
Здесь вводим свой логин (Local Name), на Remote Name [PPTP]: жмем "Enter", далее вводим пароль на доступ в интернет, который вам предоставил провайдер, символы пароля отображаться не будут. После снова отображается меню CHAP.
Возвращаемся в главное меню (жмем 4)
Далее, в главном меню жмем 4, чтобы создать тунель ppp:
Add a NEW PPTP Tunnel.
1.) Other
Which configuration would you like to use?:
Жмем 1, для создания нового тунеля
Пишем название тунеля, например Kristall. Затем IP адрес тунеля, в нашем случае — kristall.ru:
Tunnel Name: Kristall
Server IP: kristall.ru
Далее необходимо прописать маршруты:
What route(s) would you like to add when the tunnel comes up?
This is usually a route to your internal network behind the PPTP server.
You can use TUNNEL_DEV and DEF_GW as in /etc/pptp.d/ config file
TUNNEL_DEV is replaced by the device of the tunnel interface.
DEF_GW is replaced by the existing default gateway.
The syntax to use is the same as the route(8) command.
Enter a blank line to stop.
route:
К примеру, ваш IP 10.40.32.100, gateway 10.40.32.1, сетевое устройство eth0:
add -net 10.0.0.0/8 gw 10.40.32.1 dev eth0
del default dev eth0
add default dev ppp0
Как только все роуты прописаны, жмем "Enter"
Local Name and Remote Name should match a configured CHAP or PAP secret.
Local Name is probably your NT domainusername.
NOTE: Any backslashes () must be doubled ().
Local Name:
Здесь пишем свой логин, а в следующем запросе просто жмем "Энтер" и попадаем в главное меню
Local Name: My_Login
Remote Name [PPTP]:
Adding Kristall - kristall.ru - My_Login - PPTP
Added tunnel Kristall
1.) Manage CHAP secrets
2.) Manage PAP secrets
3.) List PPTP Tunnels
4.) Add a NEW PPTP Tunnel
5.) a PPTP Tunnel
6.) Configure resolv.conf
7.) a default tunnel
8.) Quit
?:
Жмем 8
Далее необходимо подправить файл /etc/ppp/options.ppp и закоментировать (используя знак - #) в нем строки (тело файла привожу целиком, что коментировать - прокомментированно

#
# Lock the port
#
lock
#
# We don't need the tunnel server to authenticate itself
#
noauth
#
# Turn off transmission protocols we know won't be used
#
nobsdcomp
nodeflate
#
# We want MPPE
#
#mppe no40
#mppe no56
#mppe no128
#mppe required,stateless - комментируем здесь
# needed for W2K3 anyway
#refuse-eap - комментируем здесь
#
# We want a sane mtu/mru
#
#mtu 1000 - комментируем здесь
#mru 1000 - комментируем здесь
#
# Time this thing out of it goes poof
#
#lcp-echo-failure 10 - комментируем здесь
#lcp-echo-interval 10 - комментируем здесь
Все!
Подключиться к Интернет - pptp-command start Kristall
Отключиться от Интернет - pptp-command stop Kristall