26: Configuring DHCP server and DNS (Dnsmasq)
_______________________________________________________________________________________________________
_______________________________________________________________________________________________________
© Virtual Access 2018
GW6600 Series User manual
Issue: 1.7
Page 297 of 519
However, to better identify, it is recommended to give the static lease instance a name.
For example, to create a static instance named mypc.
To define a named static lease instance using UCI, enter:
dhcp.mypc=host
dhcp.mypc.name=mypc
To define a named static lease instance using package options, enter:
config dhcp 'mypc'
option name 'mypc'
The following example adds the fixed IP address 192.168.1.2 and the name "mypc" for a
machine with the (Ethernet) hardware address 00:11:22:33:44:55.
26.3.2.1
Static leases using UCI
root@VA_router:~# uci show dhcp.mypc
dhcp.mypc=host
dhcp.mypc.ip=192.168.1.2
dhcp.mypc.mac=00:11:22:33:44:55
dhcp.mypc.name=mypc
26.3.2.2
Static leases using package options
root@VA_router:~# uci export dhcp
package dhcp
……
config host 'mypc'
option ip '192.168.1.2'
option mac '00:11:22:33:44:55'
option name 'mypc'
26.3.3
Configuring DHCP pools using command line
DHCP pools are configured under the dhcp package, stored at /etc/config/dhcp.
Sections of the type dhcp specify per interface lease pools and settings. Typically, there
is at least one section of this type present in the /etc/config/dhcp file to cover the LAN
interface.
You can disable a lease pool for a specific interface by specifying the ignore option in the
corresponding section.
You can configure multiple dhcp pools.