Difference between revisions of "VPP/Progressive VPP Tutorial"
(→Add repo to apt sources.list.d) |
(→Add key for apt repo) |
||
Line 77: | Line 77: | ||
=== Add key for apt repo === | === Add key for apt repo === | ||
− | < | + | <pre style="background-color:palegreen"> |
curl -L https://packagecloud.io/fdio/tutorial/gpgkey | sudo apt-key add - | curl -L https://packagecloud.io/fdio/tutorial/gpgkey | sudo apt-key add - | ||
− | </ | + | </pre> |
=== Add repo to apt sources.list.d === | === Add repo to apt sources.list.d === |
Revision as of 02:17, 29 January 2017
Contents
Exercise: Setting up your environment
All of these exercises are designed to be performed on an Ubuntu 16.04 (Xenial) box.
If you have an Ubuntu 16.04 box on which you have sudo, you can feel free to use that.
If you do not, a Vagrantfile is provided to setup a basic Ubuntu 16.04 box for you
Vagrant Set up
Install Virtualbox
If you do not already have virtualbox on your laptop (or if it is not up to date), please download and install it:
https://www.virtualbox.org/wiki/Downloads
Install Vagrant
If you do not already have Vagrant on your laptop (or if it is not up to date), please download it:
https://www.vagrantup.com/downloads.html
Create a Vagrant Directory
Create a directory on your laptop:
mkdir fdio-tutorial
cd fdio-tutorial/
Create a Vagrantfile containing:
# -*- mode: ruby -*- # vi: set ft=ruby : Vagrant.configure(2) do |config| config.vm.box = "puppetlabs/ubuntu-16.04-64-nocm" config.vm.box_check_update = false vmcpu=(ENV['VPP_VAGRANT_VMCPU'] || 2) vmram=(ENV['VPP_VAGRANT_VMRAM'] || 4096) config.ssh.forward_agent = true config.vm.provider "virtualbox" do |vb| vb.customize ["modifyvm", :id, "--ioapic", "on"] vb.memory = "#{vmram}" vb.cpus = "#{vmcpu}" #support for the SSE4.x instruction is required in some versions of VB. vb.customize ["setextradata", :id, "VBoxInternal/CPUM/SSE4.1", "1"] vb.customize ["setextradata", :id, "VBoxInternal/CPUM/SSE4.2", "1"] end end
Vagrant Up
Bring up your Vagrant VM:
vagrant up
ssh to Vagrant VM
vagrant ssh
Exercise: Install vpp
This tutorial is using a special packaging of vpp called vpp_lite that allows you to run multiple vpp processes simultaneously. We will be building topologies of these vpp processes to allow us to perform labs which require multiple instances of 'routers' or 'switches'. Because of this, we will be getting our vpp packages from a slightly non-standard apt repository.
Add key for apt repo
curl -L https://packagecloud.io/fdio/tutorial/gpgkey | sudo apt-key add -
Add repo to apt sources.list.d
With your favorite text editor (and sudo), create a file:
/etc/apt/sources.list.d/fdio_tutorial.list
containing
deb https://packagecloud.io/fdio/tutorial/ubuntu/ xenial main deb-src https://packagecloud.io/fdio/tutorial/ubuntu/ xenial main
apt-get install vpp
Run
sudo apt-get install vpp
Exercise: Run vpp
sudo vpp api-segment { prefix vpp1 }
Exercise: Create an Interface
Create veth interfaces on host
sudo ip link add name vpp1out type veth peer name vpp1host sudo ip link set dev vpp1out up sudo ip link set dev vpp1host up sudo ip addr add 10.10.1.1/24 dev vpp1host
Create vpp host interface
sudo vppctl -p vpp1 create host-interface name vpp1out sudo vppctl -p vpp1 set int state host-vpp1out up sudo vppctl -p vpp1 set int ip address host-vpp1out 10.10.1.2/24 sudo vppctl -p vpp1 show int sudo vppctl -p vpp1 show int addr ping 10.10.1.2