Routing revision 51e00de1
1#!/usr/bin/env bash
2
3# Copyright (c) 2016 Cisco and/or its affiliates.
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at:
7#
8#     http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16C1_IP="172.16.1.2/24"
17C1_GW="172.16.1.1"
18C2_IP="172.16.2.2/24"
19C2_GW="172.16.2.1"
20
21INSTR=()
22CMD=()
23INSTR+=("Welcome to the routing demo. This will show you some simple commands to connect two linux containers to VPP and ping between them.")
24CMD+=("")
25
26INSTR+=("To show interfaces type:")
27CMD+=("sudo vppctl show inter")
28
29INSTR+=("Lets examine our workloads cone and ctwo")
30CMD+=("sudo lxc-attach -n cone -- ip -o a")
31
32INSTR+=("")
33CMD+=("sudo lxc-attach -n ctwo -- ip -o a")
34
35INSTR+=("To add interfaces, we add the host-side of the veth link pair.")
36CMD+=("ip link")
37
38INSTR+=("The links we need to add are link1 and link2 so lets add them with")
39CMD+=("sudo vppctl create host-interface name link1; sudo vppctl create host-interface name link2; sudo vppctl show inter")
40
41INSTR+=("Change the links state to up")
42CMD+=("sudo vppctl set interface state host-link1 up; sudo vppctl set interface state host-link2 up; sudo vppctl show inter")
43
44INSTR+=("Add IP addresses for the other end of each veth link")
45CMD+=("sudo vppctl set interface ip address host-link1 172.16.1.1/24;  sudo vppctl set interface ip address host-link2 172.16.2.1/24;  sudo vppctl show interface address")
46
47INSTR+=("You can also see the L3 table, or FIB by doing")
48CMD+=("sudo vppctl show ip fib")
49
50INSTR+=("At long last you probably want to see some pings")
51CMD+=("sudo lxc-attach -n cone -- ping -c3 172.16.2.2")
52
53INSTR+=("")
54CMD+=("sudo lxc-attach -n ctwo -- ping -c3 172.16.1.2")
55
56INSTR+=("Thanks for doing the routing demo. To restart this demo and type these commands yourself. vagrant ssh sudo /vagrant/netns.sh; cat /vagrant/routing.cmd")
57CMD+=("")
58