I'm running AlmaLinux 9 (a red hat 9 clone), and I would like to permanently remove a default route. My routing table is shown below, and I would like to remove the 172.31.252.1 route.
I know how to temporarily remove a route with 'ip route' command but it always appears on next boot. Instead, I want to permanently remove this route. The old RH /etc/sysconfig/network-scripts directory is no longer used (but kept for legacy reasons). I started a GUI but nowhere in the Network settings GUI do I see a default route setup.
How do I permanently remove that route?
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 172.31.252.1 0.0.0.0 UG 100 0 0 ens256
0.0.0.0 172.31.254.1 0.0.0.0 UG 101 0 0 ens192
172.31.252.0 0.0.0.0 255.255.255.0 U 100 0 0 ens256
172.31.254.0 0.0.0.0 255.255.255.0 U 101 0 0 ens192
The ManagementLan interface is stored in /etc/NetworkManager/system-connections, while EntertainmentVlan is stored in /etc/sysconfig/network-scripts/ifcfg-link:
BOOTPROTO=none
ONBOOT=yes
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
DEFROUTE=no
IPV4_FAILURE_FATAL=no
IPV6INIT=no
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME="Entertainment VLAN 30"
UUID=85810e29-e837-1d48-f5e7-9cd60d5a0ee4
IPADDR=172.31.252.31
PREFIX=24
DNS1=172.31.254.4
DOMAIN=mydomain.com
DNS2=172.31.234.4
HWADDR=00:0C:29:B6:49:0E
ip route:
default via 172.31.254.1 dev ens192 proto static metric 100
default via 172.31.252.1 dev ens256 proto static metric 101
172.31.252.0/24 dev ens256 proto kernel scope link src 172.31.252.31 metric 101
172.31.254.0/24 dev ens192 proto kernel scope link src 172.31.254.31 metric 100
ip rule show:
0: from all lookup local
32766: from all lookup main
32767: from all lookup default