Build OpenVSwitch and OVN

Posted Hi,云计算!

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Build OpenVSwitch and OVN相关的知识,希望对你有一定的参考价值。

OVN 作为OpenVSwitch的功能模块,每次OVN与OpenVSwitch一起发布,OVN与OpenVSwitch源代码放在ovs代码库:https://github.com/openvswitch/ovs.git

Build OpenVSwitch and OVN

 1 # *Linux Environment: CentOS 73.10.0-327.18.2.el7.x86_64)
 2   
 3 # Install depen package
 4 yum install gcc make python-devel openssl-devel kernel-devel graphviz \\
 5     kernel-debug-devel autoconf automake rpm-build redhat-rpm-config \\
 6     libtool checkpolicy selinux-policy-devel
 7   
 8 # Download code
 9 git clone https://github.com/openvswitch/ovs.git
10   
11 # Start build
12 cd $OVS_DIR
13 # Bootstrapping
14 ./boot.sh
15 # Configuring (special --prefix and --with-linux  e.g  ./configure  --with-linux=/lib/modules/$(uname -r)/build)
16 ./configure
17 #Build
18 make
19   
20 # 安装方式一 源代码安装
21  make install
22 ## Install kernel modules
23  make modules_install
24 ## Start service
25 ### Start openvswitch service
26 /usr/local/share/openvswitch/scripts/ovs-ctl start --system-id=random
27 ### Start ovn-northd
28 /usr/local/share/openvswitch/scripts/ovn-ctl start_northd
29 ### Start ovn-controller
30 /usr/local/share/openvswitch/scripts/ovn-ctl start_controller
31   
32 # 安装方式二 RPM包安装
33 ## Package RPM openvswitch and ovn
34 make rpm-fedora RPMBUILD_OPT="--without check"
35 ## Build kernel OVS Tree Datapath (specila kernal version, e.g  make rpm-fedora-kmod RPMBUILD_OPT=\'-D "kversion 4.3.4-300.fc23.x86_64"\')
36 make rpm-fedora-kmod
37 ## Look for rpm from $OVS_DIR/rpm/rpmbuild/RPMS/x86_64
38 ### Install kernel OVS Tree Datapath
39 yum localinstall openvswitch-kmod-2.6.90-1.el7.centos.x86_64.rpm
40 ### Install OVS
41 yum localinstall openvswitch-2.6.90-1.el7.centos.x86_64.rpm
42 ### Install OVN
43 #### Install ovn common package
44 yum localinstall openvswitch-ovn-common-2.6.90-1.el7.centos.x86_64.rpm
45 #### Install ovn northd service
46 yum localinstall openvswitch-ovn-central-2.6.90-1.el7.centos.x86_64.rpm
47 #### Install ovn controller service
48 yum localinstall openvswitch-ovn-host-2.6.90-1.el7.centos.x86_64.rpm
49 ## Start service
50 ### Start openvswitch service
51 systemctl start openvswitch.service
52 ### Start ovn-northd
53 systemctl start ovn-northd
54 ### Start ovn-controller
55 systemctl start ovn-controller

 

使用NAT功能(基于Connection tracking),需要安装OVS Tree Datapath。

 

 

参考文档

     https://github.com/openvswitch/ovs/blob/master/Documentation/faq/releases.rst

     https://github.com/openvswitch/ovs/blob/master/Documentation/intro/install/fedora.rst

以上是关于Build OpenVSwitch and OVN的主要内容,如果未能解决你的问题,请参考以下文章

ovn+ 控制节点 + 计算节点

ovn编译

ovn编译

基于OVN的Kubernetes网络架构解析

Integrate Neutron and OVN

Openvswitch原理与代码分析: openvswitch内核模块的加载