Skip to content

dhcp plugin should support suppressing default gateway modification #1208

@phoenix-frozen

Description

@phoenix-frozen

When using the dhcp IPAM plugin with multus, and the DHCP server supplies a default gateway, the pod's routing configuration is updated accordingly. This would be fine if it didn't break pod networking entirely -- the Multus documentation even warns us that this will happen, and multiple other people have been bitten by this.

This is almost certainly what skipDefault is for, but some helpful DHCP servers proactively provide a default route even when not requested by the client.

Please provide a mechanism to ignore the gateway provided by the DHCP server, something like:

apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
  name: fastnet
  namespace: kube-system
spec:
  config: '{
      "type": "macvlan",
      "master": "INTERFACE",
      "mode": "bridge",
      "ipam": {
        "type": "dhcp",
        "request": [{
          "skipDefault": true
        }],
        "suppress": [
          "gateway"
        ]
      }
    }'

It might make sense for such a suppression option to require skipDefault: true; in fact, maybe skipDefault: true should itself cause dhcp to ignore the options it didn't ask for (unless they're explicitly listed separately in request).

As an aside, I find it weird that route-override can't fix the problem either; honestly, if you know how to use route-override for this purpose, I'm entirely OK with that too!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions