wget http://fast.dpdk.org/rel/dpdk-19.11.7.tar.xz tar -xvf dpdk-19.11.7.tar.xz cd dpdk-stable-19.11.7/ mkdir -p /usr/src/dpdk make config T=x86_64-native-linuxapp-gcc
1 2 3
修改支持MLX CX4/CX5 sed -i 's/\(CONFIG_RTE_LIBRTE_MLX5_PMD=\)n/\1y/g' config/common_base sed -i 's/\(CONFIG_RTE_LIBRTE_MLX5_DLOPEN_DEPS=\)n/\1y/g' config/common_base
1 2
make install T=x86_64-native-linuxapp-gcc DESTDIR=/usr/src/dpdk make install T=x86_64-native-linuxapp-gcc DESTDIR=/usr
# create new port on router 'tenant1' ovn-nbctl lrp-add router-tenant1 tenant1-outside 02:0a:7f:18:01:02 192.168.0.101/24 # set gateway chassis(通过ovn-sbctl show 选取central节点作为vtep网关节点) ovn-nbctl lrp-set-gateway-chassis tenant1-outside fda80787-897d-40af-811c-2c9f7caedb3b
# create new logical switch and connect it to 'router0' ovn-nbctl ls-add outside ovn-nbctl lsp-add outside outside-tenant1 ovn-nbctl lsp-set-type outside-tenant1 router ovn-nbctl lsp-set-addresses outside-tenant1 02:0a:7f:18:01:02 ovn-nbctl lsp-set-options outside-tenant1 router-port=tenant1-outside # ovn-nbctl lsp-set-options outside-tenant1 nat-addresses=router router-port=tenant1-outside
创建ovs网桥br-ex,并关联逻辑交换机outside
1 2 3 4 5
# create localnet port on 'outside'. set the network name to "phynet" ovn-nbctl lsp-add outside outside-localnet ovn-nbctl lsp-set-addresses outside-localnet unknown ovn-nbctl lsp-set-type outside-localnet localnet ovn-nbctl lsp-set-options outside-localnet network_name=phynet1
在central节点上创建ovs网桥br-ex,然后将eth1挂到ovs网桥上
1 2 3 4 5 6
# create a bridge , then mapping outside port ovs-vsctl add-br br-ex ovs-vsctl set Open_vSwitch . external-ids:ovn-bridge-mappings=phynet1:br-ex
# add nic eth1 ovs-vsctl add-port br-ex eth1
给 central节点br-ex 配置ip测试联通
1 2
#ifconfig br-ex 192.168.0.100/24 #ip link set br-ex up
交换机01 #ip netns add ns1 #ovs-vsctl add-port br-int vm1 -- set interface vm1 type=internal #ip link set vm1 netns ns1 #ip netns exec ns1 ip link set vm1 address $vm1_mac #ip netns exec ns1 ip addr add $vm1_ip/24 dev vm1 #ip netns exec ns1 ip link set vm1 up #ovs-vsctl set Interface vm1 external_ids:iface-id=ls1-vm1 #ip netns exec ns1 ip addr show
1 2 3 4 5 6 7 8 9
交换机02 #ip netns add ns11 #ovs-vsctl add-port br-int vm11 -- set interface vm11 type=internal #ip link set vm11 netns ns11 #ip netns exec ns11 ip link set vm11 address $vm11_mac #ip netns exec ns11 ip addr add $vm11_ip/24 dev vm11 #ip netns exec ns11 ip link set vm11 up #ovs-vsctl set Interface vm11 external_ids:iface-id=ls2-vm11 #ip netns exec ns11 ip addr show
node2节点(vm2)
1 2 3 4 5 6 7 8 9
交换机01 #ip netns add ns2 #ovs-vsctl add-port br-int vm2 -- set interface vm2 type=internal #ip link set vm2 netns ns2 #ip netns exec ns2 ip link set vm2 address $vm2_mac #ip netns exec ns2 ip addr add $vm2_ip/24 dev vm2 #ip netns exec ns2 ip link set vm2 up #ovs-vsctl set Interface vm2 external_ids:iface-id=ls1-vm2 #ip netns exec ns2 ip addr show
1 2 3 4 5 6 7 8 9
交换机02 #ip netns add ns12 #ovs-vsctl add-port br-int vm12 -- set interface vm12 type=internal #ip link set vm12 netns ns12 #ip netns exec ns12 ip link set vm12 address $vm12_mac #ip netns exec ns12 ip addr add $vm12_ip/24 dev vm12 #ip netns exec ns12 ip link set vm12 up #ovs-vsctl set Interface vm12 external_ids:iface-id=ls2-vm12 #ip netns exec ns12 ip addr show
#ovs-vsctl set open . external-ids:ovn-remote=tcp:$Centralip:6642 overlay网络使用geneve,当然支持geneve,vxlan,gre等 #ovs-vsctl set open . external-ids:ovn-encap-type=geneve #ovs-vsctl set open . external-ids:ovn-encap-ip=$Centralip
node 1 节点
1 2 3 4 5
#export Centralip=10.175.160.66 #export NodeIP=10.175.160.59 #ovs-vsctl set open . external-ids:ovn-remote=tcp:$Centralip:6642 #ovs-vsctl set open . external-ids:ovn-encap-type=geneve #ovs-vsctl set open . external-ids:ovn-encap-ip=$NodeIP
node2 节点
1 2 3 4 5
#export Centralip=10.175.160.66 #export NodeIP=10.175.160.60 #ovs-vsctl set open . external-ids:ovn-remote=tcp:$Centralip:6642 #ovs-vsctl set open . external-ids:ovn-encap-type=geneve #ovs-vsctl set open . external-ids:ovn-encap-ip=$NodeIP
所有服务器重启一下
#reboot
至此安装完成~
排错
1 2 3 4 5 6
1. net_mlx5: cannot load glue library: libibverbs.so.1: cannot open shared object file: No such file or directory net_mlx5: cannot initialize PMD due to missing run-time dependency on rdma-core libraries (libibverbs, libmlx5) PMD: net_mlx4: cannot load glue library: libibverbs.so.1: cannot open shared object file: No such file or directory PMD: net_mlx4: cannot initialize PMD due to missing run-time dependency on rdma-core libraries (libibverbs, libmlx4) 解决:#yum install libibverbs -y