mininet下获取openvswitch源码及自动化编译
来源:互联网 发布:php做九九乘法表 编辑:程序博客网 时间:2024/06/06 08:24
最近一直想能够获取mininet下openvswitch的源码,但查看各种目录均没找到openvswitch源码的存放位置,最后只好通过升级openvswitch版本来解决问题,由于内核不兼容,之前尝试了很多次都没有成功,今天终于成功了,因此记录一下能成功的相关步骤,以便在后续需要重新配置时帮助回顾。
之前用Ubuntu14.04TLS与Ubuntu16.04都尝试过,都没有成功,最后只好选择Ubuntu12.04。
环境:
虚拟机:Ubuntu12.04.5 3.13.0-32-generic(通过uname -r查看)
mininet:2.3.0d1
openvswitch:2.3.0
关于Linux内核版本与OVS对应关系,可查看网址:http://www.sdnlab.com/3166.html,一定要将升级后的版本与Linux内核版本匹配,不然容易出问题。
一、安装mininet(我是源码安装的),最好是没有装过mininet,不然需要卸载,相关网址:http://www.sdnlab.com/15138.html
可能还需要手动删除
apt-get update
apt-get upgrade
git clone git://github.com/mininet/mininet
cd mininet
./util/install.sh -a
mn --test pingall
mn --version
ovs-vsctl --version
二、升级openvswitch版本
cd /home/XXX 进入需要下载目录
mkdir openvswitch
cd openvswitch
wget http://openvswitch.org/releases/openvswitch-2.3.0.tar.gz
tar -xzf openvswitch-2.3.0.tar.gz
cd openvswitch-2.3.0
apt-get install build-essential fakeroot 安装openvswitch所需依赖
apt-get install debhelper autoconf automake libssl-dev pkg-config bzip2 openssl python-all procps python-qt4 python-zope.interface python-twisted-conch
apt-get install -y build-essential
dpkg-checkbuilddeps 这一步可能提示还有相关依赖文件没安装,直接用apt-get install XXX安装即可(或者试试apt-get -f install)
fakeroot debian/rules binary
cd ..
dpkg -i *.deb
/etc/init.d/openvswitch-controller stop禁止Open VSwitch Controller开机自启动
update-rc.d openvswitch-controller disable
/etc/init.d/openvswitch-switch restart 重启openvswitch
三、验证安装
ovs-vsctl --version
mn --version
四、openvswitch自动化编译:主要是编写简单的shell脚本来实现,在运行时需要先修改权限,假设脚本名为testshell
chmod 777 testshell
./testshell
自动化编译脚本:
#! /bin/sh
kill `cd /usr/local/var/run/openvswitch && cat ovsdb-server.pid ovs-vswitchd.pid`
aptitude remove openvswitch-common openvswitch-datapath-dkms openvswitch-controller openvswitch-pki openvswitch-switch -y
rmmod openvswitch
cd openvswitch/openvswitch-2.3.0
#make clean
./configure --with-linux=/lib/modules/`uname -r`/build
make
make install
modprobe gre
insmod datapath/linux/openvswitch.ko
make modules_install
modprobe openvswitch
#disable openvswitch controller
/etc/init.d/openvswitch-controller stop
update-rc.d openvswitch-controller disable
#start the new ovs
/etc/init.d/openvswitch-switch start
ovsdb-tool create /usr/local/etc/openvswitch/conf.db /usr/local/share/openvswitch/vswitch.ovsschema
ovsdb-server --remote=punix:/usr/local/var/run/openvswitch/db.sock --remote=db:Open_vSwitch,Open_vSwitch,manager_options --pidfile --detach --log-file
ovs-vsctl --no-wait init
ovs-vswitchd --pidfile --detach
特别注意,进入openvswitch的目录需要与自己安装openvswitch-2.3.0的目录保持一致,将该shell脚本放在与openvswitch同一目录下。
另外,只有利用该脚本对已经升级过的openvswitch源码进行测试,在成功运行的情况下才能基本保证openvswitch源码升级成功。
以上是自己这几天配置环境的一点经验,可能有不对的地方,还望大家多多指正,共勉。
- mininet下获取openvswitch源码及自动化编译
- mininet中升级OpenVswitch
- OpenvSwitch自动化重新编译和安装
- Ubuntu 下mininet使用源码安装
- webrtc源码获取及编译
- webrtc源码获取及编译
- #CentOS on Mac#5.OpenVSwitch+mininet
- 自动化编译源码
- imx6 Android源码获取及编译过程
- Ubuntu下的源码下载及编译
- mininet在Ubuntu12.04下的安装及学习
- Mininet使用源码安装
- 手动升级openvswitch版本以替换mininet自带的openvswitch
- Mininet下编写python
- android开发基础[源码获取及编译、模拟器使用]
- Android编译大全(一)--环境配置及获取源码
- Hadoop-2.3.0-cdh5.0.0获取源码及编译
- Hadoop-2.3.0-cdh5.0.0获取源码及编译
- JS中Array方法中常用方法八:Array.prototype.unshift()
- Android Handler
- 【妄言之言】西南游记
- HTTP协议
- find命令
- mininet下获取openvswitch源码及自动化编译
- codeforces 158D 解题报告 数论+暴力
- 数码管——8段共阴极数码管
- 欢迎使用CSDN-markdown编辑器
- java集合框架系列---Map接口
- 替代Java类的日期和时间【 Joda Time】
- linux 显示字符
- 【Android】仿今日头条简单的刷新效果
- java面试题 9月14日