Jump to content
Facebook Twitter Youtube

[Tutorial] VPN server pe FreeBSD


Recommended Posts

Verificati daca colectia de porturi este actualizata.

Instalati poptop din /usr/ports/net/poptop:

root@bsdpc[/usr/ports/net/poptop] # make install clean

Folosind editorul de text preferat, editam fisierul de configurare /usr/local/etc/pptpd.conf care va contine urmatoarele:

nobsdcomp

proxyarp

pidfile /var/run/pptpd.pid

+chapms-v2

mppe-40

mppe-128

mppe-stateless

Editam fisierul de configurare PPP, /etc/ppp/ppp.conf, astfel incat sa contina:

loop:

set timeout 0

set log phase chat connect lcp ipcp command

set device localhost:pptp

set dial

set login

# Server (local) IP address, Range for Clients, and Netmask

set ifaddr 192.168.31.254 192.168.31.120-192.168.31.128 255.255.255.255

set server /tmp/vpn-in-%d “” 0177

loop-in:

set timeout 0

set log phase lcp ipcp command

allow mode direct

pptp:

load loop

disable pap

disable passwdauth

disable ipv6cp

enable proxy

accept dns

enable MSChapV2

enable mppe

disable deflate pred1

deny deflate pred1

set device !/etc/ppp/secure

Toate liniile cu exceptia celor care se termina cu doua puncte (:) trebuie identate (spatiu fata de margine dat de tasta TAB), altfel ppp.conf nu va functiona.

Adaugam fisierul /etc/ppp/secure cu urmatorul continut:

#!/bin/sh

exec /usr/sbin/ppp -direct loop-in

Setam acest fisier ca executabil:

root@bsdpc[~] # chmod 0755 /etc/ppp/secure

Adaugam fisierul cu username-urile si parolele pentru conectare la VPN, /etc/ppp/ppp.secret, care va arata in felul urmator:

user1 pass1

user2 pass2

Activam ARP proxy adaugand linia net.link.ether.inet.proxyall=1 in fisierul /etc/sysctl.conf

Pentru a activa ARP Proxy fara reboot la sistem rulam urmatoarea comanda:

root@bsdpc[~] # sysctl net.link.ether.inet.proxyall=1

Setam serverul VPN sa porneasca la initializarea sistemului adaugand in /etc/rc.conf linia

pptpd_enable=”YES”

Pornim serverul VPN cu comanda:

root@bsdpc[~] # /usr/local/etc/rc.d/pptpd start

Verificati firewall-ul sa acepte conexiuni tcp pe portul 1723 si deasemenea sa accepte conexiuni pe protocolul gre. Pentru un firewall folosind packet filter in fisierul de configurare trebuie sa aveti urmatoarele linii:

pass in quick on $ext_if proto tcp from any to any port 1723 keep state

pass in quick on $ext_if proto gre from any to any

Nota:

Default cand se creeaza o conexiune de tip VPN sistemul de operare Windows acesta modifica tabela de rutare astfel incat toate conexiunile vor trece prin serverul VPN. Pentru a va pastra conexiunea la internet ca in mod normal la proprietatile conexiunii catre serverul VPN trebuie debifata optiunea Use default gateway on remote network. [CLICK pentru exemplu folosind Windows XP]

Job Done!

Enjoy

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

WHO WE ARE?

CsBlackDevil Community [www.csblackdevil.com], a virtual world from May 1, 2012, which continues to grow in the gaming world. CSBD has over 70k members in continuous expansion, coming from different parts of the world.

 

 

Important Links