blob: aede969f42f80c1675e0ff03a2167cb2374ba5ac [file] [log] [blame]
John DeNiscoc8e7f412018-08-03 11:02:24 -04001.. _switching:
2
3.. toctree::
4
5Switching
6=========
7
8Skills to be Learned
9^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
10
11#. Associate an interface with a bridge domain
12#. Create a loopback interaface
13#. Create a BVI (Bridge Virtual Interface) for a bridge domain
14#. Examine a bridge domain
15
16FD.io VPP command learned in this exercise
17^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
18
19#. `show
20 bridge <https://docs.fd.io/vpp/17.04/clicmd_src_vnet_l2.html#clicmd_show_bridge-domain>`__
21#. `show bridge
22 detail <https://docs.fd.io/vpp/17.04/clicmd_src_vnet_l2.html#clicmd_show_bridge-domain>`__
23#. `set int l2
24 bridge <https://docs.fd.io/vpp/17.04/clicmd_src_vnet_l2.html#clicmd_set_interface_l2_bridge>`__
25#. `show l2fib
26 verbose <https://docs.fd.io/vpp/17.04/clicmd_src_vnet_l2.html#clicmd_show_l2fib>`__
27
28Topology
29^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
30
31.. figure:: /_images/Switching_Topology.jpg
32 :alt: Switching Topology
33
34 Switching Topology
35
36Initial state
37^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
38
39Unlike previous exercises, for this one you want to start tabula rasa.
40
41Note: You will lose all your existing config in your FD.io VPP instances!
42
43To clear existing config from previous exercises run:
44
45.. code-block:: console
46
47 $ ps -ef | grep vpp | awk '{print $2}'| xargs sudo kill
48 $ sudo ip link del dev vpp1host
49 $ sudo ip link del dev vpp1vpp2
50
51Run FD.io VPP instances
52^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
53
54#. Run a vpp instance named **vpp1**
55#. Run a vpp instance named **vpp2**
56
57Connect vpp1 to host
58^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
59
60#. Create a veth with one end named vpp1host and the other named
61 vpp1out.
62#. Connect vpp1out to vpp1
63#. Add ip address 10.10.1.1/24 on vpp1host
64
65Connect vpp1 to vpp2
66^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
67
68#. Create a veth with one end named vpp1vpp2 and the other named
69 vpp2vpp1.
70#. Connect vpp1vpp2 to vpp1.
71#. Connect vpp2vpp1 to vpp2.
72
73Configure Bridge Domain on vpp1
74^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
75
76Check to see what bridge domains already exist, and select the first
77bridge domain number not in use:
78
79.. code-block:: console
80
81 vpp# show bridge-domain
82 ID Index Learning U-Forwrd UU-Flood Flooding ARP-Term BVI-Intf
83 0 0 off off off off off local0
84
85In the example above, there is bridge domain ID '0' already. Even though
86sometimes we might get feedback as below:
87
88.. code-block:: console
89
90 no bridge-domains in use
91
92the bridge domain ID '0' still exists, where no operations are
93supported. For instance, if we try to add host-vpp1out and host-vpp1vpp2
94to bridge domain ID 0, we will get nothing setup.
95
96.. code-block:: console
97
98 vpp# set int l2 bridge host-vpp1out 0
99 vpp# set int l2 bridge host-vpp1vpp2 0
100 vpp# show bridge-domain 0 detail
101 show bridge-domain: No operations on the default bridge domain are supported
102
103So we will create bridge domain 1 instead of playing with the default
104bridge domain ID 0.
105
106Add host-vpp1out to bridge domain ID 1
107
108.. code-block:: console
109
110 vpp# set int l2 bridge host-vpp1out 1
111
112Add host-vpp1vpp2 to bridge domain ID1
113
114.. code-block:: console
115
116 vpp# set int l2 bridge host-vpp1vpp2 1
117
118Examine bridge domain 1:
119
120.. code-block:: console
121
122 vpp# show bridge-domain 1 detail
123 BD-ID Index BSN Age(min) Learning U-Forwrd UU-Flood Flooding ARP-Term BVI-Intf
124 1 1 0 off on on on on off N/A
125
126 Interface If-idx ISN SHG BVI TxFlood VLAN-Tag-Rewrite
127 host-vpp1out 1 1 0 - * none
128 host-vpp1vpp2 2 1 0 - * none
129
130Configure loopback interface on vpp2
131^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
132
133.. code-block:: console
134
135 vpp# create loopback interface
136 loop0
137
138Add the ip address 10.10.1.2/24 to vpp2 interface loop0. Set the state
139of interface loop0 on vpp2 to 'up'
140
141Configure bridge domain on vpp2
142^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
143
144Check to see the first available bridge domain ID (it will be 1 in this
145case)
146
147Add interface loop0 as a bridge virtual interface (bvi) to bridge domain
1481
149
150.. code-block:: console
151
152 vpp# set int l2 bridge loop0 1 bvi
153
154Add interface vpp2vpp1 to bridge domain 1
155
156.. code-block:: console
157
158 vpp# set int l2 bridge host-vpp2vpp1 1
159
160Examine the bridge domain and interfaces.
161
162Ping from host to vpp and vpp to host
163^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
164
165#. Add trace on vpp1 and vpp2
166#. ping from host to 10.10.1.2
167#. Examine and clear trace on vpp1 and vpp2
168#. ping from vpp2 to 10.10.1.1
169#. Examine and clear trace on vpp1 and vpp2
170
171Examine l2 fib
172^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
173
174.. code-block:: console
175
176 vpp# show l2fib verbose
177 Mac Address BD Idx Interface Index static filter bvi Mac Age (min)
178 de:ad:00:00:00:00 1 host-vpp1vpp2 2 0 0 0 disabled
179 c2:f6:88:31:7b:8e 1 host-vpp1out 1 0 0 0 disabled
180 2 l2fib entries
181
182.. code-block:: console
183
184 vpp# show l2fib verbose
185 Mac Address BD Idx Interface Index static filter bvi Mac Age (min)
186 de:ad:00:00:00:00 1 loop0 2 1 0 1 disabled
187 c2:f6:88:31:7b:8e 1 host-vpp2vpp1 1 0 0 0 disabled
188 2 l2fib entries