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:11] 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]]. 
- 
-Unfortunately, again, the mess that DNS over HTTPS is (DoH), make it impossible to set your own DNS DoH server over DHCP. This includes many Android devices, that use DoH by default and will always use Google resolvers unless you specify one **manually** for every network you connect to. 
- 
-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