Page MenuHomeVyOS Platform

dhcp: client renewal fails when running inside VRF
Closed, ResolvedPublicBUG

Description

cpo@leaf-02# run show vrf MGMT processes
 2282  sshd

There is no dhclient process running in given VRF. dhclient complains it can not send out packets via the given interface (as it's not bound to that VRF)

Aug 02 20:29:54 dhclient[1686]: send_packet: Network is unreachable
Aug 02 20:29:54 dhclient[1686]: send_packet: please consult README file regarding broadcast address.
Aug 02 20:29:54 dhclient[1686]: dhclient.c:3001: Failed to send 300 byte long packet over fallback interface.

In addition as the /var/lib/dhcp path is spread accross multiple Python files/modules take the opportunity and create a new path in python/vyos/defaults.py named 'isc_dhclient_dir' : '/var/lib/dhcp' which can later be referenced by all the consumers.

Details

Version
1.4-rolling-202308021247
Is it a breaking change?
Perfectly compatible
Issue type
Bug (incorrect behavior)

Related Objects

Event Timeline

c-po claimed this task.
c-po triaged this task as High priority.
c-po updated the task description. (Show Details)
c-po changed the task status from Open to In progress.Aug 3 2023, 8:23 AM
c-po updated the task description. (Show Details)
c-po changed the task status from In progress to Needs testing.Aug 4 2023, 6:14 PM

The VRF error applies to DHCPv6, too

c-po closed this task as Unknown Status.Aug 5 2023, 8:07 AM
c-po moved this task from Open to Finished on the VyOS 1.4 Sagitta board.

Bug present in 1.3.3 as well

Tested after merging T5476 and now we see a proper DHCP release message

13:01:45.765811 00:50:56:b3:9c:1d > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 342: (tos 0x10, ttl 128, id 0, offset 0, flags [none], proto UDP (17), length 328)
    0.0.0.0.68 > 255.255.255.255.67: [udp sum ok] BOOTP/DHCP, Request from 00:50:56:b3:9c:1d, length 300, xid 0xd4afe335, Flags [none] (0x0000)
          Client-Ethernet-Address 00:50:56:b3:9c:1d
          Vendor-rfc1048 Extensions
            Magic Cookie 0x63825363
            DHCP-Message (53), length 1: Discover
            Hostname (12), length 8: "LR1.wue3"
            Parameter-Request (55), length 7:
              Subnet-Mask (1), BR (28), Default-Gateway (3), Domain-Name-Server (6)
              Classless-Static-Route (121), Domain-Name (15), MTU (26)
13:01:46.775095 00:0d:b9:51:fc:3d > 00:50:56:b3:9c:1d, ethertype IPv4 (0x0800), length 342: (tos 0x10, ttl 128, id 0, offset 0, flags [none], proto UDP (17), length 328)
    172.31.0.254.67 > 172.31.0.172.68: [udp sum ok] BOOTP/DHCP, Reply, length 300, xid 0xd4afe335, Flags [none] (0x0000)
          Your-IP 172.31.0.172
          Client-Ethernet-Address 00:50:56:b3:9c:1d
          Vendor-rfc1048 Extensions
            Magic Cookie 0x63825363
            DHCP-Message (53), length 1: Offer
            Server-ID (54), length 4: 172.31.0.254
            Lease-Time (51), length 4: 85115
            Subnet-Mask (1), length 4: 255.255.255.0
            Default-Gateway (3), length 4: 172.31.0.254
            Domain-Name-Server (6), length 4: 172.31.0.254
            Domain-Name (15), length 9: "mybll.net"
13:01:46.775276 00:50:56:b3:9c:1d > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 342: (tos 0x10, ttl 128, id 0, offset 0, flags [none], proto UDP (17), length 328)
    0.0.0.0.68 > 255.255.255.255.67: [udp sum ok] BOOTP/DHCP, Request from 00:50:56:b3:9c:1d, length 300, xid 0xd4afe335, Flags [none] (0x0000)
          Client-Ethernet-Address 00:50:56:b3:9c:1d
          Vendor-rfc1048 Extensions
            Magic Cookie 0x63825363
            DHCP-Message (53), length 1: Request
            Server-ID (54), length 4: 172.31.0.254
            Requested-IP (50), length 4: 172.31.0.172
            Hostname (12), length 8: "LR1.wue3"
            Parameter-Request (55), length 7:
              Subnet-Mask (1), BR (28), Default-Gateway (3), Domain-Name-Server (6)
              Classless-Static-Route (121), Domain-Name (15), MTU (26)
13:01:46.779746 00:0d:b9:51:fc:3d > 00:50:56:b3:9c:1d, ethertype IPv4 (0x0800), length 342: (tos 0x10, ttl 128, id 0, offset 0, flags [none], proto UDP (17), length 328)
    172.31.0.254.67 > 172.31.0.172.68: [udp sum ok] BOOTP/DHCP, Reply, length 300, xid 0xd4afe335, Flags [none] (0x0000)
          Your-IP 172.31.0.172
          Client-Ethernet-Address 00:50:56:b3:9c:1d
          Vendor-rfc1048 Extensions
            Magic Cookie 0x63825363
            DHCP-Message (53), length 1: ACK
            Server-ID (54), length 4: 172.31.0.254
            Lease-Time (51), length 4: 85114
            Subnet-Mask (1), length 4: 255.255.255.0
            Default-Gateway (3), length 4: 172.31.0.254
            Domain-Name-Server (6), length 4: 172.31.0.254
            Domain-Name (15), length 9: "mybll.net"

Delete CLI config

cpo@LR1.wue3# delete interfaces ethernet eth2 address
cpo@LR1.wue3# delete interfaces ethernet eth2 vrf
cpo@LR1.wue3# commit
13:02:09.820533 00:50:56:b3:9c:1d > 00:0d:b9:51:fc:3d, ethertype IPv4 (0x0800), length 342: (tos 0x0, ttl 64, id 23539, offset 0, flags [DF], proto UDP (17), length 328)
    172.31.0.172.68 > 172.31.0.254.67: [bad udp cksum 0x5b2e -> 0x6b9f!] BOOTP/DHCP, Request from 00:50:56:b3:9c:1d, length 300, xid 0x7ff7c962, Flags [none] (0x0000)
          Client-IP 172.31.0.172
          Client-Ethernet-Address 00:50:56:b3:9c:1d
          Vendor-rfc1048 Extensions
            Magic Cookie 0x63825363
            DHCP-Message (53), length 1: Release
            Server-ID (54), length 4: 172.31.0.254
            Hostname (12), length 8: "LR1.wue3"
c-po changed the task status from Unknown Status to Resolved.Sep 5 2023, 7:20 PM
c-po moved this task from Backlog to Finished on the VyOS 1.3 Equuleus (1.3.4) board.