TritonDataCenter / smartos-live

For more information, please see http://smartos.org/ For any questions that aren't answered there, please join the SmartOS discussion list: https://smartos.topicbox.com/groups/smartos-discuss
1.57k stars 246 forks source link

dockerinit should support link-local routes #984

Closed hww3 closed 1 month ago

hww3 commented 3 years ago

I have a set of hosts on networks (at OVH, in particular) where zones are created with networking over the admin interface but with IP subnets different than the global zone. The default route for these zones is through the default router on the admin network. In the zone, this means that there is a link-local route to the router on the admin IP subnet, and the default route is this address.

Example:

GZ admin IP: 1.2.3.4/24 default router: 1.2.3.254

Zone: "nics": [ { "mac": "00:01:02:03:04:05", "nic_tag": "admin", "netmask": "255.255.255.255", "gateways": ["1.2.3.254"], "ips": [ 2.3.4.5/32" ], "primary": true } ], "routes": { "1.2.3.254": "nics[0]" }

Unfortunately, this doesn't work out of the box as dockerinit does not support adding routes with the link-local flag set to true.

Adding support for link-local routes and then creating them before the default or other static routes should prevent this problem. It would seem that always creating link-local routes first should not cause problems, as they should always be directly accessible without a next-hop.

I have code to address this and will submit a PR once I've re-run some tests.

danmcd commented 1 month ago

See https://smartos.org/bugview/OS-8566

danmcd commented 1 month ago

Fixed by PR #986