
DPDK-VPP 学习笔记-02
发布日期:2021-05-14 03:34:50
浏览次数:54
分类:精选文章
本文共 3781 字,大约阅读时间需要 12 分钟。
DPDK-VPP 学习笔记-02
启始配置
DPDK-VPP 启始配置如下:
unix { nodaemon; log /var/log/vpp/vpp.log; full-coredump; cli-listen /run/vpp/cli.sock;}socksvr { default;}api-trace { on;}cpu { main-core 0; corelist-workers 1-16,24-39; scheduler-policy fifo; scheduler-priority 50;}buffers { buffers-per-numa 204800;}plugins { path /usr/lib/vpp_plugins/:/usr/lib/vpp_api_test_plugins/; plugin default { enable };}dpdk { dev default { num-rx-queues 16; num-tx-queues 16; num-rx-desc 2048; num-tx-desc 2048; devargs mprq_en=1,rxqs_min_mprq=1,txqs_min_inline=1; } num-mem-channels 4; log-level debug; socket-mem 32768; dev 0000:19:00.1 { name 100GE1/0/1; } dev 0000:54:00.1 { name 100GE1/0/2; } no-multi-seg; no-tx-checksum-offload;}
L2 xconnect 配置
L2 xconnect 模式配置如下:
set interface state 100GE1/0/1 up;set interface state 100GE1/0/2 up;set interface l2 xconnect 100GE1/0/1 100GE1/0/2;set interface l2 xconnect 100GE1/0/2 100GE1/0/1;show mode 100GE1/0/1 100GE1/0/2;
如需取消 L2 xconnect 模式,将接口配置为 L3 模式:
set interface l3 100GE1/0/1;set interface l3 100GE1/0/2;show mode 100GE1/0/1 100GE1/0/2;
L2 bridge 配置
L2 bridge 配置如下:
set interface state 100GE1/0/1 up;set interface state 100GE1/0/2 up;set interface l2 bridge 100GE1/0/1 200;set interface l2 bridge 100GE1/0/2 200;show mode 100GE1/0/1 100GE1/0/2;show bridge-domain 200 detail;
如需取消 L2 bridge 模式,将接口配置为 L3 模式:
set interface l3 100GE1/0/1;set interface l3 100GE1/0/2;show mode 100GE1/0/1 100GE1/0/2;
LACP 配置
LACP 配置如下:
set int mtu packet 1500 100GE1/0/1;set int mtu packet 1500 100GE1/0/2;set int state 100GE1/0/1 up;set int state 100GE1/0/2 up;create bond mode lacp load-balance l23;set int mtu packet 1500 BondEthernet0;bond add BondEthernet0 100GE1/0/1;bond add BondEthernet0 100GE1/0/2;set int ip address BondEthernet0 40.0.167.68/24;set int state BondEthernet0 up;show bond details;show ip neighbors;
如需删除 LACP 配置:
bond del 100GE1/0/1;bond del 100GE1/0/2;delete bond BondEthernet0;
注:在 VPP 20.05.1 版本中,BondEthernet0 与交换机可能会不通,具体原因尚未确定。
L3 路由
L3 路由配置如下:
set int mtu packet 1500 100GE1/0/1;set int mtu packet 1500 100GE1/0/2;set int ip address 100GE1/0/1 40.0.148.68/24;set int ip address 100GE1/0/2 40.0.147.68/24;set int state 100GE1/0/1 up;set int state 100GE1/0/2 up;
添加多路径路由:
ip route add 40.0.40.2/32 via 40.0.147.66 weight 1;ip route add 40.0.40.2/32 via 40.0.148.66 weight 3;show ip fib;
添加多路径等价路由:
ip route add 40.0.40.2/32 via 40.0.147.66;ip route add 40.0.40.2/32 via 40.0.148.66;show ip fib;
添加 VRF 路由:
ip route add 40.0.40.2/32 table 7 via 100GE1/0/1;show ip fib;
删除路由:
ip route del 40.0.40.2/32 via 40.0.147.66;ip route del 40.0.40.2/32 via 40.0.148.66;show ip fib;
IPv6 地址配置:
enable ip6 interface 100GE1/0/1;disable ip6 interface 100GE1/0/1;
添加接口路由表(VRF):
set interface ip table 100GE1/0/1 200;set interface ip6 table 100GE1/0/1 201;
ACL 插件
ACL 插件配置如下:
vpp# set acl-plugin acl ?;vpp# set acl-plugin acl [permit|deny] [src] [dst ] [proto X sport X-Y dport X-Y [tag FOO]];vpp# [이미지 harmless];
添加 ACL 到接口:
set acl-plugin acl permit src 40.0.0.0/16;set acl-plugin acl deny dst 40.0.40.2/32;set acl-plugin int 100GE1/0/1 input acl 0;set acl-plugin int 100GE1/0/2 input acl 0;set acl-plugin int 100GE1/0/1 input acl 1;set acl-plugin int 100GE1/0/2 input acl 1;show acl-plugin acl 0;show acl-plugin acl 1;show acl-plugin memory;show acl-plugin sessions;show acl-plugin tables;
移除 ACL:
set acl-plugin int 100GE1/0/1 input acl 0 del;set acl-plugin int 100GE1/0/2 input acl 0 del;set acl-plugin int 100GE1/0/1 input acl 1 del;set acl-plugin int 100GE1/0/2 input acl 1 del;
清除 ACL 会话:
clear acl-plugin sessions;
发表评论
最新留言
很好
[***.229.124.182]2025年04月30日 17时30分03秒
关于作者

喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
Java 回调机制
2019-03-11
7、回归和特征选择
2019-03-11
pycharm使用(新建工程、字体修改、调试)
2019-03-11
什么是Numpy、Numpy教程
2019-03-11
Python学习笔记——元组
2019-03-11
异常声音检测
2019-03-11
numpy版本问题
2019-03-11
无法打开文件“opencv_world330d.lib”的解决办法
2019-03-11
maven项目通过Eclipse上传到svn上面,再导入到本地出现指定的类找不到的问题
2019-03-11
maven 项目部署到tomcat下 没有class文件
2019-03-11
算法训练 未名湖边的烦恼(递归,递推)
2019-03-11
算法训练 完数(循环,数学知识)
2019-03-11
什么是接口
2019-03-11
2020版nodejs12.18.3安装配置教程
2019-03-11
iview组件库中,Form组件里的Input,无法正确绑定on-enter事件
2019-03-11
记录-基于springboot+vue.js实现的超大文件分片极速上传及流式下载
2019-03-11
JavaScript高级程序设计第四版学习记录-第九章代理与反射
2019-03-11