>>>>>>>> [ovs][libvirt] virt-xml ovs-vsctl

 

查看可用的参数:

[root@vrouter1 tong]#  virt-xml --add-device --network=? |grep source
  source
  source_mode
  source_path
  source_type
[root@vrouter1 tong]# 

 

添加两个vhostuser的网卡

[root@vrouter1 ~]# virt-xml --add-device --network type=vhostuser,model=virtio,source_type=unix,source_mode=server,source_path="/tmp/nlb_vm0.sock" centos7.0
Domain 'centos7.0' defined successfully.
[root@vrouter1 ~]# virt-xml --add-device --network type=vhostuser,model=virtio,source_type=unix,source_mode=server,source_path="/tmp/nlb_vm1.sock" centos7.0
Domain 'centos7.0' defined successfully.
[root@vrouter1 ~]# 

 

删除所有类型为bridge的网卡

[root@vrouter1 ~]# virt-xml --remove-device --network type=bridge centos7.0
Domain 'centos7.0' defined successfully.
[root@vrouter1 ~]# 

 

设置OVS-dpdk

[root@vrouter1 ~]# ovs-vsctl add-br ovs-br0
ovs-vsctl: Error detected while setting up 'ovs-br0'.  See ovs-vswitchd log for details.
ovs-vsctl: The default log directory is "/var/log/openvswitch".
[root@vrouter1 ~]# ovs-vsctl set bridge ovs-br0 datapath_type=netdev

 

设置 vhostuser port

[root@vrouter1 ~]# ovs-vsctl add-port ovs-br0 vhostclient0 -- set Interface vhostclient0 type=dpdkvhostuserclient options:vhost-server-path=/tmp/nlb_vm0.sock

 

编译qemu

./configure --prefix=/export/Datapath/tong/qemu_home/ --target-list=x86_64-softmmu --disable-gtk 

 

设置ovs-dpdk port

 
  

[root@vrouter1 ~]# dpdk-devbind -b vfio-pci eth0

[root@vrouter1 ~]# ovs-vsctl add-port ovs-br0 pci_port1 -- set Interface pci_port1 type=dpdk options:dpdk-devargs=0000:03:00.1

 

root@vrouter1 ~# ovs-vsctl add-br ovs-phy -- set bridge ovs-phy datapath_type=netdev

 

[root@vrouter1 ~]# ovs-vsctl add-port ovs-br0 vxlantarget1 -- set interface vxlantarget1 type=vxlan options:remote_ip=192.168.77.200 options:local_ip=10.0.0.161 options:in_key=flow options:out_key=flow
[root@vrouter1 ~]# ovs-vsctl add-port ovs-br0 vxlanclient1 -- set interface vxlanclient1 type=vxlan options:remote_ip=192.168.77.163 options:local_ip=10.0.0.161 options:in_key=flow options:out_key=flow

 

[root@vrouter1 ~]# ovs-ofctl -O openflow13 del-flows ovs-br0

 

转载于:https://www.cnblogs.com/hugetong/p/8992692.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值