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