When working with VRF and DHCP server, I am getting constant errors when committing but can enter my wanted config in the boot config and have the service work. Example of my config:
vyos@user-vr# commit
[[service dhcp-server]] failed Commit failed
[edit service dhcp-server]
Even when I delete the service all together, I am giving the same response.
/var/log/messages tells me:
Nov 19 14:05:13 user-vr vyos-configd[575]: Received message: {“type”: “init”}
Nov 19 14:05:14 user-vr vyos-configd[575]: Received message: {“type”: “node”, “data”: “/usr/libexec/vyos/conf_mode/dhcp_server.py”}
Nov 19 14:05:14 user-vr vyos-configd[575]: DHCP subnets must be unique! Subnet 192.168.5.0/24 defined multiple times!
Nov 19 14:05:14 user-vr vyos-configd[575]: Sending response 2
This network is only defined in one place in my config.
which VyOS version are you using? I tried reproducing your issue but I can’t see it.
cpo@LR1.wue3:~$ show ver
Version: VyOS 1.3-rolling-202011140854
Nov 19 21:10:57 LR1 vyos-configd[547]: Sending response 1
Nov 19 21:11:00 LR1 vyos-configd[547]: Received message: {"type": "node", "data": "/usr/libexec/vyos/conf_mode/dhcp_server.py"}
Nov 19 21:11:00 LR1 vyos-configd[547]: Sending response 8
Nov 19 21:11:01 LR1 systemd[1]: Starting ISC DHCP IPv4 server...
Nov 19 21:11:01 LR1 dhcpd[1478]: Wrote 0 leases to leases file.
Nov 19 21:11:01 LR1 dhcpd[1480]: Wrote 0 leases to leases file.
Nov 19 21:11:01 LR1 dhcpd[1480]:
Nov 19 21:11:01 LR1 dhcpd[1480]: No subnet declaration for eth0.201 (172.18.201.10).
Nov 19 21:11:01 LR1 dhcpd[1480]: ** Ignoring requests on eth0.201. If this is not what
Nov 19 21:11:01 LR1 dhcpd[1480]: you want, please write a subnet declaration
Nov 19 21:11:01 LR1 dhcpd[1480]: in your dhcpd.conf file for the network segment
Nov 19 21:11:01 LR1 dhcpd[1480]: to which interface eth0.201 is attached. **
Nov 19 21:11:01 LR1 dhcpd[1480]:
Nov 19 21:11:01 LR1 dhcpd[1480]:
Nov 19 21:11:01 LR1 dhcpd[1480]: No subnet declaration for dum0 (172.18.254.201).
Nov 19 21:11:01 LR1 dhcpd[1480]: ** Ignoring requests on dum0. If this is not what
Nov 19 21:11:01 LR1 dhcpd[1480]: you want, please write a subnet declaration
Nov 19 21:11:01 LR1 dhcpd[1480]: in your dhcpd.conf file for the network segment
Nov 19 21:11:01 LR1 dhcpd[1480]: to which interface dum0 is attached. **
Nov 19 21:11:01 LR1 dhcpd[1480]:
Nov 19 21:11:02 LR1 kernel: [ 42.784215] NET: Registered protocol family 17
Nov 19 21:11:02 LR1 dhcpd[1480]:
Nov 19 21:11:02 LR1 dhcpd[1480]: No subnet declaration for eth0 (no IPv4 addresses).
Nov 19 21:11:02 LR1 dhcpd[1480]: ** Ignoring requests on eth0. If this is not what
Nov 19 21:11:02 LR1 dhcpd[1480]: you want, please write a subnet declaration
Nov 19 21:11:02 LR1 dhcpd[1480]: in your dhcpd.conf file for the network segment
Nov 19 21:11:02 LR1 dhcpd[1480]: to which interface eth0 is attached. **
Nov 19 21:11:02 LR1 systemd[1]: Started ISC DHCP IPv4 server.
Nov 19 21:11:02 LR1 dhcpd[1480]:
Nov 19 21:11:02 LR1 dhcpd[1480]: Server starting service.
From the following config:
set interfaces ethernet eth1 address '192.0.2.1/24'
set interfaces ethernet eth1 vrf 'black'
set interfaces ethernet eth2 address '192.0.3.1/24'
set service dhcp-server shared-network-name bar authoritative
set service dhcp-server shared-network-name bar subnet 192.0.3.0/24 default-router '192.0.3.1'
set service dhcp-server shared-network-name bar subnet 192.0.3.0/24 domain-name 'vyos.io'
set service dhcp-server shared-network-name bar subnet 192.0.3.0/24 range 0 start '192.0.3.20'
set service dhcp-server shared-network-name bar subnet 192.0.3.0/24 range 0 stop '192.0.3.200'
set service dhcp-server shared-network-name foo authoritative
set service dhcp-server shared-network-name foo subnet 192.0.2.0/24 default-router '192.0.2.1'
set service dhcp-server shared-network-name foo subnet 192.0.2.0/24 domain-name 'vyos.net'
set service dhcp-server shared-network-name foo subnet 192.0.2.0/24 range 0 start '192.0.2.10'
set service dhcp-server shared-network-name foo subnet 192.0.2.0/24 range 0 stop '192.0.2.100'