User Tools

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
router:dhcp [2024/09/17 10:07] willyrouter:dhcp [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1
Line 1: Line 1:
-===== DHCP Server  ===== 
- 
-Using the [[https://www.isc.org/dhcp|ISC DHCP server]] is the best and easier choice.  
- 
-You should disable the ISC DHCP client as it is deprecated (and you already have the Gentoo's DHCPCD client anyway), so create the file **/etc/portage/package.use/dhcp**: 
-<file - dhcp> 
-net-misc/dhcp -client 
-</file> 
- 
-then just emerge it: 
-<code bash> 
-emerge net-misc/dhcp 
-</code> 
- 
-Edit the DHCP configuration file **/etc/dhcp/dhcpd.conf**: 
-<file - dhcpd.conf> 
-authoritative; 
-subnet 192.168.0.0 netmask 255.255.255.0 { 
-     # disable DHCP on ISP#1 upstream network 
-} 
-subnet 192.168.1.0 netmask 255.255.255.0 { 
-     # disable DHCP on ISP#2 upstream network 
-} 
-subnet 10.0.0.0 netmask 255.255.255.0 { 
-  range 10.0.0.100 10.0.0.250; 
-  option domain-name-servers 10.0.0.1; 
-  option domain-name "mydomain.com"; 
-  option routers 10.0.0.1; 
-} 
-host fixed-ip-pc { 
-    hardware ethernet 12:34:56:78:9a:bc; 
-    fixed-address 10.0.0.95; 
-} 
-</file> 
- 
-Here i assign a pool od dynamic IP addresses (from 100 to 254) on the 10.0.0.0 subnet. Addresses under 100 can be used for static assignments. For example, i use static IPs for all my OpenWRT Access Points and wired security cameras, and dynamic for all other devices. I have also defined my two ISP's subnets to explicitly disable DHCP assignments on them, which is not needed and might be an attack vector. 
- 
-This config will also ensure that all devices will use the home server both as DNS server and gateway. 
- 
-This will **not work** for devices that use hard-coded DNS servers (like Fire Sticks and Google Chromecasts...) but there is a workaround for those too, and i will show you on [[router:nat|Routing on the Home Server]]. 
- 
-This will **not work** with some Android devices either, and it's a massive PITA, because Android is moving to DoH and this will totally bypass your internal Unbound resolver, and there is __no way__ to fix it. This means also issues with Ad Blocking, go figure why Google is pushing this hard. 
- 
-Well, this is almost all. Start //dhcp// service and make it start on boot: 
-<code bash> 
-rc-update add dhcp default 
-/etc/init.t/dhcp start 
-</code> 
- 
-Now you can connect your devices to the home network and they will get an IP address and a full network configuration to go with it. 
- 
  

This website uses technical cookies only. No information is shared with anybody or used in any way but provide the website in your browser.

More information