Blame man/man8/ip-vrf.8

Packit Service 3880ab
.TH IP\-VRF 8 "7 Dec 2016" "iproute2" "Linux"
Packit Service 3880ab
.SH NAME
Packit Service 3880ab
ip-vrf \- run a command against a vrf
Packit Service 3880ab
.SH SYNOPSIS
Packit Service 3880ab
.sp
Packit Service 3880ab
.ad l
Packit Service 3880ab
.in +8
Packit Service 3880ab
.ti -8
Packit Service 3880ab
.B ip
Packit Service 3880ab
.B vrf
Packit Service 3880ab
.RI  " { " COMMAND " | "
Packit Service 3880ab
.BR help " }"
Packit Service 3880ab
.sp
Packit Service 3880ab
Packit Service 3880ab
.ti -8
Packit Service 3880ab
.BR "ip vrf show"
Packit Service 3880ab
.RI "[ " NAME " ]"
Packit Service 3880ab
Packit Service 3880ab
.ti -8
Packit Service 3880ab
.BR "ip vrf identify"
Packit Service 3880ab
.RI "[ " PID " ]"
Packit Service 3880ab
Packit Service 3880ab
.ti -8
Packit Service 3880ab
.BR "ip vrf pids"
Packit Service 3880ab
.I NAME
Packit Service 3880ab
Packit Service 3880ab
.ti -8
Packit Service 3880ab
.BR "ip vrf exec "
Packit Service 3880ab
.RI "[ " NAME " ] " command ...
Packit Service 3880ab
Packit Service 3880ab
.SH DESCRIPTION
Packit Service 3880ab
A VRF provides traffic isolation at layer 3 for routing, similar to how a
Packit Service 3880ab
VLAN is used to isolate traffic at layer 2. Fundamentally, a VRF is a separate
Packit Service 3880ab
routing table. Network devices are associated with a VRF by enslaving the
Packit Service 3880ab
device to the VRF. At that point network addresses assigned to the device are
Packit Service 3880ab
local to the VRF with host and connected routes moved to the table associated
Packit Service 3880ab
with the VRF.
Packit Service 3880ab
Packit Service 3880ab
A process can specify a VRF using several APIs -- binding the socket to the
Packit Service 3880ab
VRF device using SO_BINDTODEVICE, setting the VRF association using
Packit Service 3880ab
IP_UNICAST_IF or IPV6_UNICAST_IF, or specifying the VRF for a specific message
Packit Service 3880ab
using IP_PKTINFO or IPV6_PKTINFO.
Packit Service 3880ab
Packit Service 3880ab
By default a process is not bound to any VRF. An association can be set
Packit Service 3880ab
explicitly by making the program use one of the APIs mentioned above or
Packit Service 3880ab
implicitly using a helper to set SO_BINDTODEVICE for all IPv4 and IPv6
Packit Service 3880ab
sockets (AF_INET and AF_INET6) when the socket is created. This ip-vrf command
Packit Service 3880ab
is a helper to run a command against a specific VRF with the VRF association
Packit Service 3880ab
inherited parent to child.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.B ip vrf show [ NAME ] - Show all configured VRF
Packit Service 3880ab
.sp
Packit Service 3880ab
This command lists all VRF and their corresponding table ids. If NAME is
Packit Service 3880ab
given, then only that VRF and table id is shown. The latter command is
Packit Service 3880ab
useful for scripting where the table id for a VRF is needed.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.B ip vrf exec [ NAME ] cmd ... - Run cmd against the named VRF
Packit Service 3880ab
.sp
Packit Service 3880ab
This command allows applications that are VRF unaware to be run against
Packit Service 3880ab
a VRF other than the default VRF (main table). A command can be run against
Packit Service 3880ab
the default VRF by passing the "default" as the VRF name. This is useful if
Packit Service 3880ab
the current shell is associated with another VRF (e.g, Management VRF).
Packit Service 3880ab
Packit Service 3880ab
This command requires the system to be booted with cgroup v2 (e.g. with systemd,
Packit Service 3880ab
add systemd.unified_cgroup_hierarchy=1 to the kernel command line).
Packit Service 3880ab
Packit Service 3880ab
This command also requires to be ran as root or with the CAP_SYS_ADMIN,
Packit Service 3880ab
CAP_NET_ADMIN and CAP_DAC_OVERRIDE capabilities. If built with libcap and if
Packit Service 3880ab
capabilities are added to the ip binary program via setcap, the program will
Packit Service 3880ab
drop them as the first thing when invoked, unless the command is vrf exec.
Packit Service 3880ab
.br
Packit Service 3880ab
NOTE: capabilities will NOT be dropped if CAP_NET_ADMIN is set to INHERITABLE
Packit Service 3880ab
to avoid breaking programs with ambient capabilities that call ip.
Packit Service 3880ab
Do not set the INHERITABLE flag on the ip binary itself.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.B ip vrf identify [PID] - Report VRF association for process
Packit Service 3880ab
.sp
Packit Service 3880ab
This command shows the VRF association of the specified process. If PID is
Packit Service 3880ab
not specified then the id of the current process is used.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.B ip vrf pids NAME - Report processes associated with the named VRF
Packit Service 3880ab
.sp
Packit Service 3880ab
This command shows all process ids that are associated with the given
Packit Service 3880ab
VRF.
Packit Service 3880ab
Packit Service 3880ab
.SH CAVEATS
Packit Service 3880ab
This command requires a kernel compiled with CGROUPS and CGROUP_BPF enabled.
Packit Service 3880ab
Packit Service 3880ab
The VRF helper *only* affects network layer sockets.
Packit Service 3880ab
Packit Service 3880ab
.SH EXAMPLES
Packit Service 3880ab
.PP
Packit Service 3880ab
ip vrf exec red ssh 10.100.1.254
Packit Service 3880ab
.RS
Packit Service 3880ab
Executes ssh to 10.100.1.254 against the VRF red table.
Packit Service 3880ab
.RE
Packit Service 3880ab
Packit Service 3880ab
.SH SEE ALSO
Packit Service 3880ab
.br
Packit Service 3880ab
.BR ip (8),
Packit Service 3880ab
.BR ip-link (8),
Packit Service 3880ab
.BR ip-address (8),
Packit Service 3880ab
.BR ip-route (8),
Packit Service 3880ab
.BR ip-neighbor (8)
Packit Service 3880ab
Packit Service 3880ab
.SH AUTHOR
Packit Service 3880ab
Original Manpage by David Ahern