Linux

تنظيمات VPN در Fedora و CentOS در محيط Shell

براي ايجاد يک کانکشن وي پي ان در لينوکس  مراحل زير را دنبال نماييد.

روش اول:

جهت ايجاد کانکشن وي پي ان در لينوکس ابتدا مخازن لینوکس خود را از این طریق به مخازن  داخلی تبدیل می نماییم

 

step 1 =yum install pptp pptp-setup net-tools

step 2= pptpsetup --create vpnconnection --server net.iut.ac.ir --username *** --password

در اين قسمت بجاي net.iut.ac.ir آدرس vpn server مربوطه را نوشته و بجاي *** نيز نام کاربري خود را وارد نماييد

step 3 = pppd call vpnconnection

step 4 =route add -net 0.0.0.0 netmask 0.0.0.0 ppp0

route add -net  172.16.0.0 netmask 255.255.0.0 yourether

 route add -net  192.168.0.0 netmask 255.255.0.0 yourether

route add -net  194.146.151.0 netmask 255.255.255.0  yourether

route add -net  176.101.52.0 netmask 255.255.255.0 yourether

route add -net  176.101.51.0 netmask 255.255.255.0 yourether

 

Disconnect PPTP server vpn connection

1- yum install psmisc

 2- killall pppd

or

 kill -9 PID

Adding pptp service to firewall service (if not connection will not work)

firewall-cmd --permanent --direct --add-rule ipv4 filter INPUT 0 -p gre -j ACCEPT

firewall-cmd --reload

----------------------------------------------------------------------------------------------------------------

روش دوم

جهت ايجاد کانکشن وي پي ان در لينوکس 32 بيتي از روش زير استفاده نماييد.

 

step1 = download

pptp-1.7.2-8.1.el5.rf.i386.rpm

pptp-setup-1.7.2-8.1.el5.rf.i386.rpm

step2 = rpm -ivh pptp-1.7.2-8.1.el5.rf.i386.rpm

step3 = rpm -ivh pptp-setup-1.7.2-8.1.el5.rf.i386.rpm

 

 step 4= pptpsetup --create vpnconnection --server net.iut.ac.ir --username *** --password

step 5 = pppd call vpnconnection

step 6 =route add -net 0.0.0.0 netmask 0.0.0.0 ppp0

route add -net  172.16.0.0 netmask 255.255.0.0 yourether

 route add -net  192.168.0.0 netmask 255.255.0.0 yourether

route add -net  194.146.151.0 netmask 255.255.255.0  yourether

route add -net  176.101.52.0 netmask 255.255.255.0 yourether

route add -net  176.101.51.0 netmask 255.255.255.0 yourether

 

Disconnect PPTP server vpn connection

 killall pppd

or

 kill -9 PID

جهت ايجاد کانکشن وي پي ان در لينوکس 64 بيتي از روش زير استفاده نماييد.

step1 = download

/pptp-1.7.2-8.1.el5.rf.x86_64.rpm

pptp-setup-1.7.2-8.1.el5.rf.x86_64.rpm

 step2 = rpm -ivh pptp-1.7.2-8.1.el5.rf.x86_64.rpm

step3 = rpm -ivh pptp-setup-1.7.2-8.1.el5.rf.x86_64.rpm

 step 4= pptpsetup --create vpnconnection --server net.iut.ac.ir --username *** --password

step 5 = pppd call vpnconnection

step 6 =route add -net 0.0.0.0 netmask 0.0.0.0 ppp0

route add -net  172.16.0.0 netmask 255.255.0.0 yourether

 route add -net  192.168.0.0 netmask 255.255.0.0 yourether

route add -net  194.146.151.0 netmask 255.255.255.0  yourether

route add -net  176.101.52.0 netmask 255.255.255.0 yourether

route add -net  176.101.51.0 netmask 255.255.255.0 yourether

 

Disconnect PPTP server vpn connection

 killall pppd

or

 kill -9 PID

 

روش سوم

براي مواقعي که بخواهيد RPM PPTP را از اينترنت دانلود نماييد.

 

ابتدا بايستي ريپازيتوري RPMForge را با استفاده از راهنماي موجود در سايت CentOS بر روي سيستم هاي خود نصب کرده , و سپس با استفاده از مراحل زير پکيج هاي مربوطه را نصب نماييد.

step1  =  yum install pptp pptp-setup --enablerepo=rpmforge

 step 2= pptpsetup --create vpnconnection --server net.iut.ac.ir --username *** --password

در اين قسمت بجاي net.iut.ac.ir آدرس vpn server مربوطه را نوشته و بجاي *** نيز نام کاربري خود را وارد نماييد

step 3 = pppd call vpnconnection

step 4 =route add -net 0.0.0.0 netmask 0.0.0.0 ppp0

route add -net  172.16.0.0 netmask 255.255.0.0 yourether

route add -net  172.16.0.0 netmask 255.255.0.0 yourether

 route add -net  192.168.0.0 netmask 255.255.0.0 yourether

route add -net  194.146.151.0 netmask 255.255.255.0  yourether

route add -net  176.101.52.0 netmask 255.255.255.0 yourether

route add -net  176.101.51.0 netmask 255.255.255.0 yourether

 

Disconnect PPTP server vpn connection

 killall pppd

or

 kill -9 PID

------------------------------

 

همچنين از آدرس زير نيز ميتوانيد در مورد نحوه نصب وي پي ان کانکشن در لينوکس خود ،اطلاعات بيشتري کسب نماييد

http://www.cyberciti.biz/tips/howto-configure-ubuntu-fedora-linux-pptp-client.html

 

 

 

تنظيمات vpn در Fedora

 

 

VPN Connection Setup : Step 1. Choose System > Administration > Add/Remove
Software If you are prompted for a password, enter the root password to continue.

Adding and removing software requires root authority.

VPN Connection Setup : Step 2. In the search field, enter "pptp" and click "Find". When the matching software packages appear, click the box next to the NetworkManager VPN plugin for pptp and then click "Apply". When prompted about the additional packages to be installed, click "Install". If Fedora prompts you to run the new application, just click "Close".

 

 

VPN Connection Setup : Step 3. Click on the NetworkManager applet in the panel (usually at the top of the screen) and choose VPN Connections > Configure VPN


 

 

VPN Connection Setup : Step 4. In the Network Connections dialog, click "Add".connection type, then click "Create". 

VPN Connection Setup : Step 5. Choose Point-to-Point Tunneling Protocol (PPTP) as the connection type, then click "Create".

 

VPN Connection Setup : Step 6. On the Editing VPN connection dialog, enter the following values: Connection name: SwissVPN (or another name of your choosing) Gateway:faculty : vpn1.iut.ac.ir or student: net.iut.ac.ir  User name email iut : put your assigned username here Password: put your assigned password here Then click "Advanced".

 

 

VPN Connection Setup : Step 7. Deselect (uncheck) the following authentication methods: PAP, CHAP, MSCHAP. Only MSCHAPv2 and EAP should be selected. Select "Use Point-to-Point encryption (MPPE)". Click "OK" then click "Apply". If you are prompted to protect the keyring, enter a password of your choosing twice, then click "OK". Click "Close" to close the Network Connections dialog.

 

VPN Connection Setup : Step 8. To activate the VPN connection, click the NetworkManager applet, then choose VPN Connections > SwissVPN

 

VPN Connection Setup : Step 9. The NetworkManager applet will show a swirling icon until the connection is established. If the VPN connection is successful, the icon will show a lock symbol.

 

 

 

 

تنظيمات vpn در Ubuntu

First off, we need to install the required software to utilize the VPN service. You can use the command line or GUI package manager to do this.
To install from command line, open up the "Terminal" application, found in "Applications -> Accesories".

 

 

Then write the command: sudo apt-get install pptp-linux at the prompt.

 

 

Using the search box at the topK type pptp-linux to search for the package.

 

 

Once found, click on the check box beside it, then click Apply to execute the command.

 

 

Click on the network icon, at the top right, and choose "VPN Connections -> Configure VPN"

 

 

Create a new VPN profile by clicking on the Add button.

 

 

Be sure to choose "Point-to-Point Tunneling Protocol (PPTP)" from the list then click Create.

 

 

You can choose any name you like, we recommend "VPN On Demand", then fill the information as follows:
Gateway:  net.iut.ac.ir
User name: usually the email you used to register with
Password: your own password
then click on Advanced to finish the setup.

 

 

In the "PPTP Advanced Options" window, make sure to check "Use Point-to-Point encryption (MPPE)" as shown below, then unclick OK until all windows are closed and you're done.

 


 

You'll only need to perform the steps 1 to 6 for first use of VPNOD.com service. Using this service will be easier later on.
Click on the Network icons from the top bar, as shown in the screen shot and choose "VPN Connections -> VPN On Demand". Ofcourse, VPN On Demand is the name you chose in step 5

 

 

  1. Finally, wait for a few seconds while the connection is established. The next time you need to connect to the service, you'll only need to perform the 7'th step.