User Tools

Site Tools


vpn-pi

Differences

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
Next revision Both sides next revision
vpn-pi [2020/04/29 12:01]
robm [DHCP & DNS Services]
vpn-pi [2020/04/29 16:37]
robm [DHCP & DNS Services]
Line 16: Line 16:
  
 Disabling the ''wpa_supplicant.service'' in systemd doesn't work, but see below for how to disable the ''wpa_supplicant'' hook in ''/etc/network/interfaces.d/wlan0'' Disabling the ''wpa_supplicant.service'' in systemd doesn't work, but see below for how to disable the ''wpa_supplicant'' hook in ''/etc/network/interfaces.d/wlan0''
 +
 ===== Configure WiFi settings ===== ===== Configure WiFi settings =====
  
Line 23: Line 24:
 auto wlan0 auto wlan0
 iface wlan0 inet static iface wlan0 inet static
-  address 192.168.167.40/24+  address 172.16.0.1/24
   nohook wpa_supplicant   nohook wpa_supplicant
-  up ip route del 192.168.167.0/24 dev wlan0  # Added by default, conflicts with eth0 
-  up ip route add 192.168.167.40/29 dev wlan0 # Limited to just the address dnsmasq serves 
 </code> </code>
  
Line 40: Line 39:
 <code> <code>
 root@raspberrypi4:~# ip -br addr show wlan0 root@raspberrypi4:~# ip -br addr show wlan0
-wlan0            UP             192.168.167.40/24 169.254.114.246/16 fe80::3592:65db:94e0:c992/64+wlan0            UP             172.16.0.1/24 169.254.114.246/16 fe80::3592:65db:94e0:c992/64
 </code> </code>
  
Line 56: Line 55:
 && sudo dnsmasq \ && sudo dnsmasq \
   --no-daemon \   --no-daemon \
-  --dhcp-range=192.168.167.40,192.168.167.47,1h \+  --dhcp-range=172.16.0.10,172.16.0.20,1h \
   --except-interface=eth0 \   --except-interface=eth0 \
 +  --bind-interfaces \
   --dhcp-authoritative \   --dhcp-authoritative \
   --clear-on-reload   --clear-on-reload
 </code> </code>
 +
 +Notes:
 +
 +  * ''--bind-interfaces' causes the DNS server (TCP/UDP port 53) to bind to the network interfaces it will serve requests from. We need this because the default behaviour of binding to all interfaces via the special address ''0.0.0.0'' conflicts with ''systemd-resolved'' which binds to ''127.0.0.53%lo''. This essentially works around it.
  
 Later on, we'll want to move these settings into ''/etc/dnsmasq.conf'' Later on, we'll want to move these settings into ''/etc/dnsmasq.conf''
vpn-pi.txt · Last modified: 2020/04/29 16:54 by robm