coul, may I urge you not to insist that such settings be derived directly from deduced local network configurations, or from the node derived settings published by Chef? Not that those are not great places to get the base value, especially the chef node settings. Rather, I’d suggest that you set that as a default attribute in your cookbook from that value, to allow you to reset it from a role or an alternative node attribute in your cookbook.
I suggest this because it’s easy to hardcode such settings in your recipes, then find later that your recipe has to deal with an unexpected setup such as an internal VLAN where you really do prefer the traffic, or activating a VPN and setting the external routes to go through the VPN leading to network confusion, etc.