Archive for 八月 3rd, 2011

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 : (if you are not installing on fc14 please just browser the parent folder and find yourself the correct version) wget   3. Install pptpd: rpm -ivh pptpd-1.3.4-2.fc14.x86_64.rpm   4. vim /etc/pptpd.conf Edit these 2 lines: localip remoteip (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 ms-dns (Dns for the guest to use. These 2 are from openDns. Surely you can set whatever you like., 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/ 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/ Step 2 Create File vi /etc/csf/ Input Text down service pptpd stop service pptpd start Save File chmod +x/etc/csf/ 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: