€•oâŒsphinx.addnodes”Œdocument”“”)�”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)�”}”(hhh]”(hŒ pending_xref”“”)�”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…”�”}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ"/translations/zh_CN/networking/vrf”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)�”}”(hhh]”hŒChinese (Traditional)”…”�”}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ"/translations/zh_TW/networking/vrf”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒItalian”…”�”}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ"/translations/it_IT/networking/vrf”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒJapanese”…”�”}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ"/translations/ja_JP/networking/vrf”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒKorean”…”�”}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ"/translations/ko_KR/networking/vrf”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒPortuguese (Brazilian)”…”�”}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ"/translations/pt_BR/networking/vrf”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒSpanish”…”�”}”hh–sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ"/translations/sp_SP/networking/vrf”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒcomment”“”)�”}”(hŒ SPDX-License-Identifier: GPL-2.0”h]”hŒ SPDX-License-Identifier: GPL-2.0”…”�”}”hh·sbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1hµhhh²hh³Œ route table 10 +-----------------------------+ | | | +------+ +------+ +-------------+ | eth1 | | eth2 | ... | bond1 | +------+ +------+ +-------------+ | | +------+ +------+ | eth8 | | eth9 | +------+ +------+”h]”hX™+-----------------------------+ | vrf-blue | ===> route table 10 +-----------------------------+ | | | +------+ +------+ +-------------+ | eth1 | | eth2 | ... | bond1 | +------+ +------+ +-------------+ | | +------+ +------+ | eth8 | | eth9 | +------+ +------+”…”�”}”hj;sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j9h³hÇh´K"hjh²hubhï)�”}”(hXPackets received on an enslaved device and are switched to the VRF device in the IPv4 and IPv6 processing stacks giving the impression that packets flow through the VRF device. Similarly on egress routing rules are used to send packets to the VRF device driver before getting sent out the actual interface. This allows tcpdump on a VRF device to capture all packets into and out of the VRF as a whole\ [1]_. Similarly, netfilter\ [2]_ and tc rules can be applied using the VRF device to specify rules that apply to the VRF domain as a whole.”h]”(hX’Packets received on an enslaved device and are switched to the VRF device in the IPv4 and IPv6 processing stacks giving the impression that packets flow through the VRF device. Similarly on egress routing rules are used to send packets to the VRF device driver before getting sent out the actual interface. This allows tcpdump on a VRF device to capture all packets into and out of the VRF as a whole ”…”�”}”(hjIh²hh³Nh´NubhŒfootnote_reference”“”)�”}”(hŒ[1]_”h]”hŒ1”…”�”}”(hjSh²hh³Nh´Nubah}”(h]”Œid1”ah ]”h"]”h$]”h&]”Œrefid”Œid3”Œdocname”Œnetworking/vrf”uh1jQhjIŒresolved”KubhŒ. Similarly, netfilter ”…”�”}”(hjIh²hh³Nh´NubjR)�”}”(hŒ[2]_”h]”hŒ2”…”�”}”(hjkh²hh³Nh´Nubah}”(h]”Œid2”ah ]”h"]”h$]”h&]”jbŒid4”jdjeuh1jQhjIjfKubhŒk and tc rules can be applied using the VRF device to specify rules that apply to the VRF domain as a whole.”…”�”}”(hjIh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K.hjh²hubhŒfootnote”“”)�”}”(hŒ›Packets in the forwarded state do not flow through the device, so those packets are not seen by tcpdump. Will revisit this limitation in a future release. ”h]”(hŒlabel”“”)�”}”(hŒ1”h]”hŒ1”…”�”}”(hj�h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j‹hj‡ubhï)�”}”(hŒšPackets in the forwarded state do not flow through the device, so those packets are not seen by tcpdump. Will revisit this limitation in a future release.”h]”hŒšPackets in the forwarded state do not flow through the device, so those packets are not seen by tcpdump. Will revisit this limitation in a future release.”…”�”}”(hj›h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K7hj‡ubeh}”(h]”jcah ]”h"]”Œ1”ah$]”h&]”j]ajdjeuh1j…h³hÇh´K7hjh²hjfKubj†)�”}”(hXIptables on ingress supports PREROUTING with skb->dev set to the real ingress device and both INPUT and PREROUTING rules with skb->dev set to the VRF device. For egress POSTROUTING and OUTPUT rules can be written using either the VRF device or real egress device. ”h]”(jŒ)�”}”(hŒ2”h]”hŒ2”…”�”}”(hj´h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j‹hj°ubhï)�”}”(hXIptables on ingress supports PREROUTING with skb->dev set to the real ingress device and both INPUT and PREROUTING rules with skb->dev set to the VRF device. For egress POSTROUTING and OUTPUT rules can be written using either the VRF device or real egress device.”h]”hXIptables on ingress supports PREROUTING with skb->dev set to the real ingress device and both INPUT and PREROUTING rules with skb->dev set to the VRF device. For egress POSTROUTING and OUTPUT rules can be written using either the VRF device or real egress device.”…”�”}”(hjÂh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K;hj°ubeh}”(h]”jzah ]”h"]”Œ2”ah$]”h&]”juajdjeuh1j…h³hÇh´K;hjh²hjfKubeh}”(h]”Œdesign”ah ]”h"]”Œdesign”ah$]”h&]”uh1hÈhhÝh²hh³hÇh´KubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒSetup”h]”hŒSetup”…”�”}”(hjâh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjßh²hh³hÇh´KAubhŒenumerated_list”“”)�”}”(hhh]”(hŒ list_item”“”)�”}”(hŒ�VRF device is created with an association to a FIB table. e.g,:: ip link add vrf-blue type vrf table 10 ip link set dev vrf-blue up ”h]”(hï)�”}”(hŒ@VRF device is created with an association to a FIB table. e.g,::”h]”hŒ?VRF device is created with an association to a FIB table. e.g,:”…”�”}”(hjûh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KBhj÷ubj:)�”}”(hŒBip link add vrf-blue type vrf table 10 ip link set dev vrf-blue up”h]”hŒBip link add vrf-blue type vrf table 10 ip link set dev vrf-blue up”…”�”}”hj sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j9h³hÇh´KEhj÷ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jõhjòh²hh³hÇh´Nubjö)�”}”(hXîAn l3mdev FIB rule directs lookups to the table associated with the device. A single l3mdev rule is sufficient for all VRFs. The VRF device adds the l3mdev rule for IPv4 and IPv6 when the first device is created with a default preference of 1000. Users may delete the rule if desired and add with a different priority or install per-VRF rules. Prior to the v4.8 kernel iif and oif rules are needed for each VRF device:: ip ru add oif vrf-blue table 10 ip ru add iif vrf-blue table 10 ”h]”(hï)�”}”(hXWAn l3mdev FIB rule directs lookups to the table associated with the device. A single l3mdev rule is sufficient for all VRFs. The VRF device adds the l3mdev rule for IPv4 and IPv6 when the first device is created with a default preference of 1000. Users may delete the rule if desired and add with a different priority or install per-VRF rules.”h]”hXWAn l3mdev FIB rule directs lookups to the table associated with the device. A single l3mdev rule is sufficient for all VRFs. The VRF device adds the l3mdev rule for IPv4 and IPv6 when the first device is created with a default preference of 1000. Users may delete the rule if desired and add with a different priority or install per-VRF rules.”…”�”}”(hj!h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KHhjubhï)�”}”(hŒKPrior to the v4.8 kernel iif and oif rules are needed for each VRF device::”h]”hŒJPrior to the v4.8 kernel iif and oif rules are needed for each VRF device:”…”�”}”(hj/h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KNhjubj:)�”}”(hŒ?ip ru add oif vrf-blue table 10 ip ru add iif vrf-blue table 10”h]”hŒ?ip ru add oif vrf-blue table 10 ip ru add iif vrf-blue table 10”…”�”}”hj=sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j9h³hÇh´KPhjubeh}”(h]”h ]”h"]”h$]”h&]”uh1jõhjòh²hh³hÇh´Nubjö)�”}”(hX�Set the default route for the table (and hence default route for the VRF):: ip route add table 10 unreachable default metric 4278198272 This high metric value ensures that the default unreachable route can be overridden by a routing protocol suite. FRRouting interprets kernel metrics as a combined admin distance (upper byte) and priority (lower 3 bytes). Thus the above metric translates to [255/8192]. ”h]”(hï)�”}”(hŒKSet the default route for the table (and hence default route for the VRF)::”h]”hŒJSet the default route for the table (and hence default route for the VRF):”…”�”}”(hjUh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KShjQubj:)�”}”(hŒ;ip route add table 10 unreachable default metric 4278198272”h]”hŒ;ip route add table 10 unreachable default metric 4278198272”…”�”}”hjcsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j9h³hÇh´KUhjQubhï)�”}”(hXThis high metric value ensures that the default unreachable route can be overridden by a routing protocol suite. FRRouting interprets kernel metrics as a combined admin distance (upper byte) and priority (lower 3 bytes). Thus the above metric translates to [255/8192].”h]”hXThis high metric value ensures that the default unreachable route can be overridden by a routing protocol suite. FRRouting interprets kernel metrics as a combined admin distance (upper byte) and priority (lower 3 bytes). Thus the above metric translates to [255/8192].”…”�”}”(hjqh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KWhjQubeh}”(h]”h ]”h"]”h$]”h&]”uh1jõhjòh²hh³hÇh´Nubjö)�”}”(hXÿEnslave L3 interfaces to a VRF device:: ip link set dev eth1 master vrf-blue Local and connected routes for enslaved devices are automatically moved to the table associated with VRF device. Any additional routes depending on the enslaved device are dropped and will need to be reinserted to the VRF FIB table following the enslavement. The IPv6 sysctl option keep_addr_on_down can be enabled to keep IPv6 global addresses as VRF enslavement changes:: sysctl -w net.ipv6.conf.all.keep_addr_on_down=1 ”h]”(hï)�”}”(hŒ'Enslave L3 interfaces to a VRF device::”h]”hŒ&Enslave L3 interfaces to a VRF device:”…”�”}”(hj‰h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K\hj…ubj:)�”}”(hŒ$ip link set dev eth1 master vrf-blue”h]”hŒ$ip link set dev eth1 master vrf-blue”…”�”}”hj—sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j9h³hÇh´K^hj…ubhï)�”}”(hXLocal and connected routes for enslaved devices are automatically moved to the table associated with VRF device. Any additional routes depending on the enslaved device are dropped and will need to be reinserted to the VRF FIB table following the enslavement.”h]”hXLocal and connected routes for enslaved devices are automatically moved to the table associated with VRF device. Any additional routes depending on the enslaved device are dropped and will need to be reinserted to the VRF FIB table following the enslavement.”…”�”}”(hj¥h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K`hj…ubhï)�”}”(hŒrThe IPv6 sysctl option keep_addr_on_down can be enabled to keep IPv6 global addresses as VRF enslavement changes::”h]”hŒqThe IPv6 sysctl option keep_addr_on_down can be enabled to keep IPv6 global addresses as VRF enslavement changes:”…”�”}”(hj³h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Kehj…ubj:)�”}”(hŒ/sysctl -w net.ipv6.conf.all.keep_addr_on_down=1”h]”hŒ/sysctl -w net.ipv6.conf.all.keep_addr_on_down=1”…”�”}”hjÁsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j9h³hÇh´Khhj…ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jõhjòh²hh³hÇh´Nubjö)�”}”(hŒVAdditional VRF routes are added to associated table:: ip route add table 10 ... ”h]”(hï)�”}”(hŒ5Additional VRF routes are added to associated table::”h]”hŒ4Additional VRF routes are added to associated table:”…”�”}”(hjÙh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KjhjÕubj:)�”}”(hŒip route add table 10 ...”h]”hŒip route add table 10 ...”…”�”}”hjçsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j9h³hÇh´KlhjÕubeh}”(h]”h ]”h"]”h$]”h&]”uh1jõhjòh²hh³hÇh´Nubeh}”(h]”h ]”h"]”h$]”h&]”Œenumtype”Œarabic”Œprefix”hŒsuffix”Œ.”uh1jðhjßh²hh³hÇh´KBubeh}”(h]”Œsetup”ah ]”h"]”Œsetup”ah$]”h&]”uh1hÈhhÝh²hh³hÇh´KAubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒ Applications”h]”hŒ Applications”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjh²hh³hÇh´Kpubhï)�”}”(hŒXApplications that are to work within a VRF need to bind their socket to the VRF device::”h]”hŒWApplications that are to work within a VRF need to bind their socket to the VRF device:”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Kqhjh²hubj:)�”}”(hŒ@setsockopt(sd, SOL_SOCKET, SO_BINDTODEVICE, dev, strlen(dev)+1);”h]”hŒ@setsockopt(sd, SOL_SOCKET, SO_BINDTODEVICE, dev, strlen(dev)+1);”…”�”}”hj-sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j9h³hÇh´Kthjh²hubhï)�”}”(hŒ:or to specify the output device using cmsg and IP_PKTINFO.”h]”hŒ:or to specify the output device using cmsg and IP_PKTINFO.”…”�”}”(hj;h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Kvhjh²hubhï)�”}”(hŒ÷By default the scope of the port bindings for unbound sockets is limited to the default VRF. That is, it will not be matched by packets arriving on interfaces enslaved to an l3mdev and processes may bind to the same port if they bind to an l3mdev.”h]”hŒ÷By default the scope of the port bindings for unbound sockets is limited to the default VRF. That is, it will not be matched by packets arriving on interfaces enslaved to an l3mdev and processes may bind to the same port if they bind to an l3mdev.”…”�”}”(hjIh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Kxhjh²hubhï)�”}”(hŒÁTCP & UDP services running in the default VRF context (ie., not bound to any VRF device) can work across all VRF domains by enabling the tcp_l3mdev_accept and udp_l3mdev_accept sysctl options::”h]”hŒÀTCP & UDP services running in the default VRF context (ie., not bound to any VRF device) can work across all VRF domains by enabling the tcp_l3mdev_accept and udp_l3mdev_accept sysctl options:”…”�”}”(hjWh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K}hjh²hubj:)�”}”(hŒMsysctl -w net.ipv4.tcp_l3mdev_accept=1 sysctl -w net.ipv4.udp_l3mdev_accept=1”h]”hŒMsysctl -w net.ipv4.tcp_l3mdev_accept=1 sysctl -w net.ipv4.udp_l3mdev_accept=1”…”�”}”hjesbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j9h³hÇh´K�hjh²hubhï)�”}”(hX–These options are disabled by default so that a socket in a VRF is only selected for packets in that VRF. There is a similar option for RAW sockets, which is enabled by default for reasons of backwards compatibility. This is so as to specify the output device with cmsg and IP_PKTINFO, but using a socket not bound to the corresponding VRF. This allows e.g. older ping implementations to be run with specifying the device but without executing it in the VRF. This option can be disabled so that packets received in a VRF context are only handled by a raw socket bound to the VRF, and packets in the default VRF are only handled by a socket not bound to any VRF::”h]”hX•These options are disabled by default so that a socket in a VRF is only selected for packets in that VRF. There is a similar option for RAW sockets, which is enabled by default for reasons of backwards compatibility. This is so as to specify the output device with cmsg and IP_PKTINFO, but using a socket not bound to the corresponding VRF. This allows e.g. older ping implementations to be run with specifying the device but without executing it in the VRF. This option can be disabled so that packets received in a VRF context are only handled by a raw socket bound to the VRF, and packets in the default VRF are only handled by a socket not bound to any VRF:”…”�”}”(hjsh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K„hjh²hubj:)�”}”(hŒ&sysctl -w net.ipv4.raw_l3mdev_accept=0”h]”hŒ&sysctl -w net.ipv4.raw_l3mdev_accept=0”…”�”}”hj�sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j9h³hÇh´KŽhjh²hubhï)�”}”(hŒunetfilter rules on the VRF device can be used to limit access to services running in the default VRF context as well.”h]”hŒunetfilter rules on the VRF device can be used to limit access to services running in the default VRF context as well.”…”�”}”(hj�h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K�hjh²hubhï)�”}”(hX|Using VRF-aware applications (applications which simultaneously create sockets outside and inside VRFs) in conjunction with ``net.ipv4.tcp_l3mdev_accept=1`` is possible but may lead to problems in some situations. With that sysctl value, it is unspecified which listening socket will be selected to handle connections for VRF traffic; ie. either a socket bound to the VRF or an unbound socket may be used to accept new connections from a VRF. This somewhat unexpected behavior can lead to problems if sockets are configured with extra options (ex. TCP MD5 keys) with the expectation that VRF traffic will exclusively be handled by sockets bound to VRFs, as would be the case with ``net.ipv4.tcp_l3mdev_accept=0``. Finally and as a reminder, regardless of which listening socket is selected, established sockets will be created in the VRF based on the ingress interface, as documented earlier.”h]”(hŒ|Using VRF-aware applications (applications which simultaneously create sockets outside and inside VRFs) in conjunction with ”…”�”}”(hj�h²hh³Nh´NubhŒliteral”“”)�”}”(hŒ ``net.ipv4.tcp_l3mdev_accept=1``”h]”hŒnet.ipv4.tcp_l3mdev_accept=1”…”�”}”(hj§h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j¥hj�ubhX  is possible but may lead to problems in some situations. With that sysctl value, it is unspecified which listening socket will be selected to handle connections for VRF traffic; ie. either a socket bound to the VRF or an unbound socket may be used to accept new connections from a VRF. This somewhat unexpected behavior can lead to problems if sockets are configured with extra options (ex. TCP MD5 keys) with the expectation that VRF traffic will exclusively be handled by sockets bound to VRFs, as would be the case with ”…”�”}”(hj�h²hh³Nh´Nubj¦)�”}”(hŒ ``net.ipv4.tcp_l3mdev_accept=0``”h]”hŒnet.ipv4.tcp_l3mdev_accept=0”…”�”}”(hj¹h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j¥hj�ubhŒ´. Finally and as a reminder, regardless of which listening socket is selected, established sockets will be created in the VRF based on the ingress interface, as documented earlier.”…”�”}”(hj�h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K“hjh²hubeh}”(h]”Œ applications”ah ]”h"]”Œ applications”ah$]”h&]”uh1hÈhhÝh²hh³hÇh´Kpubeh}”(h]”Œthe-vrf-device”ah ]”h"]”Œthe vrf device”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´KubhŒ transition”“”)�”}”(hŒP--------------------------------------------------------------------------------”h]”h}”(h]”h ]”h"]”h$]”h&]”uh1jáh³hÇh´K hhÊh²hubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒUsing iproute2 for VRFs”h]”hŒUsing iproute2 for VRFs”…”�”}”(hjðh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjíh²hh³hÇh´K£ubhï)�”}”(hŒ³iproute2 supports the vrf keyword as of v4.7. For backwards compatibility this section lists both commands where appropriate -- with the vrf keyword and the older form without it.”h]”hŒ³iproute2 supports the vrf keyword as of v4.7. For backwards compatibility this section lists both commands where appropriate -- with the vrf keyword and the older form without it.”…”�”}”(hjþh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K¤hjíh²hubjñ)�”}”(hhh]”(jö)�”}”(hXCreate a VRF To instantiate a VRF device and associate it with a table:: $ ip link add dev NAME type vrf table ID As of v4.8 the kernel supports the l3mdev FIB rule where a single rule covers all VRFs. The l3mdev rule is created for IPv4 and IPv6 on first device create. ”h]”(hï)�”}”(hŒ Create a VRF”h]”hŒ Create a VRF”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K¨hjubhï)�”}”(hŒ;To instantiate a VRF device and associate it with a table::”h]”hŒ:To instantiate a VRF device and associate it with a table:”…”�”}”(hj!h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Kªhjubj:)�”}”(hŒ($ ip link add dev NAME type vrf table ID”h]”hŒ($ ip link add dev NAME type vrf table ID”…”�”}”hj/sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j9h³hÇh´K¬hjubhï)�”}”(hŒœAs of v4.8 the kernel supports the l3mdev FIB rule where a single rule covers all VRFs. The l3mdev rule is created for IPv4 and IPv6 on first device create.”h]”hŒœAs of v4.8 the kernel supports the l3mdev FIB rule where a single rule covers all VRFs. The l3mdev rule is created for IPv4 and IPv6 on first device create.”…”�”}”(hj=h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K®hjubeh}”(h]”h ]”h"]”h$]”h&]”uh1jõhj h²hh³hÇh´Nubjö)�”}”(hX«List VRFs To list VRFs that have been created:: $ ip [-d] link show type vrf NOTE: The -d option is needed to show the table id For example:: $ ip -d link show type vrf 11: mgmt: mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000 link/ether 72:b3:ba:91:e2:24 brd ff:ff:ff:ff:ff:ff promiscuity 0 vrf table 1 addrgenmode eui64 12: red: mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000 link/ether b6:6f:6e:f6:da:73 brd ff:ff:ff:ff:ff:ff promiscuity 0 vrf table 10 addrgenmode eui64 13: blue: mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000 link/ether 36:62:e8:7d:bb:8c brd ff:ff:ff:ff:ff:ff promiscuity 0 vrf table 66 addrgenmode eui64 14: green: mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000 link/ether e6:28:b8:63:70:bb brd ff:ff:ff:ff:ff:ff promiscuity 0 vrf table 81 addrgenmode eui64 Or in brief output:: $ ip -br link show type vrf mgmt UP 72:b3:ba:91:e2:24 red UP b6:6f:6e:f6:da:73 blue UP 36:62:e8:7d:bb:8c green UP e6:28:b8:63:70:bb ”h]”(hï)�”}”(hŒ List VRFs”h]”hŒ List VRFs”…”�”}”(hjUh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K²hjQubhï)�”}”(hŒ%To list VRFs that have been created::”h]”hŒ$To list VRFs that have been created:”…”�”}”(hjch²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K´hjQubj:)�”}”(hŒQ$ ip [-d] link show type vrf NOTE: The -d option is needed to show the table id”h]”hŒQ$ ip [-d] link show type vrf NOTE: The -d option is needed to show the table id”…”�”}”hjqsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j9h³hÇh´K¶hjQubhï)�”}”(hŒ For example::”h]”hŒ For example:”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K¹hjQubj:)�”}”(hXm$ ip -d link show type vrf 11: mgmt: mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000 link/ether 72:b3:ba:91:e2:24 brd ff:ff:ff:ff:ff:ff promiscuity 0 vrf table 1 addrgenmode eui64 12: red: mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000 link/ether b6:6f:6e:f6:da:73 brd ff:ff:ff:ff:ff:ff promiscuity 0 vrf table 10 addrgenmode eui64 13: blue: mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000 link/ether 36:62:e8:7d:bb:8c brd ff:ff:ff:ff:ff:ff promiscuity 0 vrf table 66 addrgenmode eui64 14: green: mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000 link/ether e6:28:b8:63:70:bb brd ff:ff:ff:ff:ff:ff promiscuity 0 vrf table 81 addrgenmode eui64”h]”hXm$ ip -d link show type vrf 11: mgmt: mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000 link/ether 72:b3:ba:91:e2:24 brd ff:ff:ff:ff:ff:ff promiscuity 0 vrf table 1 addrgenmode eui64 12: red: mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000 link/ether b6:6f:6e:f6:da:73 brd ff:ff:ff:ff:ff:ff promiscuity 0 vrf table 10 addrgenmode eui64 13: blue: mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000 link/ether 36:62:e8:7d:bb:8c brd ff:ff:ff:ff:ff:ff promiscuity 0 vrf table 66 addrgenmode eui64 14: green: mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000 link/ether e6:28:b8:63:70:bb brd ff:ff:ff:ff:ff:ff promiscuity 0 vrf table 81 addrgenmode eui64”…”�”}”hj�sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j9h³hÇh´K»hjQubhï)�”}”(hŒOr in brief output::”h]”hŒOr in brief output:”…”�”}”(hj›h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KÊhjQubj:)�”}”(hX?$ ip -br link show type vrf mgmt UP 72:b3:ba:91:e2:24 red UP b6:6f:6e:f6:da:73 blue UP 36:62:e8:7d:bb:8c green UP e6:28:b8:63:70:bb ”h]”hX?$ ip -br link show type vrf mgmt UP 72:b3:ba:91:e2:24 red UP b6:6f:6e:f6:da:73 blue UP 36:62:e8:7d:bb:8c green UP e6:28:b8:63:70:bb ”…”�”}”hj©sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j9h³hÇh´KÌhjQubeh}”(h]”h ]”h"]”h$]”h&]”uh1jõhj h²hh³hÇh´Nubjö)�”}”(hXKAssign a Network Interface to a VRF Network interfaces are assigned to a VRF by enslaving the netdevice to a VRF device:: $ ip link set dev NAME master NAME On enslavement connected and local routes are automatically moved to the table associated with the VRF device. For example:: $ ip link set dev eth0 master mgmt ”h]”(hï)�”}”(hŒ#Assign a Network Interface to a VRF”h]”hŒ#Assign a Network Interface to a VRF”…”�”}”(hjÁh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KÓhj½ubhï)�”}”(hŒUNetwork interfaces are assigned to a VRF by enslaving the netdevice to a VRF device::”h]”hŒTNetwork interfaces are assigned to a VRF by enslaving the netdevice to a VRF device:”…”�”}”(hjÏh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KÕhj½ubj:)�”}”(hŒ"$ ip link set dev NAME master NAME”h]”hŒ"$ ip link set dev NAME master NAME”…”�”}”hjÝsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j9h³hÇh´KØhj½ubhï)�”}”(hŒnOn enslavement connected and local routes are automatically moved to the table associated with the VRF device.”h]”hŒnOn enslavement connected and local routes are automatically moved to the table associated with the VRF device.”…”�”}”(hjëh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KÚhj½ubhï)�”}”(hŒ For example::”h]”hŒ For example:”…”�”}”(hjùh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KÝhj½ubj:)�”}”(hŒ"$ ip link set dev eth0 master mgmt”h]”hŒ"$ ip link set dev eth0 master mgmt”…”�”}”hjsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j9h³hÇh´Kßhj½ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jõhj h²hh³hÇh´Nubjö)�”}”(hXMShow Devices Assigned to a VRF To show devices that have been assigned to a specific VRF add the master option to the ip command:: $ ip link show vrf NAME $ ip link show master NAME For example:: $ ip link show vrf red 3: eth1: mtu 1500 qdisc pfifo_fast master red state UP mode DEFAULT group default qlen 1000 link/ether 02:00:00:00:02:02 brd ff:ff:ff:ff:ff:ff 4: eth2: mtu 1500 qdisc pfifo_fast master red state UP mode DEFAULT group default qlen 1000 link/ether 02:00:00:00:02:03 brd ff:ff:ff:ff:ff:ff 7: eth5: mtu 1500 qdisc noop master red state DOWN mode DEFAULT group default qlen 1000 link/ether 02:00:00:00:02:06 brd ff:ff:ff:ff:ff:ff Or using the brief output:: $ ip -br link show vrf red eth1 UP 02:00:00:00:02:02 eth2 UP 02:00:00:00:02:03 eth5 DOWN 02:00:00:00:02:06 ”h]”(hï)�”}”(hŒShow Devices Assigned to a VRF”h]”hŒShow Devices Assigned to a VRF”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Kâhjubhï)�”}”(hŒcTo show devices that have been assigned to a specific VRF add the master option to the ip command::”h]”hŒbTo show devices that have been assigned to a specific VRF add the master option to the ip command:”…”�”}”(hj-h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Kähjubj:)�”}”(hŒ2$ ip link show vrf NAME $ ip link show master NAME”h]”hŒ2$ ip link show vrf NAME $ ip link show master NAME”…”�”}”hj;sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j9h³hÇh´Kçhjubhï)�”}”(hŒ For example::”h]”hŒ For example:”…”�”}”(hjIh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Kêhjubj:)�”}”(hX%$ ip link show vrf red 3: eth1: mtu 1500 qdisc pfifo_fast master red state UP mode DEFAULT group default qlen 1000 link/ether 02:00:00:00:02:02 brd ff:ff:ff:ff:ff:ff 4: eth2: mtu 1500 qdisc pfifo_fast master red state UP mode DEFAULT group default qlen 1000 link/ether 02:00:00:00:02:03 brd ff:ff:ff:ff:ff:ff 7: eth5: mtu 1500 qdisc noop master red state DOWN mode DEFAULT group default qlen 1000 link/ether 02:00:00:00:02:06 brd ff:ff:ff:ff:ff:ff”h]”hX%$ ip link show vrf red 3: eth1: mtu 1500 qdisc pfifo_fast master red state UP mode DEFAULT group default qlen 1000 link/ether 02:00:00:00:02:02 brd ff:ff:ff:ff:ff:ff 4: eth2: mtu 1500 qdisc pfifo_fast master red state UP mode DEFAULT group default qlen 1000 link/ether 02:00:00:00:02:03 brd ff:ff:ff:ff:ff:ff 7: eth5: mtu 1500 qdisc noop master red state DOWN mode DEFAULT group default qlen 1000 link/ether 02:00:00:00:02:06 brd ff:ff:ff:ff:ff:ff”…”�”}”hjWsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j9h³hÇh´Kìhjubhï)�”}”(hŒOr using the brief output::”h]”hŒOr using the brief output:”…”�”}”(hjeh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Kõhjubj:)�”}”(hX $ ip -br link show vrf red eth1 UP 02:00:00:00:02:02 eth2 UP 02:00:00:00:02:03 eth5 DOWN 02:00:00:00:02:06 ”h]”hX $ ip -br link show vrf red eth1 UP 02:00:00:00:02:02 eth2 UP 02:00:00:00:02:03 eth5 DOWN 02:00:00:00:02:06 ”…”�”}”hjssbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j9h³hÇh´K÷hjubeh}”(h]”h ]”h"]”h$]”h&]”uh1jõhj h²hh³hÇh´Nubjö)�”}”(hXÜShow Neighbor Entries for a VRF To list neighbor entries associated with devices enslaved to a VRF device add the master option to the ip command:: $ ip [-6] neigh show vrf NAME $ ip [-6] neigh show master NAME For example:: $ ip neigh show vrf red 10.2.1.254 dev eth1 lladdr a6:d9:c7:4f:06:23 REACHABLE 10.2.2.254 dev eth2 lladdr 5e:54:01:6a:ee:80 REACHABLE $ ip -6 neigh show vrf red 2002:1::64 dev eth1 lladdr a6:d9:c7:4f:06:23 REACHABLE ”h]”(hï)�”}”(hŒShow Neighbor Entries for a VRF”h]”hŒShow Neighbor Entries for a VRF”…”�”}”(hj‹h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Kýhj‡ubhï)�”}”(hŒsTo list neighbor entries associated with devices enslaved to a VRF device add the master option to the ip command::”h]”hŒrTo list neighbor entries associated with devices enslaved to a VRF device add the master option to the ip command:”…”�”}”(hj™h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Kÿhj‡ubj:)�”}”(hŒ>$ ip [-6] neigh show vrf NAME $ ip [-6] neigh show master NAME”h]”hŒ>$ ip [-6] neigh show vrf NAME $ ip [-6] neigh show master NAME”…”�”}”hj§sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j9h³hÇh´Mhj‡ubhï)�”}”(hŒ For example::”h]”hŒ For example:”…”�”}”(hjµh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Mhj‡ubj:)�”}”(hŒÙ$ ip neigh show vrf red 10.2.1.254 dev eth1 lladdr a6:d9:c7:4f:06:23 REACHABLE 10.2.2.254 dev eth2 lladdr 5e:54:01:6a:ee:80 REACHABLE $ ip -6 neigh show vrf red 2002:1::64 dev eth1 lladdr a6:d9:c7:4f:06:23 REACHABLE”h]”hŒÙ$ ip neigh show vrf red 10.2.1.254 dev eth1 lladdr a6:d9:c7:4f:06:23 REACHABLE 10.2.2.254 dev eth2 lladdr 5e:54:01:6a:ee:80 REACHABLE $ ip -6 neigh show vrf red 2002:1::64 dev eth1 lladdr a6:d9:c7:4f:06:23 REACHABLE”…”�”}”hjÃsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j9h³hÇh´Mhj‡ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jõhj h²hh³hÇh´Nubjö)�”}”(hXDShow Addresses for a VRF To show addresses for interfaces associated with a VRF add the master option to the ip command:: $ ip addr show vrf NAME $ ip addr show master NAME For example:: $ ip addr show vrf red 3: eth1: mtu 1500 qdisc pfifo_fast master red state UP group default qlen 1000 link/ether 02:00:00:00:02:02 brd ff:ff:ff:ff:ff:ff inet 10.2.1.2/24 brd 10.2.1.255 scope global eth1 valid_lft forever preferred_lft forever inet6 2002:1::2/120 scope global valid_lft forever preferred_lft forever inet6 fe80::ff:fe00:202/64 scope link valid_lft forever preferred_lft forever 4: eth2: mtu 1500 qdisc pfifo_fast master red state UP group default qlen 1000 link/ether 02:00:00:00:02:03 brd ff:ff:ff:ff:ff:ff inet 10.2.2.2/24 brd 10.2.2.255 scope global eth2 valid_lft forever preferred_lft forever inet6 2002:2::2/120 scope global valid_lft forever preferred_lft forever inet6 fe80::ff:fe00:203/64 scope link valid_lft forever preferred_lft forever 7: eth5: mtu 1500 qdisc noop master red state DOWN group default qlen 1000 link/ether 02:00:00:00:02:06 brd ff:ff:ff:ff:ff:ff Or in brief format:: $ ip -br addr show vrf red eth1 UP 10.2.1.2/24 2002:1::2/120 fe80::ff:fe00:202/64 eth2 UP 10.2.2.2/24 2002:2::2/120 fe80::ff:fe00:203/64 eth5 DOWN ”h]”(hï)�”}”(hŒShow Addresses for a VRF”h]”hŒShow Addresses for a VRF”…”�”}”(hjÛh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Mhj×ubhï)�”}”(hŒ`To show addresses for interfaces associated with a VRF add the master option to the ip command::”h]”hŒ_To show addresses for interfaces associated with a VRF add the master option to the ip command:”…”�”}”(hjéh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Mhj×ubj:)�”}”(hŒ2$ ip addr show vrf NAME $ ip addr show master NAME”h]”hŒ2$ ip addr show vrf NAME $ ip addr show master NAME”…”�”}”hj÷sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j9h³hÇh´Mhj×ubhï)�”}”(hŒ For example::”h]”hŒ For example:”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Mhj×ubj:)�”}”(hX"$ ip addr show vrf red 3: eth1: mtu 1500 qdisc pfifo_fast master red state UP group default qlen 1000 link/ether 02:00:00:00:02:02 brd ff:ff:ff:ff:ff:ff inet 10.2.1.2/24 brd 10.2.1.255 scope global eth1 valid_lft forever preferred_lft forever inet6 2002:1::2/120 scope global valid_lft forever preferred_lft forever inet6 fe80::ff:fe00:202/64 scope link valid_lft forever preferred_lft forever 4: eth2: mtu 1500 qdisc pfifo_fast master red state UP group default qlen 1000 link/ether 02:00:00:00:02:03 brd ff:ff:ff:ff:ff:ff inet 10.2.2.2/24 brd 10.2.2.255 scope global eth2 valid_lft forever preferred_lft forever inet6 2002:2::2/120 scope global valid_lft forever preferred_lft forever inet6 fe80::ff:fe00:203/64 scope link valid_lft forever preferred_lft forever 7: eth5: mtu 1500 qdisc noop master red state DOWN group default qlen 1000 link/ether 02:00:00:00:02:06 brd ff:ff:ff:ff:ff:ff”h]”hX"$ ip addr show vrf red 3: eth1: mtu 1500 qdisc pfifo_fast master red state UP group default qlen 1000 link/ether 02:00:00:00:02:02 brd ff:ff:ff:ff:ff:ff inet 10.2.1.2/24 brd 10.2.1.255 scope global eth1 valid_lft forever preferred_lft forever inet6 2002:1::2/120 scope global valid_lft forever preferred_lft forever inet6 fe80::ff:fe00:202/64 scope link valid_lft forever preferred_lft forever 4: eth2: mtu 1500 qdisc pfifo_fast master red state UP group default qlen 1000 link/ether 02:00:00:00:02:03 brd ff:ff:ff:ff:ff:ff inet 10.2.2.2/24 brd 10.2.2.255 scope global eth2 valid_lft forever preferred_lft forever inet6 2002:2::2/120 scope global valid_lft forever preferred_lft forever inet6 fe80::ff:fe00:203/64 scope link valid_lft forever preferred_lft forever 7: eth5: mtu 1500 qdisc noop master red state DOWN group default qlen 1000 link/ether 02:00:00:00:02:06 brd ff:ff:ff:ff:ff:ff”…”�”}”hjsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j9h³hÇh´Mhj×ubhï)�”}”(hŒOr in brief format::”h]”hŒOr in brief format:”…”�”}”(hj!h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´M-hj×ubj:)�”}”(hŒÎ$ ip -br addr show vrf red eth1 UP 10.2.1.2/24 2002:1::2/120 fe80::ff:fe00:202/64 eth2 UP 10.2.2.2/24 2002:2::2/120 fe80::ff:fe00:203/64 eth5 DOWN”h]”hŒÎ$ ip -br addr show vrf red eth1 UP 10.2.1.2/24 2002:1::2/120 fe80::ff:fe00:202/64 eth2 UP 10.2.2.2/24 2002:2::2/120 fe80::ff:fe00:203/64 eth5 DOWN”…”�”}”hj/sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j9h³hÇh´M/hj×ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jõhj h²hh³hÇh´Nubjö)�”}”(hXJShow Routes for a VRF To show routes for a VRF use the ip command to display the table associated with the VRF device:: $ ip [-6] route show vrf NAME $ ip [-6] route show table ID For example:: $ ip route show vrf red unreachable default metric 4278198272 broadcast 10.2.1.0 dev eth1 proto kernel scope link src 10.2.1.2 10.2.1.0/24 dev eth1 proto kernel scope link src 10.2.1.2 local 10.2.1.2 dev eth1 proto kernel scope host src 10.2.1.2 broadcast 10.2.1.255 dev eth1 proto kernel scope link src 10.2.1.2 broadcast 10.2.2.0 dev eth2 proto kernel scope link src 10.2.2.2 10.2.2.0/24 dev eth2 proto kernel scope link src 10.2.2.2 local 10.2.2.2 dev eth2 proto kernel scope host src 10.2.2.2 broadcast 10.2.2.255 dev eth2 proto kernel scope link src 10.2.2.2 $ ip -6 route show vrf red local 2002:1:: dev lo proto none metric 0 pref medium local 2002:1::2 dev lo proto none metric 0 pref medium 2002:1::/120 dev eth1 proto kernel metric 256 pref medium local 2002:2:: dev lo proto none metric 0 pref medium local 2002:2::2 dev lo proto none metric 0 pref medium 2002:2::/120 dev eth2 proto kernel metric 256 pref medium local fe80:: dev lo proto none metric 0 pref medium local fe80:: dev lo proto none metric 0 pref medium local fe80::ff:fe00:202 dev lo proto none metric 0 pref medium local fe80::ff:fe00:203 dev lo proto none metric 0 pref medium fe80::/64 dev eth1 proto kernel metric 256 pref medium fe80::/64 dev eth2 proto kernel metric 256 pref medium ff00::/8 dev red metric 256 pref medium ff00::/8 dev eth1 metric 256 pref medium ff00::/8 dev eth2 metric 256 pref medium unreachable default dev lo metric 4278198272 error -101 pref medium ”h]”(hï)�”}”(hŒShow Routes for a VRF”h]”hŒShow Routes for a VRF”…”�”}”(hjGh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´M5hjCubhï)�”}”(hŒaTo show routes for a VRF use the ip command to display the table associated with the VRF device::”h]”hŒ`To show routes for a VRF use the ip command to display the table associated with the VRF device:”…”�”}”(hjUh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´M7hjCubj:)�”}”(hŒ;$ ip [-6] route show vrf NAME $ ip [-6] route show table ID”h]”hŒ;$ ip [-6] route show vrf NAME $ ip [-6] route show table ID”…”�”}”hjcsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j9h³hÇh´M:hjCubhï)�”}”(hŒ For example::”h]”hŒ For example:”…”�”}”(hjqh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´M=hjCubj:)�”}”(hXô$ ip route show vrf red unreachable default metric 4278198272 broadcast 10.2.1.0 dev eth1 proto kernel scope link src 10.2.1.2 10.2.1.0/24 dev eth1 proto kernel scope link src 10.2.1.2 local 10.2.1.2 dev eth1 proto kernel scope host src 10.2.1.2 broadcast 10.2.1.255 dev eth1 proto kernel scope link src 10.2.1.2 broadcast 10.2.2.0 dev eth2 proto kernel scope link src 10.2.2.2 10.2.2.0/24 dev eth2 proto kernel scope link src 10.2.2.2 local 10.2.2.2 dev eth2 proto kernel scope host src 10.2.2.2 broadcast 10.2.2.255 dev eth2 proto kernel scope link src 10.2.2.2 $ ip -6 route show vrf red local 2002:1:: dev lo proto none metric 0 pref medium local 2002:1::2 dev lo proto none metric 0 pref medium 2002:1::/120 dev eth1 proto kernel metric 256 pref medium local 2002:2:: dev lo proto none metric 0 pref medium local 2002:2::2 dev lo proto none metric 0 pref medium 2002:2::/120 dev eth2 proto kernel metric 256 pref medium local fe80:: dev lo proto none metric 0 pref medium local fe80:: dev lo proto none metric 0 pref medium local fe80::ff:fe00:202 dev lo proto none metric 0 pref medium local fe80::ff:fe00:203 dev lo proto none metric 0 pref medium fe80::/64 dev eth1 proto kernel metric 256 pref medium fe80::/64 dev eth2 proto kernel metric 256 pref medium ff00::/8 dev red metric 256 pref medium ff00::/8 dev eth1 metric 256 pref medium ff00::/8 dev eth2 metric 256 pref medium unreachable default dev lo metric 4278198272 error -101 pref medium”h]”hXô$ ip route show vrf red unreachable default metric 4278198272 broadcast 10.2.1.0 dev eth1 proto kernel scope link src 10.2.1.2 10.2.1.0/24 dev eth1 proto kernel scope link src 10.2.1.2 local 10.2.1.2 dev eth1 proto kernel scope host src 10.2.1.2 broadcast 10.2.1.255 dev eth1 proto kernel scope link src 10.2.1.2 broadcast 10.2.2.0 dev eth2 proto kernel scope link src 10.2.2.2 10.2.2.0/24 dev eth2 proto kernel scope link src 10.2.2.2 local 10.2.2.2 dev eth2 proto kernel scope host src 10.2.2.2 broadcast 10.2.2.255 dev eth2 proto kernel scope link src 10.2.2.2 $ ip -6 route show vrf red local 2002:1:: dev lo proto none metric 0 pref medium local 2002:1::2 dev lo proto none metric 0 pref medium 2002:1::/120 dev eth1 proto kernel metric 256 pref medium local 2002:2:: dev lo proto none metric 0 pref medium local 2002:2::2 dev lo proto none metric 0 pref medium 2002:2::/120 dev eth2 proto kernel metric 256 pref medium local fe80:: dev lo proto none metric 0 pref medium local fe80:: dev lo proto none metric 0 pref medium local fe80::ff:fe00:202 dev lo proto none metric 0 pref medium local fe80::ff:fe00:203 dev lo proto none metric 0 pref medium fe80::/64 dev eth1 proto kernel metric 256 pref medium fe80::/64 dev eth2 proto kernel metric 256 pref medium ff00::/8 dev red metric 256 pref medium ff00::/8 dev eth1 metric 256 pref medium ff00::/8 dev eth2 metric 256 pref medium unreachable default dev lo metric 4278198272 error -101 pref medium”…”�”}”hjsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j9h³hÇh´M?hjCubeh}”(h]”h ]”h"]”h$]”h&]”uh1jõhj h²hh³hÇh´Nubjö)�”}”(hX›Route Lookup for a VRF A test route lookup can be done for a VRF:: $ ip [-6] route get vrf NAME ADDRESS $ ip [-6] route get oif NAME ADDRESS For example:: $ ip route get 10.2.1.40 vrf red 10.2.1.40 dev eth1 table red src 10.2.1.2 cache $ ip -6 route get 2002:1::32 vrf red 2002:1::32 from :: dev eth1 table red proto kernel src 2002:1::2 metric 256 pref medium ”h]”(hï)�”}”(hŒRoute Lookup for a VRF”h]”hŒRoute Lookup for a VRF”…”�”}”(hj—h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´M\hj“ubhï)�”}”(hŒ+A test route lookup can be done for a VRF::”h]”hŒ*A test route lookup can be done for a VRF:”…”�”}”(hj¥h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´M^hj“ubj:)�”}”(hŒI$ ip [-6] route get vrf NAME ADDRESS $ ip [-6] route get oif NAME ADDRESS”h]”hŒI$ ip [-6] route get vrf NAME ADDRESS $ ip [-6] route get oif NAME ADDRESS”…”�”}”hj³sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j9h³hÇh´M`hj“ubhï)�”}”(hŒ For example::”h]”hŒ For example:”…”�”}”(hjÁh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Mchj“ubj:)�”}”(hŒÙ$ ip route get 10.2.1.40 vrf red 10.2.1.40 dev eth1 table red src 10.2.1.2 cache $ ip -6 route get 2002:1::32 vrf red 2002:1::32 from :: dev eth1 table red proto kernel src 2002:1::2 metric 256 pref medium”h]”hŒÙ$ ip route get 10.2.1.40 vrf red 10.2.1.40 dev eth1 table red src 10.2.1.2 cache $ ip -6 route get 2002:1::32 vrf red 2002:1::32 from :: dev eth1 table red proto kernel src 2002:1::2 metric 256 pref medium”…”�”}”hjÏsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j9h³hÇh´Mehj“ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jõhj h²hh³hÇh´Nubjö)�”}”(hX=Removing Network Interface from a VRF Network interfaces are removed from a VRF by breaking the enslavement to the VRF device:: $ ip link set dev NAME nomaster Connected routes are moved back to the default table and local entries are moved to the local table. For example:: $ ip link set dev eth0 nomaster ”h]”(hï)�”}”(hŒ%Removing Network Interface from a VRF”h]”hŒ%Removing Network Interface from a VRF”…”�”}”(hjçh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Mmhjãubhï)�”}”(hŒYNetwork interfaces are removed from a VRF by breaking the enslavement to the VRF device::”h]”hŒXNetwork interfaces are removed from a VRF by breaking the enslavement to the VRF device:”…”�”}”(hjõh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Mohjãubj:)�”}”(hŒ$ ip link set dev NAME nomaster”h]”hŒ$ ip link set dev NAME nomaster”…”�”}”hjsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j9h³hÇh´Mrhjãubhï)�”}”(hŒdConnected routes are moved back to the default table and local entries are moved to the local table.”h]”hŒdConnected routes are moved back to the default table and local entries are moved to the local table.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Mthjãubhï)�”}”(hŒ For example::”h]”hŒ For example:”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Mwhjãubj:)�”}”(hŒ$ ip link set dev eth0 nomaster”h]”hŒ$ ip link set dev eth0 nomaster”…”�”}”hj-sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j9h³hÇh´Myhjãubeh}”(h]”h ]”h"]”h$]”h&]”uh1jõhj h²hh³hÇh´Nubeh}”(h]”h ]”h"]”h$]”h&]”jjjhjjuh1jðhjíh²hh³hÇh´K¨ubjâ)�”}”(hŒP--------------------------------------------------------------------------------”h]”h}”(h]”h ]”h"]”h$]”h&]”uh1jáh³hÇh´M{hjíh²hubhï)�”}”(hŒCommands used in this example::”h]”hŒCommands used in this example:”…”�”}”(hjQh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´M}hjíh²hubj:)�”}”(hX´cat >> /etc/iproute2/rt_tables.d/vrf.conf <> /etc/iproute2/rt_tables.d/vrf.conf <