View Single Post
Staro 12.03.2012., 12:37   #5
drazenram
Registered User
 
Datum registracije: Mar 2012
Lokacija: Mostar
Postovi: 8
Radi mi recimo cijeli dan i onda pukne VPN veza između routera ali oni nemaju problema lokalno internet i sve je dalje ok sa internetom unutar lokacija routeri se ne gase niti diraju.DDNS je uredno podesen i adresa od ISP-a se uredno obnavlja. Pa se bojim da promjena DDNS dinamičke adrese od ISP-a zezne stvar ili mozda grijesim evo testirucu do slijedece promjene adrese ili stvar u sam verziji softwarea routera. To sam radio sa DD_WRT v24 preSP2 (Beta)(Build14986) na oba routera i uputstvom ovim dolje uputstvom:

This is a guide for creating a point to point VPN using the PPTP client and server, for people unable / bored etc... using the OpenVPN Client

I've made this small code because DD-WRT does not allow you to save a route running on a VPN tunnel on PPTP (or at least i haven't found another way), so there is no route going back from the server network to the client network.

Basically, the guide in the Wiki is fine for creating a VPN using the PPTP server and client parts of DD-WRT. I will not repeat those instructions, since they are fine. Just follow them to setup a PPTP VPN for the following locations. However, with this example only 1 site needs a PPTP server and the other PPTP client.


So, lets say we have 2 locations , LocationA and LocationB
Net details are as follows:
LocationA
Network: 192.168.1.0/24
Router IP: 192.168.1.254

LocationB
Network: 192.168.2.0/24
Router IP: 192.168.2.254

You setup the PPTP Server on LocationA and the PPTP Client on LocationB

However, while all pc's on B will be able to access any pc on A, the other is not possible (yet), because there isn't a route from A to go back to B.

To do this, log on the CLI of DD-WRT, and type the following command:
Code:
nvram set routes='route add -net 192.168.2.0 netmask 255.255.255.0 gw 192.168.2.254'
nvram commit
This saves the variable "routes" with a route-add entry
However, we still need to apply this route AFTER the VPN Tunnel is up. To do this, we do the following:

(Again to save)
Code:
nvram set rc_startup='
nvram get routes > /tmp/routes
cat /tmp/pptpd/ip-up /tmp/routes > /tmp/pptpd/ip-temp
mv /tmp/pptpd/ip-temp /tmp/pptpd/ip-up
chmod 700 /tmp/pptpd/ip-up
'
nvram commit
This basically runs on every startup, saves the route from the nvram variable to a file, and then adds that line to the last line of the ip-up script that runs when the PPTP server establishes the connection.

Izvor: http://www.dd-wrt.com/phpBB2/viewtopic.php?p=673426

Zadnje izmijenjeno od: Nikky. 12.03.2012. u 13:25.
drazenram je offline   Reply With Quote