[2.0b8] Unable to set default gateway interface

Bug #1597324 reported by Matthew Rees on 2016-06-29
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
MAAS
High
Unassigned
2.0
High
Unassigned

Bug Description

Hi there

I am testing MAAS 2.0 in a proof of concept environment, and my networking configuration looks like this:

eno1: MAAS PXE interface, untagged, MAAS DHCP managed
eno2: Office/Internet facing interface, untagged, external DHCP
bond0: Multiple tagged VLAN interfaces for workload segregation, all managed by MAAS DHCP

This naming and configuration is shared by the MAAS node and by the nodes it manages. By default after acquiring, commissioning and deploying a node, eno1 is set as the default gateway interface but I would like eno2 to be the default.

Attached is the output of:

"maas xxx interfaces read 4y3h7q"

where "4y3h7q" is one of the nodes managed by MAAS, but the output for eno2 specifically is:

    {
        "params": "",
        "mac_address": "bc:30:5b:d7:39:3a",
        "links": [
            {
                "subnet": {
                    "resource_uri": "/MAAS/api/2.0/subnets/11/",
                    "name": "192.168.32.0/22",
                    "space": "maas-external",
                    "allow_proxy": true,
                    "vlan": {
                        "name": "untagged",
                        "resource_uri": "/MAAS/api/2.0/vlans/5013/",
                        "mtu": 1500,
                        "id": 5013,
                        "fabric": "fabric-5",
                        "dhcp_on": false,
                        "vid": 0,
                        "primary_rack": null,
                        "external_dhcp": "192.168.32.3",
                        "secondary_rack": null
                    },
                    "id": 11,
                    "rdns_mode": 2,
                    "cidr": "192.168.32.0/22",
                    "gateway_ip": "192.168.32.2",
                    "dns_servers": []
                },
                "id": 101,
                "mode": "dhcp",
                "ip_address": "192.168.34.117"
            }
        ],
        "tags": [],
        "resource_uri": "/MAAS/api/2.0/nodes/4y3h7q/interfaces/43/",
        "effective_mtu": 1500,
        "vlan": {
            "name": "untagged",
            "resource_uri": "/MAAS/api/2.0/vlans/5013/",
            "mtu": 1500,
            "id": 5013,
            "fabric": "fabric-5",
            "dhcp_on": false,
            "vid": 0,
            "primary_rack": null,
            "external_dhcp": "192.168.32.3",
            "secondary_rack": null
        },
        "name": "eno2",
        "discovered": [
            {
                "subnet": {
                    "resource_uri": "/MAAS/api/2.0/subnets/11/",
                    "name": "192.168.32.0/22",
                    "space": "maas-external",
                    "allow_proxy": true,
                    "vlan": {
                        "name": "untagged",
                        "resource_uri": "/MAAS/api/2.0/vlans/5013/",
                        "mtu": 1500,
                        "id": 5013,
                        "fabric": "fabric-5",
                        "dhcp_on": false,
                        "vid": 0,
                        "primary_rack": null,
                        "external_dhcp": "192.168.32.3",
                        "secondary_rack": null
                    },
                    "id": 11,
                    "rdns_mode": 2,
                    "cidr": "192.168.32.0/22",
                    "gateway_ip": "192.168.32.2",
                    "dns_servers": []
                },
                "ip_address": "192.168.34.117"
            }
        ],
        "type": "physical",
        "children": [],
        "id": 43,
        "parents": [],
        "enabled": true
    },

Attempting to set the default gateway interface of the node via:

"maas XXX interface set-default-gateway 4y3h7q 43"

results in the following:

{"__all__": ["This interface has no usable gateways."]}

Attempting to provide the link_id via:

"maas XXX interface set-default-gateway 4y3h7q 43 link_id=101"

results in:

{"link_id": ["'101' is not a valid link_id. It should be one of: ."], "__all__": ["This interface has no usable gateways."]}

If you need any further debugging, logs or info please let me know, and thanks!
Matthew

edit: edited for clarity of the commands used and their output

Related branches

Matthew Rees (matthew-rees) wrote :
description: updated
Blake Rouse (blake-rouse) wrote :

The issue here is that your are trying to set the default gateway to an interface that is set to DHCP. MAAS in this case will not allow you because we have no way of saying this interface should have the default gateway since it will DHCP. To better understand think of the case where you had 2 interfaces that you wanted to DHCP, we have no way to ensure that the gateway from the DHCP server will be set as the default, either one of those interfaces could be set as the default gateway.

Matthew Rees (matthew-rees) wrote :

Aha that was silly, thanks for the clarification Blake.

In my previous experience when set-default-gateway worked, I must have been using static for those interfaces. I've made the changes and it's working as expected, thanks again!

Changed in maas:
importance: Undecided → High
milestone: none → 2.0.0
status: New → In Progress
milestone: 2.0.0 → 2.1.0
Blake Rouse (blake-rouse) wrote :

I am going to fix this bug to allow an interface set to DHCP as the default gateway as well. So what you where doing before would now work.

Changed in maas:
status: In Progress → Fix Committed
Matthew Rees (matthew-rees) wrote :

Awesome, thanks Blake.

Changed in maas:
status: Fix Committed → Fix Released
milestone: 2.0.1 → none
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Bug attachments