Page MenuHomeVyOS Platform

Feature Request: dhcp server: add VRF support
Closed, ResolvedPublic

Description

Request support for DHCP server functionality for VRF interfaces

For a full VRF-enabled router, such functionality is highly desirable.
It is currently not possible to use DHCP pools with overlapping addresses for different VRF interfaces.

For example:

set interfaces ethernet eth1 vrf 'CUSTOMER_A'
set interfaces ethernet eth1 address 192.168.100.1/24
set interfaces ethernet eth2 vrf 'CUSTOMER_B'
set interfaces ethernet eth2 address 192.168.100.1/24

set vrf name CUSTOMER_A table '101'
set vrf name CUSTOMER_B table '102'

set service dhcp-server shared-network-name CUSTOMER_A vrf 'CUSTOMER_A'
set service dhcp-server shared-network-name CUSTOMER_A subnet 192.168.100.0/24 range 0 start '192.168.100.100'
set service dhcp-server shared-network-name CUSTOMER_A subnet 192.168.100.0/24 range 0 stop '192.168.100.150'

set service dhcp-server shared-network-name CUSTOMER_B vrf 'CUSTOMER_B'
set service dhcp-server shared-network-name CUSTOMER_B subnet 192.168.100.0/24 range 0 start '192.168.100.100'
set service dhcp-server shared-network-name CUSTOMER_B subnet 192.168.100.0/24 range 0 stop '192.168.100.150'

Details

Difficulty level
Unknown (require assessment)
Version
-
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Feature (new functionality)

Event Timeline

Unknown Object (User) created this task.Oct 7 2022, 1:55 AM
Unknown Object (User) created this object in space S1 VyOS Public.

This can be implemented by multiple daemon instances in separate vrf's.

Hi @daniil and @NikolayP,

this is already implemented and working. You need to specify: set vrf bind-to-all and it will work out of the box with your configuration stated above

Sorry to write on a closed task, but without specifying a vrf (or some kind of identifier for that matter), how will the DHCP server decide which shared network to use since they have identical subnets configured?

In T4733#148990, @c-po wrote:

Hi @daniil and @NikolayP,

this is already implemented and working. You need to specify: set vrf bind-to-all and it will work out of the box with your configuration stated above

Sorry to write on a closed task but this issue appears again on the new rolling-release. I can sure that I specified set vrf bind-to-all in config.

There's a person suffer from same issue

My VyOS version is 1.5-rolling-202402250024, and the same config on version 1.4-rolling-202309030023 and 1.4-rolling-202305050317 works fine.

In T4733#148990, @c-po wrote:

Hi @daniil and @NikolayP,

this is already implemented and working. You need to specify: set vrf bind-to-all and it will work out of the box with your configuration stated above

It won't work that way. DHCP process must send packets according to the virtual routing table. Сlient will never be able to renew the lease because DHCP ACK will go to the wrong interface. The correct way is to run a separate process in vrf.

I'm using a workaround. I'm running a process in a script /config/scripts/vyos-postconfig-bootup.script:

ip vrf exec office /usr/sbin/dhcpd -4 -q -user dhcpd -group vyattacfg -pf /run/dhcp-server/office-dhcpd.pid -cf /config/user-data/office-dhcpd.conf -lf /config/office-dhcpd.leases

@c-po I suggest that we should reopen this issue. And I have a question is why DHCP server with VRF support works correctly in v1.4 but not in v1.5?