From 6ee9880cade60d474ad098b80d78cdbf8032a327 Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Fri, 4 Jan 2013 18:31:41 -0800 Subject: Fix floating ips with external gateway If dnsmasq is configured to use an external gateway, then floating ips on other interfaces do not work properly. This is because outgoing traffic is no longer snatted to the floating ip. This patch fixes it by adding an ebtables rule to force traffic from ips that have a floating ip associated to route instead of bridge. Fixes bug 1096985 Change-Id: I8e4904660d42fe51c44b66686bed9f5d622693bd --- nova/db/sqlalchemy/models.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'nova/db/sqlalchemy/models.py') diff --git a/nova/db/sqlalchemy/models.py b/nova/db/sqlalchemy/models.py index 5050cb77e..406863f18 100644 --- a/nova/db/sqlalchemy/models.py +++ b/nova/db/sqlalchemy/models.py @@ -717,6 +717,12 @@ class FixedIp(BASE, NovaBase): leased = Column(Boolean, default=False) reserved = Column(Boolean, default=False) host = Column(String(255)) + network = relationship(Network, + backref=backref('fixed_ips'), + foreign_keys=network_id, + primaryjoin='and_(' + 'FixedIp.network_id == Network.id,' + 'FixedIp.deleted == False)') class FloatingIp(BASE, NovaBase): -- cgit