[Routing][Concept] Routing command
When type ip rule will show like following
```
# ip rule show
0: from all lookup local
32766: from all lookup main
32767: from all lookup default
```
I draw picture like following
```
+-------------------------------------+
| ip rule |
| +------------+ |
| | | |
| | local | |
| | | |
| +------------+ |
| |
| +------------+ |
| | | |
| | main | |
| | | |
| +------------+ |
+-------------------------------------+
```
ip route show table main = ip route show = route -n
```
[happy@localhost tftp]$ ip route show table main
default via 192.168.0.1 dev wlp3s0
default via 192.168.1.1 dev enp4s0
default via 192.168.0.1 dev wlp3s0 src 192.168.0.101 metric 302
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1 linkdown
192.168.0.0/24 dev wlp3s0 proto kernel scope link src 192.168.0.101 metric 302
192.168.1.0/24 dev enp4s0 proto kernel scope link src 192.168.1.2
192.168.100.0/24 dev enp0s20u13 proto kernel scope link src 192.168.100.20 linkdown
[happy@localhost tftp]$ ip route show
default via 192.168.0.1 dev wlp3s0
default via 192.168.1.1 dev enp4s0
default via 192.168.0.1 dev wlp3s0 src 192.168.0.101 metric 302
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1 linkdown
192.168.0.0/24 dev wlp3s0 proto kernel scope link src 192.168.0.101 metric 302
192.168.1.0/24 dev enp4s0 proto kernel scope link src 192.168.1.2
192.168.100.0/24 dev enp0s20u13 proto kernel scope link src 192.168.100.20 linkdown
[happy@localhost tftp]$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 wlp3s0
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 enp4s0
0.0.0.0 192.168.0.1 0.0.0.0 UG 302 0 0 wlp3s0
172.17.0.0 0.0.0.0 255.255.0.0 U 0 0 0 docker0
192.168.0.0 0.0.0.0 255.255.255.0 U 302 0 0 wlp3s0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 enp4s0
192.168.100.0 0.0.0.0 255.255.255.0 U 0 0 0 enp0s20u13
```
0 意見:
張貼留言