Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| router:dhcp [2024/09/17 10:14] – willy | router:dhcp [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ===== DHCP Server | ||
| - | |||
| - | Using the [[https:// | ||
| - | |||
| - | You should disable the ISC DHCP client as it is deprecated (and you already have the Gentoo' | ||
| - | <file - dhcp> | ||
| - | net-misc/ | ||
| - | </ | ||
| - | |||
| - | then just emerge it: | ||
| - | <code bash> | ||
| - | emerge net-misc/ | ||
| - | </ | ||
| - | |||
| - | Edit the DHCP configuration file **/ | ||
| - | <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 " | ||
| - | option routers 10.0.0.1; | ||
| - | } | ||
| - | host fixed-ip-pc { | ||
| - | hardware ethernet 12: | ||
| - | fixed-address 10.0.0.95; | ||
| - | } | ||
| - | </ | ||
| - | |||
| - | 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: | ||
| - | |||
| - | Unfortunately, | ||
| - | |||
| - | Well, this is almost all. Start //dhcp// service and make it start on boot: | ||
| - | <code bash> | ||
| - | rc-update add dhcp default | ||
| - | / | ||
| - | </ | ||
| - | |||
| - | 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. | ||
| - | |||