Default Gateway for a system v/s Default gateway per Interface
patrick at stwcx.xyz
Thu May 7 01:24:10 AEST 2020
On Mon, May 04, 2020 at 09:14:05AM -0700, Johnathan Mantey wrote:
> We're not using Windows. What is the Linux kernel/systemd going to do
> for the Metric? So far the only value that has been applied to the
> Metric is "0" (assigned by ??). As the Microsoft article points out,
> using a low value Metric for "private" nets is to be avoided.
> Our DHCP servers are supplying a Metric value of 1024. I'm sure other
> network managers use different values.
> I don't know how to solve this issue. Especially for the IPMI use case
> of assigning a static address. IPMI doesn't have the ability to assign
> metric values. At least with Redfish we can have that feature added.
Lower metric values have priority (0 is most preferred). By default
systemd-networkd sets DHCP routes to 1024 per . You can set an
alternative RouteMetric in a systemd-networkd network file to set up
a different preference.
I do this to automatically tether my phone to my computer when I
plug it in directly and prefer the network routes provided by the phone
by setting RouteMetric to 512:
$ cat /etc/systemd/network/30-iphone.network
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 833 bytes
Desc: not available
More information about the openbmc