VPP VCL API

Through the VCL API of VPP, the application can access the network through VPP without modifying the application.

In this experiment, the network card of the virtual machine is bridged to the home network, VPP takes over the network card, and opens the dhcp client to obtain the IP assigned by the router.

startup.conf

unix { 
	interactive 
	cli-listen /run/vpp/cli.sock 
	gid 0 
	startup-config ./init_cli
}
dpdk { 
	dev 0000:0b:00.0{
		name eth1
	}
}
 
api-trace {
  on
}
 
socksvr {
  default
}
 
cpu {
	main-core 1
	corelist-workers 2,3
}
 
buffers {
        buffers-per-numa 128000
}
 
plugins { 
	plugin oddbuf_plugin.so { enable } 
}

init_cli

set interface state eth1 up
set dhcp client intfc eth1

Start VPP

Make sure to get the ip address

Open a new terminal and configure environment variables

export VCL_CONFIG=/root/vpp/vpp_learn/vcl.conf
export LD_PRELOAD=/root/vpp/vpp_learn/build-root/build-vpp_debug-native/vpp/lib/x86_64-linux-gnu/libvcl_ldpreload.so

 execute wget

The version of VCL API I use still has a lot of incompatibility problems. Executing ping will cause VPP to crash, and executing curl will get stuck and cannot resolve domain names. wget, ssh, iperf all work fine.

Guess you like

Origin blog.csdn.net/wjmasd/article/details/131214100