This instruction describes the installation and configuration of a PPTP server running Debian GNU/Linux Squeeze.
PPTPA point-to-point tunneling protocol that allows a computer to establish a secure connection to the server by creating a special tunnel in a standard, unsecured network.
The IP address of the server in the locale should be 192.168.0.1
IP addresses in the VPN will be 192.168.2.0/24
Start installing the necessary programs:
aptitude install ppp pptpd arno-iptables-firewall
Now we're going to set up.
The first thing we do is open the file in the editor. /etc/pptpd.conf And we add the following lines at the end:
vi /etc/pptpd.conf # IP-адрес сервера в локальной сети localip 192.168.2.200 # Диапазон адресов для клиентов PPTP сервера которые выдаются автоматически remoteip 192.168.2.221-239
Add to the file. /etc/ppp/pptpd-options the following lines:
vi /etc/ppp/pptpd-options # требуем авторизацию у клиентов auth # Используем шифрование require-mppe # Адрес DNS-сервера, который будет передаваться клиенту ms-dns 192.168.0.1 # Не пытаться восстановить соединение после отключения клиента # Если не указать эту опцию - pptpd будет безуспешно восстанавливать соединение и ругаться в логи nopersist # Укажем файл, в который писать лог: logfile /var/log/pptpd.log
We save the configuration file and create the log file with the command:
touch /var/log/pptpd.log
Go to setting passwords in the file /etc/ppp/chap-secrets
Add by example:
vi /etc/ppp/chap-secrets # Если пользователь получает динамический IP-адрес из диапазона remoteip(220-239), что находится в конфигурационном файле pptpd.conf: user1 pptpd passworduser1 "*" # Если мы привязываем определённый IP к логину клиента добавляем: user2 pptpd passworduser2 "192.168.2.110"
Then we restart pptpd:
/etc/init.d/pptpd restart
Let’s move on to setting up our firewall script. arno-iptables-firewallIt creates rules for iptables based on configuration files.
Allow the GRE protocol for everyone:
Add the DC_OPEN_IP variable to the file /etc/arno-iptables-firewall/firewall.conf
vi /etc/arno-iptables-firewall/firewall.conf
was:
OPEN_TCP="$DC_OPEN_TCP" OPEN_UDP="$DC_OPEN_UDP" OPEN_IP=""
became:
OPEN_TCP="$DC_OPEN_TCP" OPEN_UDP="$DC_OPEN_UDP" OPEN_IP="$DC_OPEN_IP"
File in. /etc/arno-iptables-firewall/debconf.cfg variable DC_OPEN_IP Open the GRE protocol to the server.
was:
vi /etc/arno-iptables-firewall/debconf.cfg # включаем NAT: DC_NAT=1 # указываем внешнюю сетевую карту: DC_EXT_IF="eth1" # открываем порт 1723 для работы vpn: DC_OPEN_TCP="1723" # Указываем внутренние сетевые интерфейсы eth0 - внутренняя сеть, ppp+ - VPN интерфейсы (ppp0,ppp1...ppp10...): DC_INT_IF="eth0 ppp+" # Указываем внутренние сети локальную и VPN: DC_INTERNAL_NET="192.168.0.0/24 192.168.2.0/24" # Открываем NAT для локальной сети и VPN сети: DC_NAT_INTERNAL_NET="192.168.0.0/24 192.168.2.0/24" # Разрешаем пинг снаружи на сервер DC_OPEN_ICMP=1
became:
vi /etc/arno-iptables-firewall/debconf.cfg # включаем NAT: DC_NAT=1 # указываем внешнюю сетевую карту: DC_EXT_IF="eth1" # открываем порт 1723 для работы vpn: DC_OPEN_TCP="1723" # Указываем внутренние сетевые интерфейсы eth0 - внутренняя сеть, ppp+ - VPN интерфейсы (ppp0,ppp1...ppp10...): DC_INT_IF="eth0 ppp+" # Указываем внутренние сети локальную и VPN: DC_INTERNAL_NET="192.168.0.0/24 192.168.2.0/24" # Открываем NAT для локальной сети и VPN сети: DC_NAT_INTERNAL_NET="192.168.0.0/24 192.168.2.0/24" # Разрешаем пинг снаружи на сервер DC_OPEN_ICMP=1 DC_OPEN_IP="47"
Reboot ARNO with the command:
If you are using a self-written script iptablesThen you need to add the following lines to your script:
# Разрешаем протокол GRE для всех; iptables -A INPUT -p gre -j ACCEPT # Разрешаем соединение с PPTP-сервером для всех; iptables -A INPUT -m tcp -p tcp --dport 1723 -j ACCEPT
Now you can ping our server 192.168.0.1 and use the Internet through it.
This is the setting. VPN server PPTP finished, if you need to connect to a VPN server from Windows, you just need to read the instructions: Instructions for connecting to the PPTPD server from Windows.
I was with you. Sergey LazarenkoIf you like the article, subscribe to receive updates from the site to your email. And also please share with friends this instruction by clicking on the icon of your social network.



comment