VPP命令行:启动配置,HTTP服务,DPDK配置

目录

常用命令

启动配置

HTTP服务配置

VLIB命令行


 

常用命令

VPP CLI功能
create sub BondEthernet0 834创建子接口,tag是834
set interface ip table BondEthernet0.834 1将此接口设置在fib 1里
set interface ip address BondEthernet0.834 192.168.0.250/24设置接口ip
set interface state  BondEthernet0.834 up up接口
set interface l2 bridge BondEthernet0.834 834将此接口设置到bridge 834里.................................................................................................
set ip arp GigabitEthernet2/6/0 192.168.2.2 00:0c:29:dc:96:f8 设置静态arp
ip route add 1.2.3.0/24 via GigabitEthernet2/6/0添加路由
create vhost socket /tmp/sock2.sock server创建vhost接口
l2fib add  fa:16:3e:b0:a9:71 834  BondEthernet0.834 添加二层转发流表
create host-interface name vpp5a

创建veth口,name后参数名字必须

和linux里创建的veth口名字对应

set dpdk interface descriptors  TenGigabitEthernet6/0/0 tx/rx 1024设置此接口rx或是tx队列大小,intel人
说2000-4000差距不大

 set interface handoff <interface-name> workers <workers-list> [symmetrical|asymmetrical]  

 
trace add dpdk-input 8跟踪dpdk接口数据包 (dpdk-input是节点的名字,想跟踪任何节点都可以)
trace add vhost-user-input 8跟踪vhost接口数据包
trace add af-packet-input 8跟踪veth接口数据包 
show hardware-interfaces查看接口mac
show vlib graph 查看node逻辑图
show threads    查看vpp线程
show l2fib查看二层转发流表
show ip fib查看路由表
show ip arp查看arp
show affinity    查看主线程cpu亲和性
show version   查看vpp版本
show int查看接口统计
show interfaces address查看接口ip
show bridge-domain查看bridge 接口情况

https://blog.csdn.net/shaoyunzhe/article/details/53322088

https://www.cnblogs.com/kb342/p/6425019.html

 

启动配置

一个配置VPP的命令文件

comment {
	文件描述:该文件用于配置VPP网络,具体配置根据实际情况而定
	作者:rtoax
	时间:2020年9月2日
	网址:https://docs.fd.io/vpp/20.05/d5/d57/clicmd.html
}

comment { 设置网卡IP地址 }
set interface ip address dpdk0 10.170.7.169/24 

comment { 设置网卡MAC地址 }
comment {
set interface mac address dpdk0 xx:xx:xx:xx:xx:xx
}

comment { 设置MTU-最大传输单元 }
comment {
set interface mtu [packet|ip4|ip6|mpls] value interface
}

comment { 设置接收模式 }
comment {
set interface rx-mode interface [queue n] [polling | interrupt | adaptive]
}
show interface rx-placement

comment { 设置队列worker }
comment {
set interface rx-placement interface queue 1 worker 0
}

comment { 启动网卡 [up|down|punt|enable] }
set interface state dpdk0 up

comment { 设置路由,根据实际情况决定 }
ip route add 10.170.6.0/24 via 10.170.7.254

comment { 开启混杂模式  }
set interface promiscuous on dpdk0

comment { 启动local0口 }
set interface state local0 up

comment { 创建环回地址 }
create loopback interface
set interface state loop0 up

comment { DPDK相关配置、查询 }
show dpdk buffer
show dpdk physmem
show dpdk version

comment { DPDK内存测试 }
test dpdk buffer allocate 1024
test dpdk buffer
test dpdk buffer free 1024

comment { 显示有用信息 }
show version



comment { 抓包 }
comment {
pcap trace status
pcap trace tx max 35 intfc dpdk0 file dpdk0.pcap
pcap trace status
pcap trace off
}

 

HTTP服务配置

comment {
	文档描述:搭建HTTP服务器
	作者:rtoax
	日期:2020年9月2日
	参考网址:https://docs.fd.io/vpp/20.05/d9/d3e/clicmd_src_plugins_http_static_static_server_c.html
}

comment { 清理缓存 }
clear http server cache

comment { 建立服务 }
http static server www-root /var/www/html uri tcp://0.0.0.0/80 cache-size 2m

 

VLIB命令行

comment {
	文档说明:VLIB操作
	作者:rtoax
	时间:2020年9月2日
	参考地址:https://docs.fd.io/vpp/20.05/df/d0f/clicmd_src_vlib.html
}

clear errors
clear logging
clear node counters
clear runtime
clear trace

comment {
	Control event logging of api, cli, and thread barrier events With no arguments, 
		displays the current trace status. 
	elog trace [api][cli][barrier][dispatch] [disable]	
}
elog trace cli

show cpu
show errors
show clock
show errors 
show event-logger
show node
show node counters
show threads
show vlib frame-allocation

 

评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值