How to setup pptp vpn server on linux (fedora 14)

03 8月
All in root:   1.Get ppp installed: yum install ppp ppp-devel   2. Get pptpd from : http://poptop.sourceforge.net/yum/stable/fc14/x86_64/ (if you are not installing on fc14 please just browser the parent folder and find yourself the correct version) wget http://poptop.sourceforge.net/yum/stable/fc14/x86_64/pptpd-1.3.4-2.fc14.x86_64.rpm   3. Install pptpd: rpm -ivh pptpd-1.3.4-2.fc14.x86_64.rpm   4. vim /etc/pptpd.conf Edit these 2 lines: localip 10.0.0.1 remoteip 10.0.0.10-100 (You can customize the ips. The first one is for the host in your future virtual network and the second is the range for the guests)   5. vim /etc/ppp/options.pptpd Edit the ms-dns lines: ms-dns 208.67.222.222 ms-dns 208.67.220.220 (Dns for the guest to use. These 2 are from openDns. Surely you can set whatever you like. 8.8.8.8, 8.8.4.4 may also be a nice choice. They are Google's DNS.)   6. Setup user/passwd: vim  /etc/ppp/chap-secrets Follow the comments in the file write something like this: username pptpd password * username2 pptpd password2 * (The * at the end means open access for all the ips. Of course if you want to specify one,  just serve yourself. )   7. IP forward vim /etc/sysctl.conf Edit this line: net.ipv4.ip_forward = 1 To make this take effect: sysctl -p   8.  iptables or firewall If you are using csf as I do you will have to do this: Step 1 Create File vi /etc/csf/csfpre.sh Input Text down iptables -A INPUT -i eth0 -p tcp --dport 1723 -j ACCEPT iptables -A INPUT -i eth0 -p gre -j ACCEPT iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE iptables -A FORWARD -i ppp+ -o eth0 -j ACCEPT iptables -A FORWARD -i eth0 -o ppp+ -j ACCEPT Save File chmod +x /etc/csf/csfpre.sh Step 2 Create File vi /etc/csf/csfpost.sh Input Text down service pptpd stop service pptpd start Save File chmod +x/etc/csf/csfpost.sh restart csf+lfd (web interface or command line ) I also opened 1723 port in csf.conf file, which might not be necessary.   If you are not using it then you just need to run the commands in the .sh files above. After restart everything should work then.   Reference: http://blog.plite.org/neo_one2199/2011/04/03/installing-and-configuring-pptp-vpn-on-rhelcentos-5/ http://forum.configserver.com/viewtopic.php?p=8449      

Tags:

One Response

Leave a Reply

貓熊寶寶幼齒園

姜經緯的博客