← Back to team overview

maas-devel team mailing list archive

no default route for lxc containers deployed with juju/maas 2.0

 

Hi, I'm deploying services into lxc containers using Juju 2.0 beta8 and
MAAS 2.0 beta6.

The containers are being created with 3 interfaces with separate subnets
which are bridged to the interfaces on the node hosting the container. I'm
noticing that the containers don't have a default route which is should be
gateway_ip 10.189.69.1.

The node hosting the container has the default route. I'm not sure why the
default route isn't also in the container.

On the host there is default route with gateway 10.189.69.1

$ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use
Iface
0.0.0.0         10.189.69.1     0.0.0.0         UG    0      0        0
br-eno1
10.0.3.0        0.0.0.0         255.255.255.0   U     0      0        0
lxcbr0
10.189.69.0     0.0.0.0         255.255.255.128 U     0      0        0
br-eno1
172.27.72.0     0.0.0.0         255.255.255.192 U     0      0        0
br-bond0
172.27.72.64    0.0.0.0         255.255.255.192 U     0      0        0
br-bond1
192.168.122.0   0.0.0.0         255.255.255.0   U     0      0        0
virbr0

In the container there is no default route getting added:

$ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use
Iface
10.189.69.0     0.0.0.0         255.255.255.128 U     0      0        0 eth2
172.27.72.0     0.0.0.0         255.255.255.192 U     0      0        0 eth0
172.27.72.64    0.0.0.0         255.255.255.192 U     0      0        0 eth1

$ ping 8.8.8.8
connect: Network is unreachable

Adding the default route manually solves the problem.

$ sudo route add default gw 10.189.69.1 eth2
$ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=2 ttl=55 time=2.78 ms

Is there an additional setting needed to add a default route to lxc
containers?

My subnets are below:

$ maas maas subnets read
Success.
Machine-readable output follows:
[
    {
        "vlan": {
            "external_dhcp": null,
            "resource_uri": "/MAAS/api/2.0/vlans/5001/",
            "id": 5001,
            "vid": 0,
            "primary_rack": null,
            "mtu": 1500,
            "fabric": "fabric-0",
            "name": "untagged",
            "dhcp_on": false,
            "secondary_rack": null
        },
        "resource_uri": "/MAAS/api/2.0/subnets/5/",
        "allow_proxy": true,
        "id": 5,
        "gateway_ip": null,
        "cidr": "172.27.72.0/26",
        "dns_servers": [],
        "rdns_mode": 2,
        "name": "172.27.72.0/26",
        "space": "space-0"
    },
    {
        "vlan": {
            "external_dhcp": null,
            "resource_uri": "/MAAS/api/2.0/vlans/5002/",
            "id": 5002,
            "vid": 0,
            "primary_rack": null,
            "mtu": 1500,
            "fabric": "fabric-1",
            "name": "untagged",
            "dhcp_on": false,
            "secondary_rack": null
        },
        "resource_uri": "/MAAS/api/2.0/subnets/6/",
        "allow_proxy": true,
        "id": 6,
        "gateway_ip": null,
        "cidr": "172.27.72.64/26",
        "dns_servers": [],
        "rdns_mode": 2,
        "name": "172.27.72.64/26",
        "space": "space-0"
    },
    {
        "vlan": {
            "external_dhcp": null,
            "resource_uri": "/MAAS/api/2.0/vlans/5010/",
            "id": 5010,
            "vid": 0,
            "primary_rack": null,
            "mtu": 1500,
            "fabric": "fabric-9",
            "name": "untagged",
            "dhcp_on": false,
            "secondary_rack": null
        },
        "resource_uri": "/MAAS/api/2.0/subnets/9/",
        "allow_proxy": true,
        "id": 9,
        "gateway_ip": null,
        "cidr": "fd0d:ffe0:5771::/64",
        "dns_servers": null,
        "rdns_mode": 2,
        "name": "fd0d:ffe0:5771::/64",
        "space": "space-0"
    },
    {
        "vlan": {
            "external_dhcp": null,
            "resource_uri": "/MAAS/api/2.0/vlans/5002/",
            "id": 5002,
            "vid": 0,
            "primary_rack": null,
            "mtu": 1500,
            "fabric": "fabric-1",
            "name": "untagged",
            "dhcp_on": false,
            "secondary_rack": null
        },
        "resource_uri": "/MAAS/api/2.0/subnets/10/",
        "allow_proxy": true,
        "id": 10,
        "gateway_ip": null,
        "cidr": "fde9:8f83:4a81::/64",
        "dns_servers": null,
        "rdns_mode": 2,
        "name": "fde9:8f83:4a81::/64",
        "space": "space-0"
    },
    {
        "vlan": {
            "external_dhcp": null,
            "resource_uri": "/MAAS/api/2.0/vlans/5001/",
            "id": 5001,
            "vid": 0,
            "primary_rack": null,
            "mtu": 1500,
            "fabric": "fabric-0",
            "name": "untagged",
            "dhcp_on": false,
            "secondary_rack": null
        },
        "resource_uri": "/MAAS/api/2.0/subnets/11/",
        "allow_proxy": true,
        "id": 11,
        "gateway_ip": null,
        "cidr": "fde9:8f83:4a81:1::/64",
        "dns_servers": null,
        "rdns_mode": 2,
        "name": "fde9:8f83:4a81:1::/64",
        "space": "space-0"
    },
    {
        "vlan": {
            "external_dhcp": null,
            "resource_uri": "/MAAS/api/2.0/vlans/5011/",
            "id": 5011,
            "vid": 0,
            "primary_rack": null,
            "mtu": 1500,
            "fabric": "fabric-10",
            "name": "untagged",
            "dhcp_on": false,
            "secondary_rack": null
        },
        "resource_uri": "/MAAS/api/2.0/subnets/12/",
        "allow_proxy": true,
        "id": 12,
        "gateway_ip": null,
        "cidr": "fd0d:ffe0:5771:1::/64",
        "dns_servers": null,
        "rdns_mode": 2,
        "name": "fd0d:ffe0:5771:1::/64",
        "space": "space-0"
    },
    {
        "vlan": {
            "external_dhcp": null,
            "resource_uri": "/MAAS/api/2.0/vlans/5004/",
            "id": 5004,
            "vid": 0,
            "primary_rack": "4y3h7p",
            "mtu": 1500,
            "fabric": "fabric-3",
            "name": "untagged",
            "dhcp_on": true,
            "secondary_rack": null
        },
        "resource_uri": "/MAAS/api/2.0/subnets/2/",
        "allow_proxy": true,
        "id": 2,
        "gateway_ip": "10.189.69.1",
        "cidr": "10.189.69.0/25",
        "dns_servers": [
            "10.189.69.5",
            "8.8.8.8"
        ],
        "rdns_mode": 2,
        "name": "10.189.69.0/25",
        "space": "space-0"
    }
]

Matt

Follow ups