User Tools

Site Tools



This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
vpn-rpi4 [2020/04/30 08:58]
robm [Setup]
vpn-rpi4 [2020/04/30 09:16]
robm [Desired outcome]
Line 6: Line 6:
     * ''​eth0''​ (wired) connected to home network:     * ''​eth0''​ (wired) connected to home network:
       * CIDR: ''​​24''​       * CIDR: ''​​24''​
 +      * DHCP range: ''​''​ to ''​''​
       * Gateway / router: ''​''​       * Gateway / router: ''​''​
Line 18: Line 19:
   * ... via home network when it is now   * ... via home network when it is now
 +===== Strategy =====
 +Create a new WiFi network (''​teleport''​) which is **bridged** with the wired network, so traffic can flow between them. For this to work, the DHCP ranges of the two networks should be in the _same subnet_ (''​​24''​),​ but not overlap. Wired uses '​.100'​ to '​.250',​ so the new WiFi will use '​.40'​ to '​.50'​
 +The Raspberry Pi itself gets its internet connection via the wired network - i.e. it uses the same router as other wired hosts (
 +DHCP requests from the WiFi network will be answered by the Raspberry Pi (using ''​dnsmasq''​),​ and _not_ answered by my wired network. Since the networks are bridged my home network'​s router will attempt to answer DHCP requests - so we'll need to:
 +  - Prevent DHCP requests from WiFi stations being answered by home network
 +  - Prevent DHCP requests from wired network being answered by Raspberry Pi
 +The Raspberry Pi itself will not ask for IP addresses from the wired network. This keeps things simple, as the only IP on the Raspberry Pi will be on the bridge interface and it will be entirely predictable so we can embed it into the DHCP offers we give out (i.e. write it into ''/​etc/​dnsmasq.conf''​)
 +The Raspberry Pi's DHCP offers will nominate itself as the gateway (i.e. default route) and DNS server. It will have to perform Network Address Translation ("​MASQUERADE"​) for all traffic leaving my house (e.g. via home network or VPN).
 +ExpressVPN also tunnels DNS traffic, and *blocks* attempts to use DNS other than its own. This is a good thing, but I cannot get ExpressVPN and ''​openresolv''​ to play nicely: updates to ''/​etc/​resolv.conf''​ either don't happen, or don't take affect. So I'll simply uninstall ''​openresolv''​ and/or disable ''​systemd-resolved''​.
 ===== Setup ===== ===== Setup =====
vpn-rpi4.txt · Last modified: 2020/04/30 09:16 by robm