blob: 38841b744b3480cfc76e26f0de13144851aa814b [file] [log] [blame]
John DeNiscoc8e7f412018-08-03 11:02:24 -04001.. _routing:
2
3.. toctree::
4
5Routing
6=======
7
8Skills to be Learned
John DeNiscoc4c72d22018-08-16 13:50:02 -04009---------------------
John DeNiscoc8e7f412018-08-03 11:02:24 -040010
11In this exercise you will learn these new skills:
12
13#. Add route to Linux Host routing table
14#. Add route to FD.io VPP routing table
15
16And revisit the old ones:
17
18#. Examine FD.io VPP routing table
19#. Enable trace on vpp1 and vpp2
20#. ping from host to FD.io VPP
21#. Examine and clear trace on vpp1 and vpp2
22#. ping from FD.io VPP to host
23#. Examine and clear trace on vpp1 and vpp2
24
John DeNiscoc4c72d22018-08-16 13:50:02 -040025VPP command learned in this exercise
26-------------------------------------
John DeNiscoc8e7f412018-08-03 11:02:24 -040027
28#. `ip route
29 add <https://docs.fd.io/vpp/17.04/clicmd_src_vnet_ip.html#clicmd_ip_route>`__
30
31Topology
John DeNiscoc4c72d22018-08-16 13:50:02 -040032---------
John DeNiscoc8e7f412018-08-03 11:02:24 -040033
34.. figure:: /_images/Connecting_two_vpp_instances_with_memif.png
35 :alt: Connect two FD.io VPP topology
36
37 Connect two FD.io VPP topology
38
39Initial State
John DeNiscoc4c72d22018-08-16 13:50:02 -040040--------------
John DeNiscoc8e7f412018-08-03 11:02:24 -040041
42The initial state here is presumed to be the final state from the
43exercise `Connecting two FD.io VPP
44instances <VPP/Progressive_VPP_Tutorial#Connecting_two_vpp_instances>`__
45
46Setup host route
John DeNiscoc4c72d22018-08-16 13:50:02 -040047-----------------
John DeNiscoc8e7f412018-08-03 11:02:24 -040048
49.. code-block:: console
50
51 $ sudo ip route add 10.10.2.0/24 via 10.10.1.2
52 $ ip route
Nathan Skrzypczak9ad39c02021-08-19 11:38:06 +020053 default via 10.0.2.2 dev enp0s3
54 10.0.2.0/24 dev enp0s3 proto kernel scope link src 10.0.2.15
55 10.10.1.0/24 dev vpp1host proto kernel scope link src 10.10.1.1
56 10.10.2.0/24 via 10.10.1.2 dev vpp1host
John DeNiscoc8e7f412018-08-03 11:02:24 -040057
58Setup return route on vpp2
John DeNiscoc4c72d22018-08-16 13:50:02 -040059---------------------------
John DeNiscoc8e7f412018-08-03 11:02:24 -040060
61.. code-block:: console
62
John DeNiscoc4c72d22018-08-16 13:50:02 -040063 $ sudo vppctl -s /run/vpp/cli-vpp2.sock
John DeNiscoc8e7f412018-08-03 11:02:24 -040064 vpp# ip route add 10.10.1.0/24 via 10.10.2.1
65
66Ping from host through vpp1 to vpp2
John DeNiscoc4c72d22018-08-16 13:50:02 -040067------------------------------------
68
69The connection from vpp1 to vpp2 uses the **memif** driver, the connection to the host
70uses the **af-packet** driver. To trace packets from the host we use **af-packet-input** from
71vpp1 to vpp2 we use **memif-input**.
John DeNiscoc8e7f412018-08-03 11:02:24 -040072
73#. Setup a trace on vpp1 and vpp2
74#. Ping 10.10.2.2 from the host
75#. Examine the trace on vpp1 and vpp2
76#. Clear the trace on vpp1 and vpp2