Home > OS >  Linux rule custom according to the IP routing table is not effective
Linux rule custom according to the IP routing table is not effective

Time:11-23

Single network adapter is configured with multiple virtual IP, the IP are on the same network segment 192.168.1. X, now want to, according to the rule to create multiple IP routing table for each access to the source of the IP configuration a virtual IP as an export IP, for example,
 
/root @ localhost ~ # IP rule show
0: from all the lookup local
32765: the from 192.168.1.145 lookup 1
32766: the from all lookup main
32767: the from all lookup default
/root @ localhost ~ # IP route show table 1
The default via 192.168.1.1 dev ens33 SRC 192.168.1.202
192.168.1.0/24 dev ens33 proto kernel scope link SRC 192.168.1.202
/root @ localhost ~ # IP route flush the cache

Set up after the completion of the 192.168.1.202 IP did not go, but go IP card Lord 192.168.1.200, left in plain English, that is, the main routing tables, help you, how to make the source IP for 192.168.1.202 192.168.1.145 packets go?

CodePudding user response:

After I put the from 192.168.1.145 into the from all did go 192.168.1.202 IP, now the problem is the from 192.168.1.145 why are invalid
  • Related