ON THIS PAGE
vRouter Command Line Utilities
Overview
vRouter is the component that takes packets from VMs and forwards them to their destinations. In this effort, vRouter depends on the vRouter agent to make sense of the overall topology, understand the various policies that govern the communication between VMs, and program them in vRouter in a way vRouter understands.
vRouter has a few fundamental data structures that abstracts out the various communication paths. There is "interface," "flow," "route," and "nexthop" that enables vRouter to push packets to their eventual destinations. In addition, vRouter also has good statistics that can help understand and debug packet paths. Various command line utilities provided by the vRouter can be used to display these data structures and better understand the behavior that one sees in a compute node.
This section describes the shell prompt utilities available for examining the state of the vRouter kernel module in Contrail.
vif Command
The vRouter requires vRouter interfaces (vif
) to forward traffic. Use the vif
command
to see the interfaces that are known by the vRouter.
Having interfaces only in the OS (Linux) is not sufficient
for forwarding. The relevant interfaces must be added to vRouter.
Typically, the set up of interfaces is handled by components like nova-compute
or vRouter agent.
The vif
command can be used to see
the interfaces that the vRouter is aware of by including the --list
option.
Example: vif --list
bash$ vif --list Vrouter Interface Table Flags: P=Policy, X=Cross Connect, S=Service Chain, Mr=Receive Mirror Mt=Transmit Mirror, Tc=Transmit Checksum Offload, L3=Layer 3, L2=Layer 2 D=DHCP, Vp=Vhost Physical, Pr=Promiscuous, Vnt=Native Vlan Tagged Mnp=No MAC Proxy vif0/0 OS: eth0 (Speed 1000, Duplex 1) Type:Physical HWaddr:00:25:90:c3:08:68 IPaddr:0 Vrf:0 Flags:L3L2Vp MTU:1514 Ref:22 RX packets:2664341 bytes:702708970 errors:0 TX packets:1141456 bytes:234609942 errors:0 vif0/1 OS: vhost0 Type:Host HWaddr:00:25:90:c3:08:68 IPaddr:0 Vrf:0 Flags:L3L2 MTU:1514 Ref:3 RX packets:716612 bytes:155442906 errors:0 TX packets:2248399 bytes:552491888 errors:0 vif0/2 OS: pkt0 Type:Agent HWaddr:00:00:5e:00:01:00 IPaddr:0 Vrf:65535 Flags:L3 MTU:1514 Ref:2 RX packets:450524 bytes:94618532 errors:0 TX packets:437968 bytes:66753290 errors:0 vif0/3 OS: tap519615d8-a2 Type:Virtual HWaddr:00:00:5e:00:01:00 IPaddr:0 Vrf:1 Flags:PL3L2 MTU:9160 Ref:6 RX packets:134 bytes:15697 errors:0 TX packets:8568 bytes:945944 errors:0
vif Output Field |
Description |
---|---|
|
The vRouter assigned name, where 0 is the router ID and X is the index allocated to the interface within the vRouter. |
|
The |
|
The type of interface and its IP address, as defined by vRouter. The values can be different from what is seen in the OS. Types defined by vRouter include:
|
|
The identifier of the Flag options identify that the following are enabled for the interface:
|
|
Packets received by vRouter from this interface. |
|
Packets transmitted out by vRouter on this interface. |
vif Options
Use vif –-help
to display
all options available for the vif command. Following is a brief description
of each option.
It is not recommended to use the following options unless you are very experienced with the system utilities.
# vif --help Usage: vif [--create <intf_name> --mac < --mac <C>] [--add <C>> --mac <mac> --vrf <vrf> --type [vhost|agent|physical|virtual|monitoring] --transport [eth|pmd|virtual|socket] --xconnect <physical interface name> --policy, --vhost-phys, --dhcp-enable] --vif <vif ID> --id <intf_id> --pmd --pci] [--delete <intf_id>|<intf_name>] [--get <intf_id>][--kernel] [--set <intf_id> --vlan <vlan_id> --vrf <vrf_id>] [--list][--core <core number>][--rate] [--sock-dir <sock dir>] [--clear][--id <intf_id>][--core <core_number>] [--help}
Option |
Description |
---|---|
|
Creates a “host” interface with name |
|
Adds the existing interfaces in the host OS to vRouter, with type and flag options. |
|
Deletes the interface from vRouter. The |
|
Displays a specific interface. The |
|
Set working parameters of an interface. The ones supported
are the |
|
Display all of the interfaces of which the vRouter is aware. |
|
Display all options available for the current command. |
|
Clears statistics for all interfaces on all cores. For more information, see clear Command. |
clear Command
Contrail Networking Release
2008 supports clearing of vif statistics counters for all interfaces
by using the -clear
command. For more information on -clear
command
options, see Table 2.
Option |
Description |
---|---|
|
Clears statistics for all interfaces on all cores. |
|
Clears statistics for a specific interface. |
|
Clears statistics on a specific core for all interfaces. |
|
Clears statistics for a specific interface on a specific core. |
-clear
command.