openvswitch 使用记录(一)

openvswitch-2.12.0 基于loongson平台的编译安装

下载源码路径为:

http://www.openvswitch.org/download/ 

 

tar xvf ../../ext_tools/openvswitch-2.12.0.tar.gz -C ./

cd openvswitch-2.12.0/

1、./boot.sh

2、./configure --with-linux=/lib/modules/3.10.0irqfd+/build/

或者

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

或者

./configue

 

3、make -j4

make install

make modules_install

 

modprobe openvswitch  //加载openvswitch内核模块

 

 

启动脚本内容

#!/bin/bash

echo "start"

export PATH=$PATH:/usr/local/share/openvswitch/scripts

ovs-ctl start

echo "start ovsdb-serveryy"
ovs-ctl --no-ovs-vswitchd start

echo "start ovs-vswichd server"
ovs-ctl --no-ovsdb-server start

echo "configure a database that it can use"
mkdir -p /usr/local/etc/openvswitch
ovsdb-tool create /usr/local/etc/openvswitch/conf.db \
  vswitchd/vswitch.ovsschema


mkdir -p /usr/local/var/run/openvswitch
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 --detach --log-file

#Note If you built Open vSwitch without SSL support, then omit --private-key, --certificate, and --bootstrap-ca-cert.)
echo "Initialize the database using ovs-vsctl"
ovs-vsctl --no-wait init

echo "Start the main Open vSwitch daemon, telling it to connect to the same Unix domain socket"
ovs-vswitchd --pidfile --detach --log-file

 

[root@localhost ~]# ovs-vsctl show

06e749d9-0c1e-4b72-bcbc-94db1b7111dd

    ovs_version: "2.12.0"

 

 

参考链接:

https://www.cnblogs.com/liujunjun/p/12121579.html

官网教程:

http://docs.openvswitch.org/en/latest/intro/install/general/

 

 

你可能感兴趣的:(虚拟化)