If you ask to configure DHCP in systemd I assume you mean to use systemd-networkd. Then with "automatically" enabled DHCP server you must have a DHCPServer=yes
line in the [Network]
section of your *.network
file. You can add a section [DHCPServer]
with additional options. Here is an example:
rpi ~# cat /etc/systemd/network/12-ap0.network
[Match]
Name=ap0
[Network]
Address=192.168.4.1/24
DHCPServer=yes
[DHCPServer]
DNS=84.200.69.80 1.1.1.1
PoolOffset=128
PoolSize=32
As you see you can use PoolOffset and PoolSize to define the ip range to be used by the DHCP server. PoolOffset=
takes the offset of the pool from the start of the subnet (192.168.4.0/24, determined by Address=192.168.4.1/24), PoolSize=
takes the number of IP addresses in the pool.
For further information look at man systemd.network
section [DHCPSERVER]
.
Reference:
Access point as WiFi router/repeater, optional with bridge
man systemd.network
where you'll find all options. – jake Sep 13 '19 at 08:55