From f9154df2f80bfb343b58016ad81cff5ae0b44cd3 Mon Sep 17 00:00:00 2001 From: Guo Ruijing Date: Tue, 1 Aug 2017 11:11:01 -0700 Subject: Add ping vnf using vhost-user & virtio-user Change-Id: If1138e90dd5ebf3c4748dc9cc998c93bb037c4c7 Signed-off-by: Guo Ruijing --- src/vnf/virtio-user-ping/setup_virtio_user.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 src/vnf/virtio-user-ping/setup_virtio_user.sh (limited to 'src/vnf/virtio-user-ping/setup_virtio_user.sh') diff --git a/src/vnf/virtio-user-ping/setup_virtio_user.sh b/src/vnf/virtio-user-ping/setup_virtio_user.sh new file mode 100755 index 0000000..03e987f --- /dev/null +++ b/src/vnf/virtio-user-ping/setup_virtio_user.sh @@ -0,0 +1,11 @@ +#!/bin/bash +id=$(ip a | grep dummy | cut -f2 -d"-" | cut -f1 -d":") +sed -i "s/vhost-user-1/vhost-user-$id/" /root/startup.conf +mkdir -p /run/vpp +vpp -c /root/startup.conf & +sleep 10 +chmod 777 /run/vpp/cli.sock +vppctl set int state VirtioUser0/0/0 up +ip=$(cut -f6 -d":" /var/run/cni/netconf-$id | cut -f1 -d" ") +vppctl set int ip add VirtioUser0/0/0 $ip/24 +sleep 1000000 -- cgit 1.2.3-korg