Dhcp server error when LAN is in VRF

Board,

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:

ethernet eth1 {
    hw-id 52:55:00:d1:55:02
    vif 3 {
        address 100.64.66.1/24
        vrf voip
    }

service {
dhcp-server {
shared-network-name hs {
authoritative
subnet 192.168.5.0/24 {
default-router 192.168.5.1
range 0 {
start 192.168.5.100
stop 192.168.5.200
}
}
}
shared-network-name voip {
authoritative
subnet 100.64.66.0/24 {
default-router 100.64.66.1
range 0 {
start 100.64.66.100
stop 100.64.66.200
}
}
}

Upon commit, I am prompted with:

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.

Thanks in advance,

db

Hi @dbenson,

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'

cp-o,

Thanks for looking at this.

I am running:
vyos@user-vr:~$ sho ver

Version: VyOS 1.3-rolling-202009020118
Release Train: equuleus

As mentioned, the commands take, it is when I commit them I get commit failed with no explanation.

db

Please upgrade to the latest version and try again as we did a lot of fixes in the last 8 weeks.

c-po,

I did a system upgrade and sure enough, problem resolved.

Thanks a mill.

db

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.