{
    "content": [
        {
            "type": "text",
            "text": "# ip-vrf(8) (man)\n\n**Summary:** ip-vrf - run a command against a vrf\n\n**Synopsis:** ip vrf  { COMMAND | help }\nip vrf show [ NAME ]\nip vrf identify [ PID ]\nip vrf pids NAME\nip vrf exec [ NAME ] command...\n\n## Examples\n\n- `ip vrf exec red ssh 10.100.1.254`\n- `Executes ssh to 10.100.1.254 against the VRF red table.`\n\n## See Also\n\n- ip(8)\n- ip-link(8)\n- ip-address(8)\n- ip-route(8)\n- ip-neighbor(8)\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **SYNOPSIS** (12 lines)\n- **DESCRIPTION** (17 lines) — 4 subsections\n  - ip vrf show [ NAME ] - Show all configured VRF (5 lines)\n  - ip vrf exec [ NAME ] cmd ... - Run cmd against the named VRF (17 lines)\n  - ip vrf identify [PID] - Report VRF association for process (4 lines)\n  - ip vrf pids NAME - Report processes associated with the name (3 lines)\n- **CAVEATS** (5 lines)\n- **EXAMPLES** (4 lines)\n- **SEE ALSO** (3 lines)\n- **AUTHOR** (5 lines)\n\n## Full Content\n\n### NAME\n\nip-vrf - run a command against a vrf\n\n### SYNOPSIS\n\nip vrf  { COMMAND | help }\n\n\nip vrf show [ NAME ]\n\nip vrf identify [ PID ]\n\nip vrf pids NAME\n\nip vrf exec [ NAME ] command...\n\n### DESCRIPTION\n\nA VRF provides traffic isolation at layer 3 for routing, similar to how a VLAN is used to\nisolate traffic at layer 2. Fundamentally, a VRF is a separate routing table. Network devices\nare associated with a VRF by enslaving the device to the VRF. At that point network addresses\nassigned to the device are local to the VRF with host and connected routes moved to the table\nassociated with the VRF.\n\nA process can specify a VRF using several APIs -- binding the socket to the VRF device using\nSOBINDTODEVICE, setting the VRF association using IPUNICASTIF or IPV6UNICASTIF, or spec‐\nifying the VRF for a specific message using IPPKTINFO or IPV6PKTINFO.\n\nBy default a process is not bound to any VRF. An association can be set explicitly by making\nthe program use one of the APIs mentioned above or implicitly using a helper to set SOBIND‐\nTODEVICE for all IPv4 and IPv6 sockets (AFINET and AFINET6) when the socket is created.\nThis ip-vrf command is a helper to run a command against a specific VRF with the VRF associa‐\ntion inherited parent to child.\n\n#### ip vrf show [ NAME ] - Show all configured VRF\n\nThis command lists all VRF and their corresponding table ids. If NAME is given, then\nonly that VRF and table id is shown. The latter command is useful for scripting where\nthe table id for a VRF is needed.\n\n#### ip vrf exec [ NAME ] cmd ... - Run cmd against the named VRF\n\nThis command allows applications that are VRF unaware to be run against a VRF other\nthan the default VRF (main table). A command can be run against the default VRF by\npassing the \"default\" as the VRF name. This is useful if the current shell is associ‐\nated with another VRF (e.g, Management VRF).\n\nThis command requires the system to be booted with cgroup v2 (e.g. with systemd, add\nsystemd.unifiedcgrouphierarchy=1 to the kernel command line).\n\nThis command also requires to be ran as root or with the CAPSYSADMIN, CAPNETADMIN\nand CAPDACOVERRIDE capabilities. If built with libcap and if capabilities are added\nto the ip binary program via setcap, the program will drop them as the first thing\nwhen invoked, unless the command is vrf exec.\nNOTE: capabilities will NOT be dropped if CAPNETADMIN is set to INHERITABLE to avoid\nbreaking programs with ambient capabilities that call ip.  Do not set the INHERITABLE\nflag on the ip binary itself.\n\n#### ip vrf identify [PID] - Report VRF association for process\n\nThis command shows the VRF association of the specified process. If PID is not speci‐\nfied then the id of the current process is used.\n\n#### ip vrf pids NAME - Report processes associated with the named VRF\n\nThis command shows all process ids that are associated with the given VRF.\n\n### CAVEATS\n\nThis command requires a kernel compiled with CGROUPS and CGROUPBPF enabled.\n\nThe VRF helper *only* affects network layer sockets.\n\n### EXAMPLES\n\nip vrf exec red ssh 10.100.1.254\nExecutes ssh to 10.100.1.254 against the VRF red table.\n\n### SEE ALSO\n\nip(8), ip-link(8), ip-address(8), ip-route(8), ip-neighbor(8)\n\n### AUTHOR\n\nOriginal Manpage by David Ahern\n\n\n\niproute2                                     7 Dec 2016                                    IP-VRF(8)\n\n"
        }
    ],
    "structuredContent": {
        "command": "ip-vrf",
        "section": "8",
        "mode": "man",
        "summary": "ip-vrf - run a command against a vrf",
        "synopsis": "ip vrf  { COMMAND | help }\nip vrf show [ NAME ]\nip vrf identify [ PID ]\nip vrf pids NAME\nip vrf exec [ NAME ] command...",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [
            "ip vrf exec red ssh 10.100.1.254",
            "Executes ssh to 10.100.1.254 against the VRF red table."
        ],
        "see_also": [
            {
                "name": "ip",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/ip/8/json"
            },
            {
                "name": "ip-link",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/ip-link/8/json"
            },
            {
                "name": "ip-address",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/ip-address/8/json"
            },
            {
                "name": "ip-route",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/ip-route/8/json"
            },
            {
                "name": "ip-neighbor",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/ip-neighbor/8/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 12,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 17,
                "subsections": [
                    {
                        "name": "ip vrf show [ NAME ] - Show all configured VRF",
                        "lines": 5
                    },
                    {
                        "name": "ip vrf exec [ NAME ] cmd ... - Run cmd against the named VRF",
                        "lines": 17
                    },
                    {
                        "name": "ip vrf identify [PID] - Report VRF association for process",
                        "lines": 4
                    },
                    {
                        "name": "ip vrf pids NAME - Report processes associated with the named VRF",
                        "lines": 3
                    }
                ]
            },
            {
                "name": "CAVEATS",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "EXAMPLES",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 5,
                "subsections": []
            }
        ]
    }
}