File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -105,8 +105,9 @@ broadcast 192.0.2.255 dev eth0 proto kernel scope link src 192.0.2.1
105105
106106 特别地,如果路由规则的类型为 ` throw ` ,则跳出当前路由表,继续考察后续的路由规则。
107107
108- 路由规则存储在内核中的 RPDB,可以通过 ` ip rule ` 命令查看当前的路由规则列表。
109- 每条路由规则都有一个优先级(preference / priority),数值越小优先级越高,默认情况下,内核会维护三条基本的路由规则(IPv6 为两条):
108+ 路由规则存储在内核中,可以通过 ` ip rule ` 命令查看。
109+ 每条路由规则都有一个优先级(preference / priority),数值越小则优先级越高。
110+ 在启动时,内核会自动创建三条默认的 IPv4 路由规则和两条默认的 IPv6 路由规则:
110111
111112``` shell title="IPv4 默认路由规则"
112113$ ip rule
@@ -122,7 +123,7 @@ $ ip -6 rule
12212332766: from all lookup main # (1)!
123124```
124125
125- 1 . 注意 IPv6 默认没有指向 ` default ` 路由表的规则
126+ 1 . IPv6 的默认路由规则不包括 ` default ` 路由表,尽管你可以手动添加该规则。
126127
127128在内核中,每个路由表都有一个编号,默认的路由表编号如下:
128129
@@ -146,7 +147,7 @@ ip rule add from 192.0.2.0/24 table 100 pref 1000
146147
147148在以上命令中,` from 192.0.2.0/24 ` 指定了匹配条件,` table 100 ` 指定“动作”为进入路由表 100,` pref 1000 ` 指定该规则的优先级。
148149
149- 由于内核不保证相同优先级的规则的顺序 ,因此我们建议仅为逻辑上完全互斥的规则使用相同的优先级,避免出现非预期的行为。
150+ 由于内核不保证相同优先级的规则之间的顺序 ,因此我们建议仅为逻辑上完全互斥的规则使用相同的优先级,避免出现非预期的行为。
150151
151152#### 自定义路由表 {#custom-routing-tables}
152153
You can’t perform that action at this time.
0 commit comments