Page MenuHomeVyOS Platform

dhcp : relay agent IP address issue.
Closed, ResolvedPublicBUG

Assigned To
Unknown Object (User)
Authored By
Unknown Object (User)
Aug 7 2022, 10:48 PM
Referenced Files
F3918640: image.png
Nov 30 2023, 6:39 AM
F3918638: image.png
Nov 30 2023, 6:39 AM
F3918626: image.png
Nov 30 2023, 6:39 AM
F3918624: image.png
Nov 30 2023, 6:39 AM
F3918620: image.png
Nov 30 2023, 6:39 AM
F3918607: image.png
Nov 30 2023, 6:07 AM
F3918605: image.png
Nov 30 2023, 6:07 AM
F3918602: image.png
Nov 30 2023, 6:07 AM

Description

The relay agent IP address changed only after rebooting the "VyOS" system. I've noticed it on version 1.4-rolling-202208010217.
The issue makes a problem if you need to change "dhcp ip pool" on your interface.
To repeat the scenario, I've used the configuration:

dhcp server (vyos 1.4)

set interfaces ethernet eth7 address '172.17.17.5/24'
set protocols static route 10.0.0.0/16 next-hop 172.17.17.6
set service dhcp-server shared-network-name X subnet 10.0.5.0/24 default-router '10.0.5.1'
set service dhcp-server shared-network-name X subnet 10.0.5.0/24 lease '8000'
set service dhcp-server shared-network-name X subnet 10.0.5.0/24 range 0 start '10.0.5.5'
set service dhcp-server shared-network-name X subnet 10.0.5.0/24 range 0 stop '10.0.5.50'
set service dhcp-server shared-network-name Y subnet 10.0.0.0/24 default-router '10.0.0.1'
set service dhcp-server shared-network-name Y subnet 10.0.0.0/24 lease '8000'
set service dhcp-server shared-network-name Y subnet 10.0.0.0/24 range 0 start '10.0.0.5'
set service dhcp-server shared-network-name Y subnet 10.0.0.0/24 range 0 stop '10.0.0.50'

dhcp relay (vyos 1.4)

set interfaces ethernet eth7 address '172.17.17.6/24'
set interfaces ethernet eth0 address '10.0.0.1/24' or '10.0.5.1/24'
set service dhcp-relay interface 'eth0'
set service dhcp-relay interface 'eth7'
set service dhcp-relay relay-options relay-agents-packets 'discard'
set service dhcp-relay server '172.17.17.5'

image.png (319×721 px, 23 KB)

image.png (298×1 px, 29 KB)

restart dhcp relay-agent doesn't help.

Details

Difficulty level
Unknown (require assessment)
Version
1.4-rolling-202208010217
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Bug (incorrect behavior)

Event Timeline

Unknown Object (User) created this task.Aug 7 2022, 10:48 PM
Viacheslav changed the task status from Confirmed to Needs testing.Aug 16 2022, 9:58 AM
Viacheslav assigned this task to Unknown Object (User).

@m.korobeinikov Could you check it in 1.3

Unknown Object (User) added a comment.Aug 28 2022, 1:13 AM

@Viacheslav I've checked it using "VyOS 1.3.1-S1" version a problem the same.

Built on:         Mon 28 Mar 2022 17:02 UTC

image.png (194×654 px, 17 KB)

Unknown Object (User) added a comment.Aug 28 2022, 1:38 AM

The latest 1.4 works well after merging.

Error still present in 1.4: https://vyos.dev/T5004

PR from this task is for fixing op-mode command restart dhcp relay-agent in 1.4. Such command in 1.3 still wrong

Tested in VyOS 1.4-rolling-202311100309

image.png (439×773 px, 28 KB)

DHCP Server configurations:

set interfaces ethernet eth0 address '172.17.17.5/24'
set protocols static route 10.1.0.0/24 next-hop 172.17.17.6
set protocols static route 10.2.0.0/24 next-hop 172.17.17.6

set service dhcp-server listen-address '172.17.17.5'
set service dhcp-server shared-network-name VyOS-1.4-1 subnet 10.1.0.0/24 default-router '10.1.0.1'
set service dhcp-server shared-network-name VyOS-1.4-1 subnet 10.1.0.0/24 lease '8000'
set service dhcp-server shared-network-name VyOS-1.4-1 subnet 10.1.0.0/24 range 0 start '10.1.0.5'
set service dhcp-server shared-network-name VyOS-1.4-1 subnet 10.1.0.0/24 range 0 stop '10.1.0.50'
set service dhcp-server shared-network-name VyOS-1.4-2 subnet 10.2.0.0/24 default-router '10.2.0.1'
set service dhcp-server shared-network-name VyOS-1.4-2 subnet 10.2.0.0/24 lease '8000'
set service dhcp-server shared-network-name VyOS-1.4-2 subnet 10.2.0.0/24 range 0 start '10.2.0.5'
set service dhcp-server shared-network-name VyOS-1.4-2 subnet 10.2.0.0/24 range 0 stop '10.2.0.50'

