首页 > 代码库 > 安装Openvswich 2.3.0

安装Openvswich 2.3.0

1.预先安装

sudo apt-get install aptitude

sudo aptitude install dh-autoreconf libssl-dev openssl

2.安装openvswich

wget http://openvswitch.org/releases/openvswitch-2.3.0.tar.gz

tar zxvf openvswitch-2.3.0.tar.gz && cd openvswitch-2.3.0

./boot.sh

./configure --with-linux=/lib/modules/`uname -r`/build

make -j && sudo make install

sudo make modules_install

sudo modprobe gre

sudo modprobe openvswitch

sudo modprobe libcrc32c

使用lsmod |grep openvswitch 查看openvswich正确挂起

3.设定ovsdb

sudo ovsdb-tool create /usr/local/etc/openvswitch/conf.db /usr/local/share/openvswitch/vswitch.ovsschema

4.启动ovsdb-server

(root权限下)

 ovsdb-server --remote=punix:/usr/local/var/run/openvswitch/db.sock                      --remote=db:Open_vSwitch,Open_vSwitch,manager_options                      --private-key=db:Open_vSwitch,SSL,private_key                      --certificate=db:Open_vSwitch,SSL,certificate                      --bootstrap-ca-cert=db:Open_vSwitch,SSL,ca_cert                      --pidfile --detach5

 

5.启动ovs-vsctl

ovs-vsctl --no-wait init

6.启动ovs-swicthd

ovs-vswitchd --pidfile --detach --log-file

 7.设定开机自动启动openvswitch

1)vim /etc/init.d/openvswitch

#!/bin/shstart-stop-daemon -q -S -x /usr/local/sbin/ovsdb-server -- --remote=punix:/usr/local/var/run/openvswitch/db.sock --remote=db:Open_vSwitch,Open_vSwitch,manager_options --pidfile --detach --log-filesleep 3 # waiting ovsdb-server start-stop-daemon -q -S -x /usr/local/bin/ovs-vsctl -- --no-wait initstart-stop-daemon -q -S -x /usr/local/sbin/ovs-vswitchd -- --pidfile --detach --log-file

2)chmod +x /etc/init.d/openvswitch

3)update-rc.d -f openvswitch defaults

 

 参考 http://roan.logdown.com/posts/220671-compile-openvswitch-v230-on-ubutnu-14041-lts

 

安装Openvswich 2.3.0