How to change the default route after the system was booted with the network being up (typically when root is on iSCSI or Clevis is being used)
Issue
-
When booting with network enabled, I see multiple default gateways on different network interfaces
# ip r default via 10.0.0.1 dev ibft0 default via 192.168.0.1 dev enp6s0 proto static metric 100 10.0.0.0/16 dev ibft0 proto kernel scope link src 10.0.250.20 192.168.0.0/24 dev enp6s0 proto kernel scope link src 192.168.0.20In the example above, the system was booted with root device on iSCSI on
ibft0, but we want onlyenp6s0as default gateway once booted. -
When booting with network enabled, typically by specifying
ip=dhcp:eth0on the kernel command line, the default gateway iseth0but I need to useeth1instead
Environment
- Red Hat Enterprise Linux
- network boot (iSCSI, NFS, Clevis, ...)
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.