sonic-net / sonic-buildimage

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

[dhcpv6 relay] - DHCPv6 relay does not forward packets to DHCPv6 server #9101

Closed ppikh closed 2 years ago

ppikh commented 3 years ago

Description

DHCPv6 relay does not forward packets to DHCPv6 server When client send "dhcp6 solicit" message - it not forwarded to DHCP server

Topology used in test

HOST A (enp4s0f0) -----access VLAN 690----- (Ethernet0) DUT (Ethernet40) -----access VLAN 69----- (enp5s0f0) HOST B

HOST A - acts as DHCP client HOST B - acts as DHCP server

Steps to reproduce the issue:

  1. Do config on DUT
    
    sudo config vlan add 69
    sudo config vlan add 690

sudo config vlan member add -u 69 Ethernet40 sudo config vlan member add -u 690 Ethernet0

sudo config interface ip add Vlan69 69.0.0.1/24 sudo config interface ip add Vlan69 6900::1/64 sudo config interface ip add Vlan690 69.0.1.1/24 sudo config interface ip add Vlan690 6900:1::1/64

sudo config vlan dhcp_relay add 690 69.0.0.2 sudo config vlan dhcp_relay add 690 6900::2

2. Start tcpdump on DUT on ifaces: Vlan690 and Vlan69
3. Try to get IP address from HA

dhclient enp4s0f0 -v # For IPv4 dhclient -6 enp4s0f0 -v # For IPv6


#### Describe the results you received:
Client can not get IPv6 address from DHCP server.
dhcp6 solicit packets not forwarded from Vlan690 to Vlan69

root@r-boxer-sw01:/home/admin# tcpdump -i Vlan690 -e -n tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on Vlan690, link-type EN10MB (Ethernet), capture size 262144 bytes 09:21:01.499409 0c:42:a1:b4:cc:e8 > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 342: 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 0c:42:a1:b4:cc:e8, length 300 09:21:01.523328 ec:0d:9a:c3:b1:00 > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 342: 69.0.1.1.67 > 255.255.255.255.68: BOOTP/DHCP, Reply, length 300 09:21:09.012139 0c:42:a1:b4:cc:e8 > 33:33:00:01:00:02, ethertype IPv6 (0x86dd), length 118: fe80::e42:a1ff:feb4:cce8.546 > ff02::1:2.547: dhcp6 solicit 09:21:10.093507 0c:42:a1:b4:cc:e8 > 33:33:00:01:00:02, ethertype IPv6 (0x86dd), length 118: fe80::e42:a1ff:feb4:cce8.546 > ff02::1:2.547: dhcp6 solicit 09:21:12.315954 0c:42:a1:b4:cc:e8 > 33:33:00:01:00:02, ethertype IPv6 (0x86dd), length 118: fe80::e42:a1ff:feb4:cce8.546 > ff02::1:2.547: dhcp6 solicit 09:21:16.710669 0c:42:a1:b4:cc:e8 > 33:33:00:01:00:02, ethertype IPv6 (0x86dd), length 118: fe80::e42:a1ff:feb4:cce8.546 > ff02::1:2.547: dhcp6 solicit ^C 6 packets captured 6 packets received by filter 0 packets dropped by kernel

root@r-boxer-sw01:/home/admin# tcpdump -i Vlan69 -e -n tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on Vlan69, link-type EN10MB (Ethernet), capture size 262144 bytes 09:21:01.520268 ec:0d:9a:c3:b1:00 > 0c:42:a1:b4:d7:e8, ethertype IPv4 (0x0800), length 363: 69.0.0.1.67 > 69.0.0.2.67: BOOTP/DHCP, Request from 0c:42:a1:b4:cc:e8, length 321 09:21:01.520705 0c:42:a1:b4:d7:e8 > ec:0d:9a:c3:b1:00, ethertype IPv4 (0x0800), length 350: 69.0.0.2.67 > 69.0.1.1.67: BOOTP/DHCP, Reply, length 308 09:21:06.604009 0c:42:a1:b4:d7:e8 > ec:0d:9a:c3:b1:00, ethertype ARP (0x0806), length 60: Request who-has 69.0.0.1 tell 69.0.0.2, length 46 09:21:06.604110 ec:0d:9a:c3:b1:00 > 0c:42:a1:b4:d7:e8, ethertype ARP (0x0806), length 42: Reply 69.0.0.1 is-at ec:0d:9a:c3:b1:00, length 28 ^C 4 packets captured 4 packets received by filter 0 packets dropped by kernel


