docs: add useful debug CLI Review Updates
[vpp.git] / docs / reference / cmdreference / ip / ip.rst
1 .. _ip1:\r
2 \r
3 .. toctree::\r
4 \r
5 .. note:: For a complete list of CLI Debug commands refer to the Debug CLI section of the `Source Code Documents <https://docs.fd.io/vpp/18.07/clicmd.html>`_ .\r
6 \r
7 IP Route\r
8 ==========\r
9 \r
10 Summary/Usage\r
11 --------------\r
12 \r
13 `ip route [add|del] [count <*n*>] <*dst-ip-addr*>/<*width*> [table <*table-id*>] via [next-hop-address[next-hop-interface] [next-hop-table <*value*>] [weight <*value*>] [preference <*value*>] [udp-encap-id <*value*>] [ip4-lookup-in-table <*value*>] [ip6-lookup-in-table <*value*>] [mpls-lookup-in-table <*value*>] [resolve-via-host] [resolve-via-connected] [rx-ip4 <*interface*>] [out-labels <*value value value*>]`\r
14 \r
15 Description\r
16 ------------\r
17 \r
18 This command is used to add or delete IPv4 or IPv6 routes. All IP Addresses\r
19 ('<*dst-ip-addr*>/<*width*>', '<*next-hop-ip-addr*>' and '<*adj-hop-ip-addr*>') can be IPv4 or IPv6,\r
20 but all must be of the same form in a single command. To display the current set of routes,\r
21 use the commands 'show ip fib' and 'show ip6 fib'.\r
22 \r
23 Example Usage\r
24 --------------\r
25 \r
26 Example of how to add a straight forward static route:\r
27 \r
28 .. code-block:: console\r
29 \r
30     vpp# ip route add 6.0.1.2/32 via 6.0.0.1 GigabitEthernet2/0/0\r
31 \r
32 Example of how to delete a straight forward static route:\r
33 \r
34 .. code-block:: console\r
35 \r
36     vpp# ip route del 6.0.1.2/32 via 6.0.0.1 GigabitEthernet2/0/0\r
37 \r
38 Mainly for route add/del performance testing, one can add or delete multiple routes by adding\r
39 'count N' to the previous item:\r
40 \r
41 .. code-block:: console\r
42 \r
43     vpp# ip route add count 10 7.0.0.0/24 via 6.0.0.1 GigabitEthernet2/0/0\r
44 \r
45 Add multiple routes for the same destination to create equal-cost multipath:\r
46 \r
47 .. code-block:: console\r
48 \r
49     vpp# ip route add 7.0.0.1/32 via 6.0.0.1 GigabitEthernet2/0/0\r
50 \r
51     vpp# ip route add 7.0.0.1/32 via 6.0.0.2 GigabitEthernet2/0/0\r
52 \r
53 For unequal-cost multipath, specify the desired weights. This combination of weights\r
54 results in 3/4 of the traffic following the second path, 1/4 following the first path:\r
55 \r
56 .. code-block:: console\r
57 \r
58     vpp# ip route add 7.0.0.1/32 via 6.0.0.1 GigabitEthernet2/0/0 weight 1\r
59 \r
60     vpp# ip route add 7.0.0.1/32 via 6.0.0.2 GigabitEthernet2/0/0 weight 3\r
61 \r
62 To add a route to a particular FIB table (VRF), use:\r
63 \r
64 .. code-block:: console\r
65 \r
66     vpp# ip route add 172.16.24.0/24 table 7 via GigabitEthernet2/0/0\r
67 \r
68 Declaration and Implementation\r
69 ---------------------------------\r
70 \r
71 **Declaration:** ip_route_command (src/vnet/ip/lookup.c line 641)\r
72 \r
73 **Implementation:** vnet_ip_route_cmd\r
74 \r
75 Ping\r
76 =====\r
77 \r
78 Summary/Usage\r
79 --------------\r
80 \r
81 ping {<*ip-addr*> | ipv4 <*ip4-addr*> | ipv6 <*ip6-addr*>} [ipv4 <*ip4-addr*> | ipv6 <*ip6-addr*>] [source <*interface*>] [size <*pktsize*>] [interval <*sec*>] [repeat <*cnt*>] [table-id <*id*>] [verbose]\r
82 \r
83 Description\r
84 ------------\r
85 \r
86 This command sends an ICMP ECHO_REQUEST to network hosts. The address can be an IPv4 or IPv6\r
87 address (or both at the same time).\r
88 \r
89 Example Usage\r
90 --------------\r
91 \r
92 Example of how ping an IPv4 address:\r
93 \r
94 .. code-block:: console\r
95 \r
96     vpp# ping 172.16.1.2 source GigabitEthernet2/0/0 repeat 2\r
97 \r
98     64 bytes from 172.16.1.2: icmp_seq=1 ttl=64 time=.1090 ms\r
99     64 bytes from 172.16.1.2: icmp_seq=2 ttl=64 time=.0914 ms\r
100 \r
101     Statistics: 2 sent, 2 received, 0% packet loss\r
102 \r
103     Example of how ping both an IPv4 address and IPv6 address at the same time:\r
104 \r
105     vpp# ping 172.16.1.2 ipv6 fe80::24a5:f6ff:fe9c:3a36 source GigabitEthernet2/0/0 repeat 2 verbose\r
106 \r
107     Adjacency index: 10, sw_if_index: 1\r
108     Adj: ip6-discover-neighbor\r
109     Adj Interface: 0\r
110     Forced set interface: 1\r
111     Adjacency index: 0, sw_if_index: 4294967295\r
112     Adj: ip4-miss\r
113     Adj Interface: 0\r
114     Forced set interface: 1\r
115     Source address: 172.16.1.1\r
116     64 bytes from 172.16.1.2: icmp_seq=1 ttl=64 time=.1899 ms\r
117     Adjacency index: 10, sw_if_index: 1\r
118     Adj: ip6-discover-neighbor\r
119     Adj Interface: 0\r
120     Forced set interface: 1\r
121     Adjacency index: 0, sw_if_index: 4294967295\r
122     Adj: ip4-miss\r
123     Adj Interface: 0\r
124     Forced set interface: 1\r
125     Source address: 172.16.1.1\r
126     64 bytes from 172.16.1.2: icmp_seq=2 ttl=64 time=.0910 ms\r
127 \r
128     Statistics: 4 sent, 2 received, 50% packet loss\r
129 \r
130 Declaration and Implementation\r
131 -------------------------------\r
132 \r
133 Declaration: ping_command (src/vnet/ip/ping.c line 899)\r
134 \r
135 Implementation: ping_ip_address\r
136 \r
137 Set Interface IP Address\r
138 =========================\r
139 \r
140 `Set Interface IP Address <../interface/setinterface.html#set-interface-ip-address>`_\r
141 \r
142 Show IP Arp\r
143 =============\r
144 \r
145 `Show IP-Arp <../show/show.html#show-ip-arp>`_\r
146 \r
147 \r
148 Show IP Fib\r
149 ============\r
150 \r
151 `Show IP-Fib <../show/show.html#show-ip-fib>`_\r