[root@ip-172-31-53-61 ~]# ip rule ls 0: from all lookup local 512: from all to 172.31.49.222 lookup main 512: from all to 172.31.52.222 lookup main 512: from all to 172.31.59.203 lookup main 512: from all to 172.31.61.61 lookup main 512: from all to 172.31.49.246 lookup main 512: from all to 172.31.58.47 lookup main 512: from all to 172.31.53.79 lookup main 512: from all to 172.31.63.97 lookup main 512: from all to 172.31.53.74 lookup main 512: from all to 172.31.54.196 lookup main 512: from all to 172.31.51.218 lookup main 512: from all to 172.31.63.248 lookup main 512: from all to 172.31.54.200 lookup main 512: from all to 172.31.51.108 lookup main 512: from all to 172.31.56.137 lookup main 512: from all to 172.31.54.85 lookup main 512: from all to 172.31.51.82 lookup main 512: from all to 172.31.57.72 lookup main 512: from all to 172.31.59.200 lookup main 512: from all to 172.31.58.18 lookup main 512: from all to 172.31.55.235 lookup main 512: from all to 172.31.48.162 lookup main 512: from all to 172.31.60.128 lookup main 512: from all to 172.31.50.246 lookup main 512: from all to 172.31.61.216 lookup main 512: from all to 172.31.55.130 lookup main 512: from all to 172.31.49.208 lookup main 512: from all to 172.31.55.135 lookup main 512: from all to 172.31.50.208 lookup main 512: from all to 172.31.63.121 lookup main 512: from all to 172.31.52.205 lookup main 512: from all to 172.31.52.71 lookup main 512: from all to 172.31.51.7 lookup main 512: from all to 172.31.53.238 lookup main 1024: from all fwmark 0x80/0x80 lookup main 1536: from 172.31.56.137 lookup 2 1536: from 172.31.54.85 lookup 2 1536: from 172.31.51.82 lookup 2 1536: from 172.31.57.72 lookup 2 1536: from 172.31.59.200 lookup 2 1536: from 172.31.58.18 lookup 2 1536: from 172.31.55.235 lookup 2 1536: from 172.31.48.162 lookup 2 1536: from 172.31.60.128 lookup 2 1536: from 172.31.50.246 lookup 2 1536: from 172.31.61.216 lookup 2 1536: from 172.31.55.130 lookup 2 1536: from 172.31.49.208 lookup 2 1536: from 172.31.55.135 lookup 2 1536: from 172.31.50.208 lookup 3 1536: from 172.31.63.121 lookup 3 1536: from 172.31.52.205 lookup 3 1536: from 172.31.52.71 lookup 3 1536: from 172.31.51.7 lookup 3 1536: from 172.31.53.238 lookup 3 32766: from all lookup main 32767: from all lookup default
[root@ip-172-31-53-61 ~]# ip r s table main default via 172.31.48.1 dev eth0 169.254.169.254 dev eth0 172.31.48.0/20 dev eth0 proto kernel scope link src 172.31.53.61 172.31.48.162 dev enicfd09b318e8 scope link 172.31.49.208 dev eni3512a649bfb scope link 172.31.49.222 dev eni8cf9e51b58a scope link 172.31.49.246 dev eni9f41e641d45 scope link 172.31.50.208 dev eniffd28bfda2d scope link 172.31.50.246 dev eni1abad8afd57 scope link 172.31.51.7 dev eni76e381844d3 scope link 172.31.51.82 dev eni524077fd828 scope link 172.31.51.108 dev eni08e24263c30 scope link 172.31.51.218 dev enicb4edb90122 scope link 172.31.52.71 dev eni61a9554ce92 scope link 172.31.52.205 dev eniabe0e0a95e5 scope link 172.31.52.222 dev eni60eac028c5b scope link 172.31.53.74 dev enibecb9c399f8 scope link 172.31.53.79 dev eni6c5800d82af scope link 172.31.53.238 dev eni5a413534f4e scope link 172.31.54.85 dev eni2acd4947ff6 scope link 172.31.54.196 dev eni54f6d6a6254 scope link 172.31.54.200 dev eni47a45758006 scope link 172.31.55.130 dev eni1658effeb9c scope link 172.31.55.135 dev enibe97b10ca0d scope link 172.31.55.235 dev eni179f5c3696c scope link 172.31.56.137 dev eni099fbf41bd0 scope link 172.31.57.72 dev eni10574b2dfef scope link 172.31.58.18 dev eni5434103f7b9 scope link 172.31.58.47 dev enif4a18529a5f scope link 172.31.59.200 dev eni308c9b2c04f scope link 172.31.59.203 dev enia94f8f21d94 scope link 172.31.60.128 dev eni11239f98883 scope link 172.31.61.61 dev eni84312c21e65 scope link 172.31.61.216 dev enid75abf4f5e0 scope link 172.31.63.97 dev eni3ea3753c729 scope link 172.31.63.121 dev eni8bac6c0ff3f scope link 172.31.63.248 dev enie5c85d50c09 scope link
查看 table 3 的内容:
1 2 3
[root@ip-172-31-53-61 ~]# ip r s table 3 default via 172.31.48.1 dev eth2 172.31.48.1 dev eth2 scope link
查看tables 2 的内容:
1 2 3
[root@ip-172-31-53-61 ~]# ip r s table 2 default via 172.31.48.1 dev eth1 172.31.48.1 dev eth1 scope link
[root@ip-172-31-53-61 ~]# ip rule show 0: from all lookup local 512: from all to 172.31.49.222 lookup main 512: from all to 172.31.52.222 lookup main 512: from all to 172.31.59.203 lookup main 512: from all to 172.31.61.61 lookup main 512: from all to 172.31.49.246 lookup main 512: from all to 172.31.58.47 lookup main 512: from all to 172.31.53.79 lookup main 512: from all to 172.31.63.97 lookup main 512: from all to 172.31.53.74 lookup main 512: from all to 172.31.54.196 lookup main 512: from all to 172.31.51.218 lookup main 512: from all to 172.31.63.248 lookup main 512: from all to 172.31.54.200 lookup main 512: from all to 172.31.51.108 lookup main 512: from all to 172.31.56.137 lookup main 512: from all to 172.31.54.85 lookup main 512: from all to 172.31.51.82 lookup main 512: from all to 172.31.57.72 lookup main 512: from all to 172.31.59.200 lookup main 512: from all to 172.31.58.18 lookup main 512: from all to 172.31.55.235 lookup main 512: from all to 172.31.48.162 lookup main 512: from all to 172.31.60.128 lookup main 512: from all to 172.31.50.246 lookup main 512: from all to 172.31.61.216 lookup main 512: from all to 172.31.55.130 lookup main 512: from all to 172.31.49.208 lookup main 512: from all to 172.31.55.135 lookup main 512: from all to 172.31.50.208 lookup main 512: from all to 172.31.63.121 lookup main 512: from all to 172.31.52.205 lookup main 512: from all to 172.31.52.71 lookup main 512: from all to 172.31.51.7 lookup main 512: from all to 172.31.53.238 lookup main 1024: from all fwmark 0x80/0x80 lookup main 1536: from 172.31.53.238 lookup 3 1536: from 172.31.51.7 lookup 3 1536: from 172.31.52.205 lookup 3 1536: from 172.31.52.71 lookup 3 1536: from 172.31.63.121 lookup 3 1536: from 172.31.50.208 lookup 3 1536: from 172.31.51.82 lookup 2 1536: from 172.31.55.130 lookup 2 1536: from 172.31.61.216 lookup 2 1536: from 172.31.49.208 lookup 2 1536: from 172.31.60.128 lookup 2 1536: from 172.31.48.162 lookup 2 1536: from 172.31.50.246 lookup 2 1536: from 172.31.58.18 lookup 2 1536: from 172.31.56.137 lookup 2 1536: from 172.31.57.72 lookup 2 1536: from 172.31.59.200 lookup 2 1536: from 172.31.54.85 lookup 2 1536: from 172.31.55.235 lookup 2 1536: from 172.31.55.135 lookup 2 32766: from all lookup main 32767: from all lookup default
查看 table 2 的内容:
1 2 3
[root@ip-172-31-53-61 ~]# ip r s table 2 default via 172.31.48.1 dev eth1 172.31.48.1 dev eth1 scope link
查看 table 3 的内容:
1 2 3
[root@ip-172-31-53-61 ~]# ip r s table 3 default via 172.31.48.1 dev eth2 172.31.48.1 dev eth2 scope link
[root@ip-172-31-53-61 ~]# ip r s table main default via 172.31.48.1 dev eth0 169.254.169.254 dev eth0 172.31.48.0/20 dev eth0 proto kernel scope link src 172.31.53.61 172.31.48.162 dev enicfd09b318e8 scope link 172.31.49.208 dev eni3512a649bfb scope link 172.31.49.222 dev eni8cf9e51b58a scope link 172.31.49.246 dev eni9f41e641d45 scope link 172.31.50.208 dev eniffd28bfda2d scope link 172.31.50.246 dev eni1abad8afd57 scope link 172.31.51.7 dev eni76e381844d3 scope link 172.31.51.82 dev eni524077fd828 scope link 172.31.51.108 dev eni08e24263c30 scope link 172.31.51.218 dev enicb4edb90122 scope link 172.31.52.71 dev eni61a9554ce92 scope link 172.31.52.205 dev eniabe0e0a95e5 scope link 172.31.52.222 dev eni60eac028c5b scope link 172.31.53.74 dev enibecb9c399f8 scope link 172.31.53.79 dev eni6c5800d82af scope link 172.31.53.238 dev eni5a413534f4e scope link 172.31.54.85 dev eni2acd4947ff6 scope link 172.31.54.196 dev eni54f6d6a6254 scope link 172.31.54.200 dev eni47a45758006 scope link 172.31.55.130 dev eni1658effeb9c scope link 172.31.55.135 dev enibe97b10ca0d scope link 172.31.55.235 dev eni179f5c3696c scope link 172.31.56.137 dev eni099fbf41bd0 scope link 172.31.57.72 dev eni10574b2dfef scope link 172.31.58.18 dev eni5434103f7b9 scope link 172.31.58.47 dev enif4a18529a5f scope link 172.31.59.200 dev eni308c9b2c04f scope link 172.31.59.203 dev enia94f8f21d94 scope link 172.31.60.128 dev eni11239f98883 scope link 172.31.61.61 dev eni84312c21e65 scope link 172.31.61.216 dev enid75abf4f5e0 scope link 172.31.63.97 dev eni3ea3753c729 scope link 172.31.63.121 dev eni8bac6c0ff3f scope link 172.31.63.248 dev enie5c85d50c09 scope link