原文链接:https://blog.csdn.net/shaoyunzhe/article/details/53322088
接口操作 | vat对应命令 | |
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 ip address del BondEthernet0.834 192.168.0.250/24 | 删除接口地址 | |
set interface ip address del eth0 all | 删除接口所有地址 | |
set interface state BondEthernet0.834 up | up接口 | |
set interface l2 bridge BondEthernet0.834 834 | 将此接口设置到bridge 834里 | |
create vhost socket /tmp/sock2.sock server | 创建vhost接口 | |
create host-interface name vpp5a | 创建veth口,name后参数名字必须和linux里创建的veth口名字对应(先系统命令创建veth口) | |
set interface handoff <interface-name> workers <workers-list> [symmetrical|asymmetrical] | ||
show hardware-interfaces | 查看接口mac | |
show int | 查看接口信息 | |
show interfaces address | 查看接口地址 | |
pipe create [instance <instance>] | 添加pipe接口,这是vpp自带类似于veth的接口,连接互通vrf,instance为数字,最大支持16384,eg:pipe create instance 100,生成pipe100,pipe100.0,pipe100.1,这三个都需要up,将pipe100.0分配到一个vrf,pipe100.1分配到另一个vrf, | |
pipe delete <interface> | 删除pipe接口 | |
bond接口 | ||
create bond mode lacp load-balance l34 | 创建bond接口 | |
delete bond BondEthernet0 | 删除bond接口 | |
bond add BondEthernet0 TenGigabitEthernet3d/0/0 | bond口添加slave接口 | |
bond del TenGigabitEthernet3d/0/0 | bond口删除slave接口 | |
show bond details | 查看bond 详细信息 | |
set interface bond BondEthernet weight 100 | 设置bond口权重 | |
二层操作 | ||
set ip neighbor GigabitEthernet2/6/0 192.168.2.2 00:0c:29:dc:96:f8 | 设置静态arp | |
l2fib add fa:16:3e:b0:a9:71 834 BondEthernet0.834 | 添加二层转发流表 | |
show l2fib | 查看二层转发流表 | |
show ip neighbors | 查看arp | |
show bridge-domain | 查看bridge 接口情况 | |
路由表(vrf)操作 | ||
ip table [add|del] <table-id> | 添加ipv4 vrf(路由表) | |
ip6 table [add|del] <table-id> | 添加ipv6 vrf(路由表) | |
ip route add 1.2.3.0/24 via GigabitEthernet2/6/0 | 添加路由 | |
show ip fib | 查看路由表 | |
DPDK参数设置 |
| |
set dpdk interface descriptors TenGigabitEthernet6/0/0 tx/rx 1024 | 设置此接口rx或是tx队列大小,intel人 说2000-4000差距不大 | |
show affinity
| 查看主线程cpu亲和性 | |
数据包跟踪设置 |
| |
trace add dpdk-input 8 | 跟踪dpdk接口数据包 (dpdk-input是节点的名字,想跟踪任何节点都可以) | |
trace add vhost-user-input 8 | 跟踪vhost接口数据包 | |
trace add af-packet-input 8 | 跟踪veth接口数据包 | |
vpp操作 | ||
show vlib graph | 查看node逻辑图 | |
show int GigabitEthernet3c/0/0 features | 查看此接口使能了哪些feature | |
show threads | 查看vpp线程 | |
show version | 查看vpp版本 | |
ACL操作 | ||
获取acl插件版本 | acl_plugin_get_version | |
增加或替换ACL规则 | acl_add_replace | |
删除某ACL | acl_del | |
show acl-plugin acl [index N] | 罗列所有ACL列表 | acl_dump |
从网口的访问控制列表中增减某项 | acl_interface_add_del | |
给指定端口设置输入输出控制方式 | acl_interface_set_acl_list | |
show acl-plugin interface | 显示哪个端口采用哪个访问控制规则 | acl_interface_list_dump |
增加一条MAC/IP的访问控制列 | macip_acl_add | |
删除一条MAC/IP的访问控制列 | macip_acl_del | |
show acl-plugin macip acl | 查看配置的macip acl规则 | macip_acl_dump |
show acl-plugin macip interface | 查看所有接口绑定的macip acl信息 | macip_acl_interface_get |
从给定端口绑定/解绑MACIP某条访问控制列表 | macip_acl_interface_add_del | |
SNAT操作 | ||
nat44 add address <ip4-range-start> [- <ip4-range-end>] [tenant-vrf <vrf-id>] [twice-nat] [del] | 配置某个vrf的snat ip地址池 eg:nat44 add address 211.1.1.216 tenant-vrf 20001 | |
set interface nat44 in <intfc> out <intfc> [output-feature] [del] | 设置snat的in接口和out接口,配置为in的接口的接口会查询in2out key,配置为out的接口会查询out2in key,同时配置为in和out的接口根据classefy决定
set interface nat44 in TenGigabitEthernet3b/0/0.1001 | |