Enter container *cone*, and check the current network configuration:
-.. code-block:: shell
+.. code-block:: console
root@cone:/# ip -o a
1: lo inet 127.0.0.1/8 scope host lo\ valid_lft forever preferred_lft forever
Check if the interfaces are down or up:
-.. code-block:: shell
+.. code-block:: console
root@cone:/# ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1
Make sure your loopback interface is up, and assign an IP and gateway to veth_link1.
-.. code-block:: shell
+.. code-block:: console
root@cone:/# ip link set dev lo up
root@cone:/# ip addr add 172.16.1.2/24 dev veth_link1
Run some commands to verify the changes:
-.. code-block:: shell
+.. code-block:: console
root@cone:/# ip -o a
1: lo inet 127.0.0.1/8 scope host lo\ valid_lft forever preferred_lft forever
Now exit this container and repeat this process with container *ctwo*, except with IP 172.16.2.2/24 and gateway 172.16.2.1.
-After thats done for *both* containers, exit from the container if you're in one:
+After that's done for *both* containers, exit from the container if you're in one:
-.. code-block:: shell
+.. code-block:: console
root@ctwo:/# exit
exit
In the machine running the containers, run **ip link** to see the host *veth* network interfaces, and their link with their respective *container veth's*.
-.. code-block:: shell
+.. code-block:: console
root@localhost:~# ip link
1: lo: <LOOPBACK> mtu 65536 qdisc noqueue state DOWN mode DEFAULT group default qlen 1
With VPP in the host machine, show current VPP interfaces:
-.. code-block:: shell
+.. code-block:: console
root@localhost:~# vppctl show inter
Name Idx State MTU (L3/IP4/IP6/MPLS) Counter Count
Based on the names of the network interfaces discussed previously, which are specific to my systems, we can create VPP host-interfaces:
-.. code-block:: shell
+.. code-block:: console
root@localhost:~# vppctl create host-interface name vethQL7K0C
root@localhost:~# vppctl create host-interface name veth8NA72P
Verify they have been set up properly:
-.. code-block:: shell
+.. code-block:: console
root@localhost:~# vppctl show inter
Name Idx State MTU (L3/IP4/IP6/MPLS) Counter Count
Set their state to up:
-.. code-block:: shell
+.. code-block:: console
root@localhost:~# vppctl set interface state host-vethQL7K0C up
root@localhost:~# vppctl set interface state host-veth8NA72P up
Verify they are now up:
-.. code-block:: shell
+.. code-block:: console
root@localhost:~# vppctl show inter
Name Idx State MTU (L3/IP4/IP6/MPLS) Counter Count
Add IP addresses for the other end of each veth link:
-.. code-block:: shell
+.. code-block:: console
root@localhost:~# vppctl set interface ip address host-vethQL7K0C 172.16.1.1/24
root@localhost:~# vppctl set interface ip address host-veth8NA72P 172.16.2.1/24
Verify the addresses are set properly by looking at the L3 table:
-.. code-block:: shell
+.. code-block:: console
root@localhost:~# vppctl show inter addr
host-vethQL7K0C (up):
Or looking at the FIB by doing:
-.. code-block:: shell
+.. code-block:: console
root@localhost:~# vppctl show ip fib
ipv4-VRF:0, fib_index:0, flow hash:[src dst sport dport proto ] locks:[src:plugin-hi:2, src:default-route:1, ]
At long last you probably want to see some pings:
-.. code-block:: shell
+.. code-block:: console
root@localhost:~# lxc-attach -n cone -- ping -c3 172.16.2.2
PING 172.16.2.2 (172.16.2.2) 56(84) bytes of data.
rtt min/avg/max/mdev = 0.089/0.098/0.111/0.014 ms
-Which should send/recieve three packets for each command.
+Which should send/receive three packets for each command.
-This is the end of this guide. Great work!
\ No newline at end of file
+This is the end of this guide. Great work!