Skip to content

Commit 17c9188

Browse files
donaldsharpdavem330
authored andcommitted
doc: Update VRF documentation metric
Two things: 1) Update examples to show usage of metric 2) Discuss reasoning for using such a high metric. Signed-off-by: Donald Sharp <[email protected]> Acked-by: David Ahern <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 9854d75 commit 17c9188

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

Documentation/networking/vrf.txt

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,12 @@ Setup
7171
ip ru add iif vrf-blue table 10
7272

7373
3. Set the default route for the table (and hence default route for the VRF).
74-
ip route add table 10 unreachable default
74+
ip route add table 10 unreachable default metric 4278198272
75+
76+
This high metric value ensures that the default unreachable route can
77+
be overridden by a routing protocol suite. FRRouting interprets
78+
kernel metrics as a combined admin distance (upper byte) and priority
79+
(lower 3 bytes). Thus the above metric translates to [255/8192].
7580

7681
4. Enslave L3 interfaces to a VRF device.
7782
ip link set dev eth1 master vrf-blue
@@ -256,7 +261,7 @@ older form without it.
256261

257262
For example:
258263
$ ip route show vrf red
259-
prohibit default
264+
unreachable default metric 4278198272
260265
broadcast 10.2.1.0 dev eth1 proto kernel scope link src 10.2.1.2
261266
10.2.1.0/24 dev eth1 proto kernel scope link src 10.2.1.2
262267
local 10.2.1.2 dev eth1 proto kernel scope host src 10.2.1.2
@@ -282,7 +287,7 @@ older form without it.
282287
ff00::/8 dev red metric 256 pref medium
283288
ff00::/8 dev eth1 metric 256 pref medium
284289
ff00::/8 dev eth2 metric 256 pref medium
285-
290+
unreachable default dev lo metric 4278198272 error -101 pref medium
286291

287292
8. Route Lookup for a VRF
288293

@@ -331,7 +336,7 @@ function vrf_create
331336
ip link add ${VRF} type vrf table ${TBID}
332337

333338
if [ "${VRF}" != "mgmt" ]; then
334-
ip route add table ${TBID} unreachable default
339+
ip route add table ${TBID} unreachable default metric 4278198272
335340
fi
336341
ip link set dev ${VRF} up
337342
}

0 commit comments

Comments
 (0)