[Openstack-operators] multiple gateways for network

Dan Sneddon dsneddon at redhat.com
Tue Dec 22 02:03:08 UTC 2015


On 12/18/2015 06:00 AM, Akshay Kumar Sanghai wrote:
> Hi,
> I have a network ,net1 with 2 VMs connected to it. One router R1 is
> connected to the n/w which connects to ext-net. I have another router
> R2 that connects to a diff network net2 in the tenant. Can i create
> matching rules for the network so that it forward the packet to R2 if
> destined to that network and set R1 as the default gateway for all
> other traffic. Is this possible? I do not want to add routes
> individually to each VM on net1 to forward traffic to net2. I also do
> not want to use a single router and connect to net2 and ext-net.
> 
> I have a use-case of 3 tier network architecture and each network will
> be connected to atleast 2 other networks. For a network ,adding static
> routes to VMs is not a good way to go.
> 
> Thanks,
> Akshay
> 
> 
> 
> 
> _______________________________________________
> OpenStack-operators mailing list
> OpenStack-operators at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators
> 

You can instruct the DHCP server to issue extra non-default routes to
the VMs when they get their IPs. For instance, to add a route to the
10.1.1.0/24 network via the router at 10.0.0.254, you would add the
following to the subnet:

neutron subnet-update \
--host-route destination=10.1.1.0/24,nexthop=10.0.0.254 \
<network_name>

That way the VMs will use the router at 10.0.0.254 to reach the remote
network, and they will use their default route for everything else.

-- 
Dan Sneddon         |  Principal OpenStack Engineer
dsneddon at redhat.com |  redhat.com/openstack
650.254.4025        |  dsneddon:irc   @dxs:twitter



More information about the OpenStack-operators mailing list