sonic-net / sonic-buildimage

Scripts which perform an installable binary image build for SONiC
Other
722 stars 1.38k forks source link

[IPv6 DHCP_Realy] | Disabling or Enabling Option 79 and Interface_id in config_db does not work #16245

Open Hedgehog-Guru opened 1 year ago

Hedgehog-Guru commented 1 year ago

Description

If we disable/enable Option 79 and interface_id in config_db for ipv6 dhcp_relay, there is no difference in captured dhcp-relay packets on server side

Steps to reproduce the issue:

  1. configure ipv6 address on interface to dhcpv6 client
    config vlan add 10
    config vlan member add 10 Ethernet4
    config int ip add Vlan10 2000:10::1/64
  2. configure ipv6 address on interface to dhcpv6 server config int ip add Ethernet0 2000:100::1/64
  3. configure ipv6 dhcp-relay
    config feature state dhcp_relay enabled
    config dhcp_relay ipv6 destination add 10 2000:100::2
  4. start dhcp client and capture dhcp-relay packets on dhcp server
  5. Change settings for rfc6939_support and interface_id options in config_db and reload config.
    "DHCP_RELAY": {
        "Vlan2433": {
            "dhcpv6_servers": [
                "2000:1::2"
            ],
            "rfc6939_support": "false",
            "interface_id": "true"
        }
    },

config reload -y
  1. stop/start dhcp client and capture dhcp-relay packets on dhcp server
  2. Compare captured dhcp-relay packets

Describe the results you received:

There is no difference in captured dhcp-relay packets with different option settings

Describe the results you expected:

We should see/not see Option 79 and interface_id in captured dhcp_relay packets according to option setting in config_db

Output of show version:

root@qa-eth-vt03-4-3700v:/home/admin# show ver

SONiC Software Version: SONiC.202211_1_RC2.52-1cdb6b33f_Internal
SONiC OS Version: 11
Distribution: Debian 11.7
Kernel: 5.10.0-18-2-amd64
Build commit: 76ca82c3b
Build date: Thu Aug 17 13:16:18 UTC 2023
Built by: sw-r2d2-bot@r-build-sonic-ci03-241

Platform: x86_64-mlnx_msn3700-r0
HwSKU: ACS-MSN3700
ASIC: mellanox
ASIC Count: 1
Serial Number: MT1932X22252
Model Number: MSN3700-VS2F
Hardware Revision: A1
Uptime: 11:16:52 up 23:48,  1 user,  load average: 0.94, 0.38, 0.30
Date: Wed 23 Aug 2023 11:16:52

Docker images:
REPOSITORY                                         TAG                                  IMAGE ID       SIZE
docker-syncd-mlnx                                  202211_1_RC2.52-1cdb6b33f_Internal   879e7a6acb19   1.01GB
docker-syncd-mlnx                                  latest                               879e7a6acb19   1.01GB
docker-fpm-frr                                     202211_1_RC2.52-1cdb6b33f_Internal   56be63861717   486MB
docker-fpm-frr                                     latest                               56be63861717   486MB
docker-orchagent                                   202211_1_RC2.52-1cdb6b33f_Internal   a3148d51400f   475MB
docker-orchagent                                   latest                               a3148d51400f   475MB
docker-teamd                                       202211_1_RC2.52-1cdb6b33f_Internal   46442cec352c   456MB
docker-teamd                                       latest                               46442cec352c   456MB
docker-macsec                                      latest                               ef65dae6aa64   458MB
docker-platform-monitor                            202211_1_RC2.52-1cdb6b33f_Internal   4247cb4fc41f   1GB
docker-platform-monitor                            latest                               4247cb4fc41f   1GB
docker-snmp                                        202211_1_RC2.52-1cdb6b33f_Internal   9dea880e81ba   485MB
docker-snmp                                        latest                               9dea880e81ba   485MB
docker-dhcp-relay                                  latest                               8bf6a3291238   449MB
docker-sonic-telemetry                             202211_1_RC2.52-1cdb6b33f_Internal   c146de36b9c0   738MB
docker-sonic-telemetry                             latest                               c146de36b9c0   738MB
docker-eventd                                      202211_1_RC2.52-1cdb6b33f_Internal   2b7498f030ed   439MB
docker-eventd                                      latest                               2b7498f030ed   439MB
docker-router-advertiser                           202211_1_RC2.52-1cdb6b33f_Internal   167b867b24af   440MB
docker-router-advertiser                           latest                               167b867b24af   440MB
docker-sonic-p4rt                                  202211_1_RC2.52-1cdb6b33f_Internal   7f8b97f2b5fe   522MB
docker-sonic-p4rt                                  latest                               7f8b97f2b5fe   522MB
docker-lldp                                        202211_1_RC2.52-1cdb6b33f_Internal   e8ad9fb5d2e2   482MB
docker-lldp                                        latest                               e8ad9fb5d2e2   482MB
docker-database                                    202211_1_RC2.52-1cdb6b33f_Internal   32d2099b6e9c   440MB
docker-database                                    latest                               32d2099b6e9c   440MB
docker-mux                                         202211_1_RC2.52-1cdb6b33f_Internal   a03fa06dc539   488MB
docker-mux                                         latest                               a03fa06dc539   488MB
docker-nat                                         202211_1_RC2.52-1cdb6b33f_Internal   43e8417339f1   425MB
docker-nat                                         latest                               43e8417339f1   425MB
docker-sflow                                       202211_1_RC2.52-1cdb6b33f_Internal   2b9427fa8b32   423MB
docker-sflow                                       latest                               2b9427fa8b32   423MB
docker-sonic-mgmt-framework                        202211_1_RC2.52-1cdb6b33f_Internal   269ebbf7d94d   554MB
docker-sonic-mgmt-framework                        latest                               269ebbf7d94d   554MB
urm.nvidia.com/sw-nbu-sws-sonic-docker/sonic-wjh   1.5.4-202211-12                      18d5969dbb8c   432MB
urm.nvidia.com/sw-nbu-sws-sonic-docker/doai        1.0.0-202211-4                       cfa4c2484b87   200MB

