Merge in DNS/adguard-home from 2305-limit-message-size to master Closes #2305. Squashed commit of the following: commit 6edd1e0521277a680f0053308efcf3d9cacc8e62 Author: Eugene Burkov <e.burkov@adguard.com> Date: Mon Nov 23 14:03:36 2020 +0300 aghio: fix final inaccuracies commit 4dd382aaf25132b31eb269749a2cd36daf0cb792 Author: Eugene Burkov <e.burkov@adguard.com> Date: Mon Nov 23 13:59:10 2020 +0300 all: improve code quality commit 060f923f6023d0e6f26441559b7023d5e5f96843 Author: Eugene Burkov <e.burkov@adguard.com> Date: Mon Nov 23 13:10:57 2020 +0300 aghio: add validation to constructor commit f57a2f596f5dc578548241c315c68dce7fc93905 Author: Eugene Burkov <e.burkov@adguard.com> Date: Fri Nov 20 19:19:26 2020 +0300 all: fix minor inaccuracies commit 93462c71725d3d00655a4bd565b77e64451fff60 Author: Eugene Burkov <e.burkov@adguard.com> Date: Fri Nov 20 19:13:23 2020 +0300 home: make test name follow convention commit 4922986ad84481b054479c43b4133a1b97bee86b Merge: 1f5472abc |
||
|---|---|---|
| .. | ||
| nclient4 | ||
| check_other_dhcp_windows.go | ||
| check_other_dhcp.go | ||
| db.go | ||
| dhcpd_test.go | ||
| dhcpd.go | ||
| dhcphttp_test.go | ||
| dhcphttp.go | ||
| helpers.go | ||
| network_utils_test.go | ||
| network_utils.go | ||
| os_windows.go | ||
| README.md | ||
| router_adv_test.go | ||
| router_adv.go | ||
| server.go | ||
| v4_test.go | ||
| v4.go | ||
| v6_test.go | ||
| v6.go | ||
| v46_windows.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 createYou can check its status by
ip acommand.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 acommand on Linux oripconfigon Windows. -
To force the client OS to request an IP from DHCP server again, you can use
dhclienton Linux oripconfig /releaseon 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
./AdGuardHomeThere should be a message in log which shows that DHCP server is ready:
[info] DHCP: listening on 0.0.0.0:67