VPN:Linux

Материал из База знаний
Версия от 12:07, 10 февраля 2016; A-zazell (обсуждение | вклад)

(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск

Здравствуйте, по шагам: Устанавливаем, если еще не установлен, пакет:

root@debian:/etc# aptitude install pptp-linux
root@debian:/etc# cd /etc/ppp/

Настраиваем файлы конфигурации:

root@debian:/etc/ppp# cat options.pptp
lock
noauth
nobsdcomp
nodeflate

root@debian:/etc/ppp# cat peers/bisv
pty "pptp internet --nolaunchpppd"
name <Здесь Ваш Логин VPN>
remotename PPTP
file /etc/ppp/options.pptp
ipparam bisv
defaultroute
replacedefaultroute
usepeerdns

root@debian:/etc/ppp# cat chap-secrets
# Secrets for authentication using CHAP
# client server secret IP addresses
<Здесь Ваш Логин VPN> PPTP <Здесь Ваш Пароль VPN> *

Включаем VPN соединение:

root@debian:/etc/ppp# pon bisv

Смотрим:

root@debian:/etc/ppp# ifconfig
ppp0 Link encap:Point-to-Point Protocol
         inet addr:10.10.200.241 P-t-P:10.1.1.1 Mask:255.255.255.255
         UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
         RX packets:7 errors:0 dropped:0 overruns:0 frame:0
         TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:3
         RX bytes:312 (312.0 B) TX bytes:266 (266.0 B)

Проверяем маршруты:

root@debian:/etc/ppp# netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
10.1.1.1 10.7.8.1 255.255.255.255 UGH 0 0 0 eth0
10.1.1.1 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0
...
0.0.0.0 0.0.0.0 0.0.0.0 U 0 0 0 ppp0

Проверяем доступность Internet:

root@debian:/etc/ppp# traceroute -n -4 ya.ru
traceroute to ya.ru (93.158.134.3), 30 hops max, 60 byte packets
1 10.1.1.1 14.039 ms 13.936 ms 13.900 ms
2 93.190.16.24 13.867 ms 13.837 ms 13.806 ms
3 93.190.21.22 13.776 ms 13.740 ms 13.708 ms
4 93.190.22.21 13.668 ms 13.596 ms 13.565 ms
5 217.150.50.42 24.661 ms 24.632 ms 24.602 ms
6 188.43.3.213 357.432 ms 342.336 ms 342.271 ms
7 213.180.213.70 342.222 ms 342.181 ms 342.141 ms
8 93.158.134.3 342.101 ms 342.060 ms 341.954 ms

root@debian:/etc/ppp# ping ya.ru
PING ya.ru (87.250.251.3) 56(84) bytes of data.
64 bytes from www.yandex.ru (87.250.251.3): icmp_req=1 ttl=50 time=42.7 ms
64 bytes from www.yandex.ru (87.250.251.3): icmp_req=2 ttl=53 time=36.8 ms
64 bytes from www.yandex.ru (87.250.251.3): icmp_req=3 ttl=50 time=43.9 ms
^C
--- ya.ru ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 36.884/41.210/43.966/3.101 ms

Готово. Можно еще посмотреть материалы по теме: [1] [2]