3

I've set up a home network with two routers (TEW-692GR and another one from TP-LINK), but neither supports on-site VPN server configuration. I stuffed my RPi with Raspbian into the box with my router and turned it into a PPTP server, however I found it impossible for external computers (VPN clients) to obtain a local IP in my subnetwork (192.168.56.XXX). In the PPTPD config files I found that it is only possible when the device (RPi in my case) distributes IP addresses, so I decided I would turn it into a DHCP server for my router and disable DHCP capabilities on my main router.

The main question is, how is it possible to turn RPi into a DHCP server with WAN running through my primary router and RPi connected to the LAN port of that router? I'm not really into turning my RPi into a WiFi access point, since the dongle I'd be using sacrifices overall network performance.

1
  • can you show the output of ifconfig of obe of the connected vpn clients? give us some more details...
    – Gotschi
    Commented Aug 9, 2014 at 19:42

1 Answer 1

4

There is no reason why the WiFi access point and the DHCP server have to run on the same host, you can have your router do the former and the RPi to the latter.

I seem to be running exactly what you want to set up:

  1. One box, the DSL (or cable or fiber or whatever) router takes care of the internet connection and provides a wireless network - an AVM FritzBox 7390 in my case, one of your two routers in your case. IMPORTANT: Use only one router at a time, using both is asking for trouble.
  2. A Raspberry Pi is connected to one of the wired network connections of that router and provides DHCP, DNS and VPN services using Dnsmasq. As there should be only one host responsible for these services on a (home) network, they are disabled on the DSL router.

I have set up the DSL router to have a static IP address of the first in my subnet, let's say 192.168.56.1 and the RPi to have 192.168.56.2. The DSL router is also the gateway for the network (i.e. the "way out" to other networks), so the RPi advertises that as a DHCP option.

In order to provide VPN services, the RPi must be accessible from the outside, so the DSL router forwards network port UDP 1194 to the RPi.

I don't know what PPTP is and I have never heard of it, but setting up things here as described took only very little effort and everything has been running smoothly for a couple of years now; this might be an indication that you're on the wrong track with PPTP.

PS: Oh yeah, I forgot: dnsmasq also supports booting over the network which is very convenient when setting up new virtual machines.

PPS: Disclaimer: It does make sense to have more than one DNS and VPN server, so the second takes over if the first one fails, but that's something to tackle once the basics are in place

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.