canonical / cloud-init

Official upstream for the cloud-init: cloud instance initialization
https://cloud-init.io/
Other
3.02k stars 888 forks source link

Add support to configure policy based routing #3298

Open ubuntu-server-builder opened 1 year ago

ubuntu-server-builder commented 1 year ago

This bug was originally filed in Launchpad as LP: #1807297

Launchpad details
affected_projects = []
assignee = holmanb
assignee_name = Brett Holman
date_closed = None
date_created = 2018-12-07T01:39:53.561170+00:00
date_fix_committed = None
date_fix_released = None
id = 1807297
importance = high
is_complete = False
lp_url = https://bugs.launchpad.net/cloud-init/+bug/1807297
milestone = None
owner = gjayavelu
owner_name = Giridhar Jayavelu
private = False
status = triaged
submitter = gjayavelu
submitter_name = Giridhar Jayavelu
tags = []
duplicates = []

Launchpad user Giridhar Jayavelu(gjayavelu) wrote on 2018-12-07T01:39:53.561170+00:00

When there are multiple interfaces with their own default gateways, this could result in asymmetric routing. In order to solve this, policy based routing would have to be configured.

Here is a sample configuration: echo "100 eth0" >> /etc/iproute2/rt_tables echo "101 eth1" >> /etc/iproute2/rt_tables

auto eth0 iface eth0 inet static address 10.172.142.37/24 dns-nameservers 10.172.40.1 gateway 10.172.142.253 up ip rule add from 10.172.142.0/24 lookup eth0 up ip route add 10.172.142.0/24 dev eth0 table eth0 up ip route add default via 10.172.142.253 table eth0

auto eth1 iface eth1 inet static address 10.172.144.56/24 dns-nameservers 10.172.40.1 gateway 10.172.144.253 up ip rule add from 10.172.144.0/24 lookup eth1 up ip route add 10.172.144.0/24 dev eth1 table eth1 up ip route add default via 10.172.144.253 table eth1

ubuntu-server-builder commented 1 year ago

Launchpad user Ryan Harper(raharper) wrote on 2019-07-18T21:44:10.266016+00:00

Hi,

Thanks for filing the bug. This is a valid scenario.