[openstack-dev] Setting host routes in a subnet on Neutron

Dionysis Grigoropoulos dgrig at grnet.gr
Fri Oct 18 09:18:25 UTC 2013


Hello all,

I've started implementing the Neutron API in Python for Synnefo [1], but I've 
hit a bump. Specifically, I'm troubled by the way Neutron seems to handle host 
routes in subnet definitions.

I'm experimenting with the implementation of the API in Neutron from Grizzly, 
with a PackStack-based installation.

For starters, when creating a subnet and setting host routes, it's possible to 
set the nexthop as an IP address outside of the subnet CIDR. 

For example, when defining a subnet, I pass the following JSON to Neutron:

{
    "cidr": "192.168.28.0/24", 
    "host_routes": [
        {
            "destination": "100.100.100.0/24", 
            "nexthop": "8.8.8.8"
        }
    ], 
    "ip_version": 4, 
    "network_id": "f52b51b6-3749-4306-bc76-97802fb3f48e"
}

I can set "8.8.8.8" as the gateway for network "100.100.100.0/24",
although 8.8.8.8 does not belong in the range of the subnet's CIDR
192.168.28.0/24.

Is there an obvious usecase for allowing this, that I'm missing at the moment?

Moreover, it's possible to set the destination CIDR for a host route to
0.0.0.0/0. If I understand correctly, this would set a host route for
0.0.0.0, effectively changing the default gateway for the system.
However, a default gateway is *already* defined for the subnet, via the
"gateway" field. Shouldn't there be some sort of verification that these
two values coincide, or just disallow setting host routes for 0.0.0.0/0
anyway?

Thanks in advance,
Dionysis Grigoropoulos

[1] https://www.synnefo.org/



More information about the OpenStack-dev mailing list