Skip to content

IPoE DHCPv6 provided address overridden by RA prefix #371

@jcpvdm

Description

@jcpvdm

Describe the bug

IPoE DHCPv6 provided address is overridden by RA prefix, even when the Autonomous flag is not set.

To Reproduce

Version (bngblaster -v):

Version: DEV
Compiler: GNU (11.4.0)
IO Modes: packet_mmap_raw (default), packet_mmap, raw

JSON configuration:

{
    "interfaces": {
        "access": [
            {
                "interface": "vethb",
                "type": "ipoe",
                "stream-group-id": 1,
                "vlan-mode": "N:1"
            }
        ]
    },
    "access-line": {
        "agent-remote-id": "DEU.RTBRICK.{session-global}",
        "agent-circuit-id": "0.0.0.0/0.0.0.0 eth 0:{session-global}"
    },
    "dhcp": {
        "enable": true,
        "release-retry": 0,
        "keep-address": true
    },
    "dhcpv6": {
        "enable": true,
        "ia-pd": false,
        "ia-na": true
    },
    "sessions": {
        "count": 1,
        "reconnect": true
    },
    "ipoe": {
        "ipv6": true,
        "ipv4": false
    }
}

Steps to reproduce the behavior:

  1. Run radvd or similar program that advertise RA with a prefix and Autonomous flag not set
interface vetha {
MinRtrAdvInterval 3;
MaxRtrAdvInterval 4;
AdvSendAdvert on;
AdvManagedFlag on;
prefix 2001:db8:1::/64 { AdvRouterAddr off; AdvOnLink on; AdvAutonomous off; AdvValidLifetime 14300; AdvPreferredLifetime 14200; };
};
  1. Run dhcpv6 server. Example config used in KEA
{

"Dhcp6": {
    "loggers": [
        {
            "name": "kea-dhcp6",
            "output_options": [
                {
                    "output": "stdout"
                }
            ],
            "severity": "NONE"
        }
    ],

    "valid-lifetime": 60,

    "interfaces-config": {
        "interfaces": [ "vetha" ]
    },


    "lease-database": {
        "type": "memfile",
        "persist": true,
        "name": "/var/lib/kea/dhcp6.leases"
    },


    "subnet6": [
        {
            "subnet": "2001:db8:1::/64",
            "interface": "vetha",
            "pools": [
                {
                    "pool": "2001:db8:1::1-2001:db8:1::ffff"
                }
             ]
        }
    ]

}

}
  1. Run bngblaster. observe the DHCPv6 is assigned, but later overriden by the RA prefix.
bngblaster -C blaster.json -l dhcp -l ip -l icmp -l debug -l packet  -S /run.sock 
Jan 29 14:38:18.954726 Set max allowed stream length to 3936 because of packet_mmap limitations
Jan 29 14:38:18.955298 Set interface vethb (3) in promiscuous mode
Jan 29 14:38:18.981638 Setup 16777216 byte packet_mmap ringbuffer (4096 slots) for interface vethb
Jan 29 14:38:19.016376 Added access interface vethb
Jan 29 14:38:19.016484 Session 1 created (vethb.0:0 group 0)
Jan 29 14:38:19.016520 Total PPS of all streams: 0.00
Jan 29 14:38:19.017003 Opened control socket /run.sock
Jan 29 14:38:19.116646 Resolve network interfaces
Jan 29 14:38:19.116689 All network interfaces resolved
Jan 29 14:38:19.116696 DHCPv6 (ID: 1) Start DHCPv6
Jan 29 14:38:19.116893 DHCPv6 (ID: 1) DHCPv6-Solicit send
Jan 29 14:38:19.118040 DHCPv6 (ID: 1) DHCPv6-Advertise received
Jan 29 14:38:19.118073 DHCPv6 (ID: 1) DHCPv6-Request send
Jan 29 14:38:19.118458 DHCPv6 (ID: 1) DHCPv6-Reply received
Jan 29 14:38:19.118482 IPv6 (ID: 1) DHCPv6 IA_NA address 2001:db8:1::2a/128
Jan 29 14:38:19.118702 IPv6 (ID: 1) ICMPv6 RA prefix 2001:db8:1::/64
Jan 29 14:38:19.118730 ALL SESSIONS ESTABLISHED
^CJan 29 14:38:37.945759 Received signal Interrupt (2), initiating teardown
Jan 29 14:38:37.945809 Teardown request (1)
Jan 29 14:38:38.134335 DHCPv6 (ID: 1) DHCPv6-Release send
Jan 29 14:38:38.135032 DHCPv6 (ID: 1) DHCPv6-Reply received
Jan 29 14:38:38.135076 DHCP (ID: 1) Stop DHCP
Jan 29 14:38:38.135081 ALL SESSIONS TERMINATED
  1. Using API is possible to see a abnormal ipv6 address assigned (RA prefix with host identifier portion=0)
bngblaster-cli /run.sock session-info session-id 1
{
    "status": "ok",
    "code": 200,
    "session-info": {
        "type": "ipoe",
        "session-id": 1,
        "session-state": "Established",
        "session-version": 3,
        "flapped": 0,
        "interface": "vethb",
        "outer-vlan": 0,
        "inner-vlan": 0,
        "mac": "02:00:00:00:00:01",
        "agent-circuit-id": "0.0.0.0/0.0.0.0 eth 0:1",
        "agent-remote-id": "DEU.RTBRICK.1",
        "ipv6-prefix": "2001:db8:1::/64",
        "ipv6-link-local": "fe80::ffff:ffff:ff00:1",
        "dhcp-state": "Disabled",
        "dhcp-server": "0.0.0.0",
        "dhcp-lease-time": 0,
        "dhcp-lease-expire": 0,
        "dhcp-lease-expire-t1": 0,
        "dhcp-lease-expire-t2": 0,
        "dhcp-tx": 0,
        "dhcp-rx": 0,
        "dhcp-tx-discover": 0,
        "dhcp-rx-offer": 0,
        "dhcp-tx-request": 0,
        "dhcp-rx-ack": 0,
        "dhcp-rx-nak": 0,
        "dhcp-tx-release": 0,
        "dhcpv6-state": "Bound",
        "dhcpv6-lease-time": 60,
        "dhcpv6-lease-expire": 48,
        "dhcpv6-lease-expire-t1": 1788,
        "dhcpv6-lease-expire-t2": 2868,
        "dhcpv6-tx": 2,
        "dhcpv6-rx": 2,
        "dhcpv6-tx-solicit": 1,
        "dhcpv6-rx-advertise": 1,
        "dhcpv6-tx-request": 1,
        "dhcpv6-rx-reply": 1,
        "dhcpv6-tx-renew": 0,
        "dhcpv6-tx-release": 0,
        "tx-packets": 3,
        "rx-packets": 9,
        "rx-fragmented-packets": 0,
        "tx-bytes": 328,
        "rx-bytes": 1006,
        "tx-accounting-packets": 0,
        "rx-accounting-packets": 0,
        "tx-accounting-bytes": 0,
        "rx-accounting-bytes": 0,
        "tx-arp": 0,
        "rx-arp": 0,
        "tx-igmp": 0,
        "rx-igmp": 0,
        "tx-icmp": 0,
        "rx-icmp": 0,
        "tx-icmpv6": 3,
        "rx-icmpv6": 7
    }
}

Expected behavior

RA prefix to not override the DHCPv6 provided address, since Autonomous=off

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions