VM get incorrect default gateway when attached port DG manually to router

Bug #1465513 reported by Eran Kuris
20
This bug affects 2 people
Affects Status Importance Assigned to Milestone
neutron
Invalid
Undecided
Unassigned

Bug Description

When I create neutron port and attach it to router as "default gateway" and launch VM I can see that VM get ip address of default gateway that not match to ip address of neutron router port. It get the ip gateway from subnet configuration which is x.y.z.1

Version: OSP 7 on rhel 7.1
# rpm -qa |grep dnsmasq
dnsmasq-utils-2.67-1.fc20.x86_64
dnsmasq-2.67-1.fc20.x86_64
[root@puma15 ~(keystone_admin)]# rpm -qa |grep neutron
python-neutron-2015.1.0-1.el7ost.noarch
openstack-neutron-fwaas-2015.1.0-3.el7ost.noarch
openstack-neutron-2015.1.0-1.el7ost.noarch
python-neutron-lbaas-2015.1.0-3.el7ost.noarch
python-neutronclient-2.4.0-1.el7ost.noarch
openstack-neutron-lbaas-2015.1.0-3.el7ost.noarch
openstack-neutron-openvswitch-2015.1.0-1.el7ost.noarch
python-neutron-fwaas-2015.1.0-3.el7ost.noarch
openstack-neutron-common-2015.1.0-1.el7ost.noarch

step to reproduce :
1. Create a neutron tenant network.
2. Create an IPv4 subnet for the network (say 192.168.1.0/24 with gateway_ip as 192.168.1.1)
3. Create a neutron router (say router1).
4. Create a port on the tenant network (without specifying any fixed_ip). The port would be allocated a free IP from the allocation pool (i.e., say 192.168.1.3).
5. Now attach this port to the neutron router (i.e., neutron router-interface-add <router1-id> <port-id>)
6. Spawn some VMs with the above network.
Observations:
VMs would acquire IP address (something like 192.168.1.4) with a default gateway as 192.168.1.1 and not the ip 192.168.1.3 (i.e., ip of the port which is attached to the neutron router)

Changed in neutron:
assignee: nobody → venkata anil (anil-venkata)
Revision history for this message
Sridhar Gaddam (sridhargaddam) wrote :

@Anil, as discussed over the IRC, I'll look into this issue. So, assigning the bug on my name. Thanks.

Changed in neutron:
assignee: venkata anil (anil-venkata) → Sridhar Gaddam (sridhargaddam)
Revision history for this message
Sridhar Gaddam (sridhargaddam) wrote :

There are couple of options to address this issue.

1. In router-interface-add with port, if port-ip does not match the subnet gateway_ip, update the subnet[gateway_ip] to the port-ip.
2. Disable the router-interface-add with port when port-ip does not match the subnet[gateway_ip].
3. Currently dnsmasq uses subnet[gateway_ip] in its offer messages. So, modify dnsmasq to advertise the port-ip as default_gw instead of the subnet[gateway_ip].

I would like to hear about the recommended option before proposing a patch.
Appreciate any comments on this, thanks.

Revision history for this message
Kevin Benton (kevinbenton) wrote :

This is intentional. The gateway_ip is what is given via DHCP regardless of router port IP addresses. If you want the clients to get a different address, you have to update the gateway_ip property of the subnet.

This is done because there could be multiple or no routers attached to a single network (e.g. routing done via a service VM).

Changed in neutron:
status: New → Invalid
Changed in neutron:
assignee: Sridhar Gaddam (sridhargaddam) → nobody
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.