fac574d324
Merge in DNS/adguard-home from 3538-dhcp-options to master Closes #3538. Updates #3366. Squashed commit of the following: commit 8b8cd118834aaf393fd13daf2afc9867794ee102 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Mon Sep 13 19:57:09 2021 +0300 dhcpd: imp tests commit 1789171283280b6934eed87137a693cd310a9c0a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Mon Sep 13 19:04:12 2021 +0300 dhcpd: fix ip version commit 07108a95a2026592e72cabecbf6275b6dd50c18a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Mon Sep 13 18:56:21 2021 +0300 all: imp log of changes commit 461441b3709bf1383abebffa4067ea89f4763d79 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Mon Sep 13 18:48:55 2021 +0300 dhcpd: imp code & docs, log changes commit 723f818baeadb9f0805cad96351a3b117155a103 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Mon Sep 13 17:27:30 2021 +0300 dhcpd: add default options commit 575e9d01cf95a564aed31d26a6cc9376850d321a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 8 13:05:01 2021 +0300 dhcpd: imp options logic |
||
---|---|---|
.. | ||
bitset_test.go | ||
bitset.go | ||
broadcast_bsd_test.go | ||
broadcast_bsd.go | ||
broadcast_others_test.go | ||
broadcast_others.go | ||
db.go | ||
dhcpd_test.go | ||
dhcpd.go | ||
helpers.go | ||
http_test.go | ||
http.go | ||
iprange_test.go | ||
iprange.go | ||
nullbool_test.go | ||
nullbool.go | ||
options_unix_test.go | ||
options_unix.go | ||
os_windows.go | ||
README.md | ||
routeradv_test.go | ||
routeradv.go | ||
server.go | ||
v4_test.go | ||
v4.go | ||
v6_test.go | ||
v6.go | ||
v46_windows.go | ||
v46.go |
DHCP server
Contents:
Test setup with Virtual Box
To set up a test environment for DHCP server you need:
- Linux host machine
- Virtual Box
- Virtual machine (guest OS doesn't matter)
Configure client
-
Install Virtual Box and run the following command to create a Host-Only network:
$ VBoxManage hostonlyif create
You can check its status by
ip a
command.You can also set up Host-Only network using Virtual Box menu:
File -> Host Network Manager...
-
Create your virtual machine and set up its network:
VM Settings -> Network -> Host-only Adapter
-
Start your VM, install an OS. Configure your network interface to use DHCP and the OS should ask for a IP address from our DHCP server.
-
To see the current IP address on client OS you can use
ip a
command on Linux oripconfig
on Windows. -
To force the client OS to request an IP from DHCP server again, you can use
dhclient
on Linux oripconfig /release
on Windows.
Configure server
-
Edit server configuration file 'AdGuardHome.yaml', for example:
dhcp: enabled: true interface_name: vboxnet0 dhcpv4: gateway_ip: 192.168.56.1 subnet_mask: 255.255.255.0 range_start: 192.168.56.2 range_end: 192.168.56.2 lease_duration: 86400 icmp_timeout_msec: 1000 options: [] dhcpv6: range_start: 2001::1 lease_duration: 86400 ra_slaac_only: false ra_allow_slaac: false
-
Start the server
./AdGuardHome
There should be a message in log which shows that DHCP server is ready:
[info] DHCP: listening on 0.0.0.0:67