Flags: D - DYNAMIC; A - ACTIVE; c, s, y - COPY
Columns: DST-ADDRESS, GATEWAY, DISTANCE
# DST-ADDRESS GATEWAY DISTANCE
0 As 0.0.0.0/0 91.xxx.xxx.xxx 1
DAc 10.0.1.0/24 bridge-local 0
DAc 10.0.10.0/24 bridge-wlan 0
DAc 10.6.0.7/32 ether1 0
DAc 10.6.0.8/32 ether1 0
DAc 10.6.0.11/32 ether1 0
DAc 10.6.0.13/32 ether1 0
DAc 91.xxx.xxx.0/24 ether1
# Created by anaconda
ip ro add 10.0.20.0/24 dev ens18 scope link src 10.0.20.20 table lan1
ip ro add default via 10.0.20.251 table lan1
ip ro add 10.0.30.0/24 dev ens19 scope link src 10.0.30.30 table lan2
ip ro add default via 10.0.30.251 table lan2
ip ru add from 10.0.20.20 lookup lan1
ip ru add from 10.0.30.30 lookup lan2
[root@server ~]# ip rule
0: from all lookup local
32746: from 10.0.30.30 lookup lan2
32747: from 10.0.20.20 lookup lan1
32748: from 10.0.30.30 lookup lan2
32749: from 10.0.20.20 lookup lan1
32750: from 10.0.30.30 lookup lan2
32751: from 10.0.20.20 lookup lan1
32752: from 10.0.30.30 lookup lan2
32753: from 10.0.20.20 lookup lan1
32754: from 10.0.30.30 lookup lan2
32755: from 10.0.20.20 lookup lan1
32756: from 10.0.30.30 lookup lan2
32757: from 10.0.20.20 lookup lan1
32758: from 10.0.30.30 lookup lan2
32759: from 10.0.20.20 lookup lan1
32760: from 10.0.30.30 lookup lan2
32761: from 10.0.20.20 lookup lan1
32762: from 10.0.30.30 lookup lan2
32763: from 10.0.20.20 lookup lan1
32764: from 10.0.30.30 lookup lan2
32765: from 10.0.20.20 lookup lan1
32766: from all lookup main
32767: from all lookup default
[root@server ~]#
#!/bin/bash
/sbin/ip ro add 10.0.20.0/24 dev ens18 scope link src 10.0.20.20 table lan1
/sbin/ip ro add default via 10.0.20.251 table lan1
/sbin/ip ro add 10.0.30.0/24 dev ens19 scope link src 10.0.30.30 table lan2
/sbin/ip ro add default via 10.0.30.251 table lan2
/sbin/ip ru add from 10.0.20.20 lookup lan1
/sbin/ip ru add from 10.0.30.30 lookup lan2
exit 0
2: ens18: mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether ea:87:8e:61:0d:fb brd ff:ff:ff:ff:ff:ff
inet 10.0.20.20/24 brd 10.0.20.255 scope global noprefixroute ens18
valid_lft forever preferred_lft forever
inet6 fe80::e887:8eff:fe61:dfb/64 scope link
valid_lft forever preferred_lft forever
[root@server ~]# ip addr list dev ens19
3: ens19: mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether fa:1b:c9:2d:cc:e9 brd ff:ff:ff:ff:ff:ff
inet 10.0.30.30/24 brd 10.0.30.255 scope global noprefixroute ens19
valid_lft forever preferred_lft forever
inet6 fe80::f81b:c9ff:fe2d:cce9/64 scope link
valid_lft forever preferred_lft forever