Enhancement #1917
Use dhcp-host dnsmasq option for fixed leases
Status: | CLOSED | Start date: | ||
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assignee: | - | % Done: | 100% | |
Category: | nethserver-dnsmasq | |||
Target version: | v6.4-beta2 | |||
Resolution: | NEEDINFO: | No |
Description
We now use /etc/ethers for fixed dhcp leaeses.
Using ethers has two side effects:
1. a static entry in the arp table
2. the same ip can't be leased to different mac (common for laptops)
I propose to use dnsmasq dhcp-host option to assign static leases.
From dnsmasq man:
This allows an IP address to be associated with multiple hardware addresses...useful to allocate a stable IP address to a laptop which has both wired and wireless interfaces.
Related issues
Associated revisions
/etc/ethers: remove template, move code to nethserver-dnsmasq. Refs #1917
dnsmasq.conf ethers dnsmasq-dhcp-hosts: use dhcp-host option for dhcp reservation. Refs #1917
/etc/dnsmasq-dhcp-hosts: allow association of an ip address to multiple mac addresss. Refs #1917
spec: Release 1.0.4. Refs #1917
spec: Release 1.0.2. Refs #1917
host-* events: expand /etc/dnsmasq-dhcp-hosts template. Refs #1917
History
#1 Updated by Davide Principi about 8 years ago
- Target version set to v6.4-beta2
#2 Updated by Giacomo Sanchietti about 8 years ago
- Status changed from NEW to TRIAGED
- Assignee set to Giacomo Sanchietti
- % Done changed from 0 to 20
- Estimated time set to 1.00
- remove /etc/ethers file
- dnsmasq.conf:
- disable read-ethers option
- enable dhcp-hostsfile option pointing to a new file (eg. /etc/dnsmasq-dhcp-hosts)
- adapt template for /etc/ethers to /etc/dnsmasq-dhcp-hosts
#3 Updated by Giacomo Sanchietti about 8 years ago
- Status changed from TRIAGED to ON_DEV
- % Done changed from 20 to 30
#4 Updated by Giacomo Sanchietti about 8 years ago
- nethserver-dnsmasq-1.0.2-1.0git1289769b.ns6
- nethserver-hosts-1.0.3-1.0gite7a158bf.ns6
#5 Updated by Giacomo Sanchietti about 8 years ago
- Status changed from ON_DEV to MODIFIED
- % Done changed from 30 to 70
#6 Updated by Giacomo Sanchietti about 8 years ago
- Status changed from MODIFIED to ON_QA
- % Done changed from 70 to 80
Package in testing: nethserver-hosts-1.0.4-1.ns6.noarch.rpm
#7 Updated by Giacomo Sanchietti about 8 years ago
Package in testing: nethserver-dnsmasq-1.0.3-1.ns6.noarch.rpm
For multiple ip-mac association, see Nethserver-dnsmasq
#8 Updated by Davide Principi about 8 years ago
- Assignee changed from Giacomo Sanchietti to Davide Principi
#9 Updated by Davide Principi about 8 years ago
- Status changed from ON_QA to ON_DEV
- Assignee deleted (
Davide Principi) - % Done changed from 80 to 30
Verification FAILED
Innethserver-dnsmasq
: expand /etc/dnsmasq-dhcp-hosts template also in events
- host-create
- host-delete
- host-modify
Tested with dhtest
#10 Updated by Davide Principi about 8 years ago
- Status changed from ON_DEV to MODIFIED
- Assignee set to Davide Principi
- % Done changed from 30 to 70
Test case
/etc/dnsmasq-dhcp-hosts must reflect changes on local
keys in HostsDB
#11 Updated by Davide Principi about 8 years ago
- Status changed from MODIFIED to ON_QA
- Assignee deleted (
Davide Principi) - % Done changed from 70 to 80
#12 Updated by Davide Principi about 8 years ago
- nethserver-dnsmasq-1.0.4-1.ns6.noarch.rpm
- nethserver-hosts-1.0.4-1.ns6.noarch.rpm
#13 Updated by Giacomo Sanchietti about 8 years ago
- Assignee set to Giacomo Sanchietti
#14 Updated by Giacomo Sanchietti about 8 years ago
- Status changed from ON_QA to VERIFIED
- % Done changed from 80 to 100
Creating test1 host¶
Extract from hosts db:
test1=local Description= IpAddress=192.168.5.127 MacAddress=08:00:27:77:C3:23
Extract from /etc/dnsmasq-dhcp-hosts
# Host: test1 08:00:27:77:c3:23,192.168.5.127
Editing test1 host¶
Extract from hosts db:
test1=local Description= IpAddress=192.168.5.128 MacAddress=08:00:27:77:C3:23
Extract from /etc/dnsmasq-dhcp-hosts
# Host: test1 08:00:27:77:c3:23,192.168.5.128
Deleting test1 host¶
Extract from /var/log/messages:
Jul 24 07:47:40 localhost /sbin/e-smith/db[29644]: /var/lib/nethserver/db/hosts: DELETE test1=local|Description||IpAddress|192.168.5.128|MacAddress|08:00:27:77:C3:23 Jul 24 07:47:40 localhost esmith::event[29646]: Processing event: host-delete Jul 24 07:47:40 localhost esmith::event[29646]: Running event handler: /etc/e-smith/events/actions/generic_template_expand Jul 24 07:47:40 localhost esmith::event[29646]: expanding /etc/hosts Jul 24 07:47:41 localhost esmith::event[29646]: expanding /etc/dnsmasq-dhcp-hosts Jul 24 07:47:41 localhost esmith::event[29646]: generic_template_expand=action|Event|host-delete|Action|generic_template_expand|Start|1374652060 718622|End|1374652061 67277|Elapsed|0.348655 Jul 24 07:47:41 localhost esmith::event[29646]: Running event handler: /etc/e-smith/events/actions/adjust-services Jul 24 07:47:41 localhost esmith::event[29646]: adjusting service dnsmasq (reload) Jul 24 07:47:41 localhost dnsmasq[29141]: read /etc/hosts - 2 addresses Jul 24 07:47:41 localhost esmith::event[29646]: Reloading dnsmasq: [ OK ]#015 Jul 24 07:47:41 localhost esmith::event[29646]: adjust-services=action|Event|host-delete|Action|adjust-services|Start|1374652061 69159|End|1374652061 359923|Elapsed|0.290764
No host entry in hosts db and /etc/dnsmasq-dhcp-hosts file.
#15 Updated by Davide Principi about 8 years ago
- Status changed from VERIFIED to CLOSED
- Assignee deleted (
Giacomo Sanchietti) - % Done changed from 90 to 100
Moved to nethserver-updates repository