Output of show techsupport:

(paste your output here or download and attach the file here )

sonic_dump_qa-eth-vt03-4-3700v_20230823_102550.tar.gz

Additional information you deem important (e.g. issue happens only occasionally):

packet captures.zip

vivekrnv commented 1 year ago

@jcaiMR, @yxieca FYI

vivekrnv commented 1 year ago

dhcp6relay must be aligned with yang about the field name https://github.com/sonic-net/sonic-dhcp-relay/blob/6a6ce245125d600ad07fc02638e96ba6c18d1b4b/src/config_interface.cpp#L144

kellyyeh commented 1 year ago

@Hedgehog-Guru Please try adding dhcpv6 options in config db as follows:

      "DHCP_RELAY": {
        "Vlan1000": {
            "dhcpv6_servers": [
                "fc02:2000::1",
                "fc02:2000::2",
                "fc02:2000::3",
                "fc02:2000::4"
            ],
            "dhcpv6_option|rfc6939_support": "false"
        }
    },

https://github.com/sonic-net/sonic-dhcp-relay/blob/67a3bdf12e7d24260bf114c46da033e2be5f57cd/src/configInterface.cpp#L143

You can also check in syslog to ensure options are disabled: Aug 24 00:46:45.074091 str2-7060cx-32s-29 INFO dhcp_relay#dhcp6relay: add Vlan1000 relay config, option79 disable interface-id disable

vivekrnv commented 1 year ago

@kellyyeh, yang model must be updated if this is the expected configuration. https://github.com/sonic-net/sonic-buildimage/blob/master/src/sonic-yang-models/yang-models/sonic-dhcpv6-relay.yang

dgsudharsan commented 1 year ago

@kellyyeh Can you please fix the yang model?

zhangyanzhao commented 1 year ago

@kellyyeh @jcaiMR can you please help? Thanks.

kellyyeh commented 1 year ago

Ack'ed, ETA 8/25

vivekrnv commented 1 year ago

@kellyyeh Any update?

kellyyeh commented 1 year ago

Draft PR: https://github.com/sonic-net/sonic-buildimage/pull/16290 PR is currently failing because our test parsing does not support container under list https://github.com/sonic-net/sonic-buildimage/blob/e286869b24992a6ee17a31a76bbd54bf186fc383/src/sonic-yang-mgmt/sonic_yang_ext.py#L649C9-L649C24 It should be supported according to rfc.

Need to address this issue first

vivekrnv commented 1 year ago

Why can't we just change the code to use rfc6939_support & interface_id and keep the Yang as is?

dgsudharsan commented 11 months ago

@kellyyeh @jcaiMR @yxieca Can you please update the status on this bug?

kellyyeh commented 11 months ago

@dgsudharsan This issue is dependent on this YANG model fix: https://github.com/sonic-net/sonic-buildimage/issues/16704

vivekrnv commented 11 months ago

Why can't we just change the code to use rfc6939_support & interface_id and keep the Yang as is?

@kellyyeh Why can't we do this instead of updating yang?

vivekrnv commented 1 month ago

@yxieca @yaqiangz Now that the list is added to Yang model, Can we fix this issue?