ip route command.
IP routing table, use the ip route command. For example:
~]$ ip route
default via 192.168.122.1 dev ens9 proto static metric 1024
192.168.122.0/24 dev ens9 proto kernel scope link src 192.168.122.107
192.168.122.0/24 dev enp1s0 proto kernel scope link src 192.168.122.126
ip route commands take the following form:
ip route [ add | del | change | append | replace ] destination-address
ip-route(8) man page for more details on the options and formats. ~]# ip route add 192.0.2.1 via 10.0.0.1 [dev interface]
IP address of the host in dotted decimal notation, 10.0.0.1 is the next hop address and interface is the exit interface leading to the next hop. IP address representing a range of IP addresses:
~]# ip route add 192.0.2.0/24 via 10.0.0.1 [dev interface]
IP address of the destination network in dotted decimal notation and /24
is the network prefix. The network prefix is the number of enabled bits
in the subnet mask. This format of network address slash network prefix
length is sometimes referred to as classless inter-domain routing (CIDR) notation.
~]# ip route del 192.0.2.1





