Interface

VPP command learned in this exercise

  1. create host-interface
  2. set int state
  3. set int ip address
  4. show hardware
  5. show int
  6. show int addr
  7. trace add
  8. clear trace
  9. ping
  10. show ip arp
  11. show ip fib

Topology

Figure: Create Interface Topology

Figure: Create Interface Topology

Initial State

The initial state here is presumed to be the final state from the exercise VPP Basics

Create veth interfaces on host

In Linux, there is a type of interface call ‘veth’. Think of a ‘veth’ interface as being an interface that has two ends to it (rather than one).

Create a veth interface with one end named vpp1out and the other named vpp1host

$ sudo ip link add name vpp1out type veth peer name vpp1host

Turn up both ends:

$ sudo ip link set dev vpp1out up
$ sudo ip link set dev vpp1host up

Assign an IP address

$ sudo ip addr add 10.10.1.1/24 dev vpp1host

Display the result:

$ sudo ip addr show vpp1host
5: vpp1host@vpp1out: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
  link/ether e2:0f:1e:59:ec:f7 brd ff:ff:ff:ff:ff:ff
  inet 10.10.1.1/24 scope global vpp1host
     valid_lft forever preferred_lft forever
  inet6 fe80::e00f:1eff:fe59:ecf7/64 scope link
     valid_lft forever preferred_lft forever

Create vpp host-interface

Create a host interface attached to vpp1out.

vpp# create host-interface name vpp1out
host-vpp1out

Confirm the interface:

vpp# show hardware
              Name                Idx   Link  Hardware
host-vpp1out                       1     up   host-vpp1out
Ethernet address 02:fe:d9:75:d5:b4
Linux PACKET socket interface
local0                             0    down  local0
local

Turn up the interface:

vpp# set int state host-vpp1out up

Confirm the interface is up:

vpp# show int
              Name               Idx    State  MTU (L3/IP4/IP6/MPLS)     Counter          Count
host-vpp1out                      1      up          9000/0/0/0
local0                            0     down          0/0/0/0

Assign ip address 10.10.1.2/24

vpp# set int ip address host-vpp1out 10.10.1.2/24

Confirm the ip address is assigned:

vpp# show int addr
host-vpp1out (up):
  L3 10.10.1.2/24
local0 (dn):