Merge lp:~hexta/curtin/fix-static-routes-with-multiple-interfaces into lp:~curtin-dev/curtin/trunk
Status: | Work in progress |
---|---|
Proposed branch: | lp:~hexta/curtin/fix-static-routes-with-multiple-interfaces |
Merge into: | lp:~curtin-dev/curtin/trunk |
Diff against target: |
173 lines (+58/-59) 2 files modified
curtin/net/__init__.py (+40/-47) tests/unittests/test_net.py (+18/-12) |
To merge this branch: | bzr merge lp:~hexta/curtin/fix-static-routes-with-multiple-interfaces |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Server Team CI bot | continuous-integration | Approve | |
Scott Moser | Pending | ||
curtin developers | Pending | ||
Review via email: mp+318788@code.launchpad.net |
Description of the change
Currently, curtin creates /etc/network/
Example /etc/network/
auto lo
iface lo inet loopback
dns-search maas synesis
dns-nameservers 10.1.254.254
auto boot
iface boot inet static
gateway 10.1.255.254
dns-nameservers 10.1.254.254
address 10.1.2.255/16
mtu 9000
auto private
iface private inet static
address 10.7.0.201/16
mtu 9000
auto public
iface public inet static
dns-nameservers 10.1.254.254
address 10.9.0.201/16
mtu 9000
auto virt-inet
iface virt-inet inet static
address 10.88.0.1/16
mtu 1500
post-up route add -net 10.8.0.0 netmask 255.255.0.0 gw 10.9.255.254 metric 0 || true
pre-down route del -net 10.8.0.0 netmask 255.255.0.0 gw 10.9.255.254 metric 0 || true
post-up route add -net 192.168.0.0 netmask 255.255.0.0 gw 10.9.255.254 metric 0 || true
pre-down route del -net 192.168.0.0 netmask 255.255.0.0 gw 10.9.255.254 metric 0 || true
post-up route add -net 10.13.0.0 netmask 255.255.0.0 gw 10.9.255.254 metric 0 || true
pre-down route del -net 10.13.0.0 netmask 255.255.0.0 gw 10.9.255.254 metric 0 || true
post-up route add -net 10.4.0.0 netmask 255.255.0.0 gw 10.9.255.254 metric 0 || true
pre-down route del -net 10.4.0.0 netmask 255.255.0.0 gw 10.9.255.254 metric 0 || true
post-up route add -net 172.20.0.0 netmask 255.255.0.0 gw 10.9.255.254 metric 0 || true
pre-down route del -net 172.20.0.0 netmask 255.255.0.0 gw 10.9.255.254 metric 0 || true
source /etc/network/
All static routes applied to 'virt-inet' interface section. Restarting interface 'public' will not trigger adding routes.
Unmerged revisions
- 472. By Artur Molchanov <email address hidden>
-
Remove unused 'pprint' module
- 471. By Artur Molchanov <email address hidden>
-
Fix static routes in case of multiple interfaces.
Currently, curtin creates /etc/network/
interfaces with all static routes passed
after last interface entry. As a result, all routes will be added only after the
last interface turned on.Changes:
- Create script /etc/network/if-up.d/ routes.
This script will invoke 'route' command with
appropriate arguments after any interface turned on.
- Get rid of adding static routes inside /etc/network/interfaces.
PASSED: Continuous integration, rev:472 /jenkins. ubuntu. com/server/ job/curtin- ci/402/ /jenkins. ubuntu. com/server/ job/curtin- ci/nodes= metal-amd64/ 402 /jenkins. ubuntu. com/server/ job/curtin- ci/nodes= metal-arm64/ 402 /jenkins. ubuntu. com/server/ job/curtin- ci/nodes= metal-ppc64el/ 402 /jenkins. ubuntu. com/server/ job/curtin- ci/nodes= metal-s390x/ 402 /jenkins. ubuntu. com/server/ job/curtin- ci/nodes= vm-i386/ 402
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild: /jenkins. ubuntu. com/server/ job/curtin- ci/402/ rebuild
https:/