DHCP Relay configurations:

set interfaces ethernet eth0 address '172.17.17.6/24'
set interfaces ethernet eth1 vif 11 address '10.1.0.1/24'
set interfaces ethernet eth1 vif 12 address '10.2.0.1/24'

set service dhcp-relay listen-interface 'eth1.11'
set service dhcp-relay listen-interface 'eth1.12'
set service dhcp-relay relay-options relay-agents-packets 'discard'
set service dhcp-relay server '172.17.17.5'
set service dhcp-relay upstream-interface 'eth0'

Checking:

image.png (661×1 px, 86 KB)

image.png (654×1 px, 86 KB)

Resetting new IP addresses for the interface and resetting dhcp relay-agent:

[email protected]# delete interfaces ethernet eth1 vif 11 address
[edit]
[email protected]# delete interfaces ethernet eth1 vif 12 address
[edit]
[email protected]# set interfaces ethernet eth1 vif 11 address '10.1.0.11/24'
[edit]
[email protected]# set interfaces ethernet eth1 vif 12 address '10.2.0.11/24'
[edit]
[email protected]# commit
[edit]
[email protected]# run restart dhcp relay-agent
[edit]

Checking:

image.png (807×1 px, 101 KB)

image.png (684×1 px, 94 KB)

Note: The relay agent IP address changed after the restart dhcp relay-agent command

Tested in VyOS 1.3.4

image.png (371×806 px, 27 KB)

DHCP Server configurations (VyOS version 1.4):

set interfaces ethernet eth0 address '172.17.17.5/24'
set protocols static route 10.11.0.0/24 next-hop 172.17.17.7
set protocols static route 10.12.0.0/24 next-hop 172.17.17.7

set service dhcp-server listen-address '172.17.17.5'
set service dhcp-server shared-network-name VyOS-1.3-1 subnet 10.11.0.0/24 default-router '10.11.0.1'
set service dhcp-server shared-network-name VyOS-1.3-1 subnet 10.11.0.0/24 lease '8000'
set service dhcp-server shared-network-name VyOS-1.3-1 subnet 10.11.0.0/24 range 0 start '10.11.0.5'
set service dhcp-server shared-network-name VyOS-1.3-1 subnet 10.11.0.0/24 range 0 stop '10.11.0.50'
set service dhcp-server shared-network-name VyOS-1.3-2 subnet 10.12.0.0/24 default-router '10.12.0.1'
set service dhcp-server shared-network-name VyOS-1.3-2 subnet 10.12.0.0/24 lease '8000'
set service dhcp-server shared-network-name VyOS-1.3-2 subnet 10.12.0.0/24 range 0 start '10.12.0.5'
set service dhcp-server shared-network-name VyOS-1.3-2 subnet 10.12.0.0/24 range 0 stop '10.12.0.50'

DHCP Relay configurations (VyOS version 1.3.4):

set interfaces ethernet eth0 address '172.17.17.7/24'
set interfaces ethernet eth1 vif 11 address '10.11.0.1/24'
set interfaces ethernet eth1 vif 12 address '10.12.0.1/24'

set service dhcp-relay interface 'eth0'
set service dhcp-relay interface 'eth1.11'
set service dhcp-relay interface 'eth1.12'
set service dhcp-relay relay-options relay-agents-packets 'discard'
set service dhcp-relay server '172.17.17.5'

Checking:

image.png (798×1 px, 100 KB)

image.png (801×1 px, 107 KB)

Resetting new IP addresses for the interface and resetting dhcp relay-agent:

vyos@DHCP-Relay-1-3# delete interfaces ethernet eth1 vif 11 address
[edit]
vyos@DHCP-Relay-1-3# delete interfaces ethernet eth1 vif 12 address
[edit]                                                                                
vyos@DHCP-Relay-1-3# set interfaces ethernet eth1 vif 11 address '10.11.0.11/24'
[edit]
vyos@DHCP-Relay-1-3# set interfaces ethernet eth1 vif 12 address '10.12.0.11/24'
[edit]
vyos@DHCP-Relay-1-3# commit
[edit]
vyos@DHCP-Relay-1-3# run restart dhcp relay-agent
[edit]

Checking:

image.png (801×1 px, 107 KB)

image.png (802×1 px, 128 KB)

Note: Same as the 1.4 version the relay agent IP address changed after the restart dhcp relay-agent command