#### Describe the results you expected:
Client message forwarded from Vlan 690 to Vlan69 and reply received.
Client can get IPv4 or IPv6 address from DHCP server.

#### Output of `show version`:

SONiC Software Version: SONiC.master.209-b0c73d9a7_Internal Distribution: Debian 10.11 Kernel: 4.19.0-12-2-amd64 Build commit: b0c73d9a7 Build date: Tue Oct 26 16:48:20 UTC 2021 Built by: sw-r2d2-bot@r-build-sonic-ci03-243

Platform: x86_64-mlnx_msn2010-r0 HwSKU: ACS-MSN2010 ASIC: mellanox ASIC Count: 1 Serial Number: MT1749X10061 Model Number: MSN2010-CB2F Hardware Revision: A1 Uptime: 09:24:36 up 25 min, 2 users, load average: 0.70, 0.78, 0.76

Docker images: REPOSITORY TAG IMAGE ID SIZE docker-dhcp-relay latest e2f35a076316 429MB docker-syncd-mlnx latest 2652a4c657a9 996MB docker-syncd-mlnx master.209-b0c73d9a7_Internal 2652a4c657a9 996MB docker-database latest fe2aefdfb8c3 415MB docker-database master.209-b0c73d9a7_Internal fe2aefdfb8c3 415MB docker-snmp latest 822131202195 457MB docker-snmp master.209-b0c73d9a7_Internal 822131202195 457MB docker-teamd latest ea6bda719ec0 428MB docker-teamd master.209-b0c73d9a7_Internal ea6bda719ec0 428MB docker-nat latest 1cbc8173f2e3 430MB docker-nat master.209-b0c73d9a7_Internal 1cbc8173f2e3 430MB docker-router-advertiser latest ea7bb1f6d3f0 415MB docker-router-advertiser master.209-b0c73d9a7_Internal ea7bb1f6d3f0 415MB docker-platform-monitor latest 03027e633d3f 746MB docker-platform-monitor master.209-b0c73d9a7_Internal 03027e633d3f 746MB docker-macsec latest de1ea43df7cb 431MB docker-macsec master.209-b0c73d9a7_Internal de1ea43df7cb 431MB docker-lldp latest f13c1b763180 455MB docker-lldp master.209-b0c73d9a7_Internal f13c1b763180 455MB docker-orchagent latest 6849170aa3cd 446MB docker-orchagent master.209-b0c73d9a7_Internal 6849170aa3cd 446MB docker-sonic-telemetry latest 22a2702c6b34 504MB docker-sonic-telemetry master.209-b0c73d9a7_Internal 22a2702c6b34 504MB docker-sonic-mgmt-framework latest 84e0d03cae25 570MB docker-sonic-mgmt-framework master.209-b0c73d9a7_Internal 84e0d03cae25 570MB docker-mux latest 6e6637e4ea92 468MB docker-mux master.209-b0c73d9a7_Internal 6e6637e4ea92 468MB docker-fpm-frr latest a48280de2de7 446MB docker-fpm-frr master.209-b0c73d9a7_Internal a48280de2de7 446MB docker-sflow latest 0b2be7d286b9 428MB docker-sflow master.209-b0c73d9a7_Internal 0b2be7d286b9 428MB

#### Output of `show techsupport`:

sonic_dump_r-boxer-sw01_20211028_092149.tar.gz



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

<!--
     Also attach debug file produced by `sudo generate_dump`
-->
kellyyeh commented 3 years ago

Hi,

If you are using versions other than 202106, please update your dhcpv6_servers in the DHCP_RELAY table in config_db.

On master versions, you can use command "show dhcp_relay_helpers" to check. CLI support is still in progress for 202012, so you will need to check manually in config_db.

ppikh commented 2 years ago

Hi @kellyyeh

Why we need updated something in config_db.json? We configure DHCP relay settings by CMD: "sudo config vlan dhcp_relay add". And we can see DHCP relay setting by doing cmd: "show vlan brief"

kellyyeh commented 2 years ago

Yes, that is the case for 202106 branch only, which uses isc-dhcp. For other branches, which uses SONiC dhcp6relay, they use DHCP_RELAY table in config_db.json for configuration.

ppikh commented 2 years ago

Hi @kellyyeh We did configuration via CLI which is wrong for latest master/202012 images. When we do configuration via config_db.json - DHCPv6 relay works

{
    "DHCP_RELAY": {
        "Vlan690": {
            "dhcpv6_servers": [
                "6900::2"
            ]
        }
    },
    "VLAN": {
        "Vlan690": {
            "dhcpv6_servers": [
                "6900::2"
            ]
        }
    }
}

I think this issue can be closed.