Open vSwitch(OVS)源码编译Ubuntu16.04,Linux内核版本4.15

Open vSwitch(OVS)源码编译Ubuntu16.04,Linux内核版本4.15

关于Open vSwitch(OVS)版本与Linux内核的关系,参考这篇文章:Open vSwitch(OVS)版本与Linux内核的关系


先安装需要的库:

apt-get  install dh-autoreconf libelf-dev

如果你安装过mininet,系统中存在OVS了,需要先卸载:

kill `cd /usr/local/var/run/openvswitch && cat ovsdb-server.pid ovs-vswitchd.pid`
rmmod openvswitch

到官网下载压缩包:openvswitch Download
解压后进入目录,运行如下命令:

./configure --with-linux=/lib/modules/`uname -r`/build 
./boot.sh
make clean
make &&  make install
#insmod datapath/linux/openvswitch.ko 
make modules_install
modprobe gre
modprobe openvswitch	
modprobe libcrc32c
lsmod | grep openvswitch
modinfo openvswitch 
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
ovs-vsctl --no-wait init
ovs-vswitchd --pidfile --detach --log-file
service openvswitch-switch start
export PATH=$PATH:/usr/local/share/openvswitch/scripts
ovs-ctl start

幸运的话,一切顺利,可以运行了!

你可能感兴趣的:(SDN,网络)