OpenVSwitch(1):Ovs Install

来源:互联网 发布:林志颖淘宝店 编辑:程序博客网 时间:2024/06/05 15:24

  $head -n 1 /etc/issue(查看操作系统)

  $uname -r(查看内核版本)  

  $yum install gcc git(非必须) build-essential(非必须) openssl libcap-devel libcgroup autoconf

  $mkdir -p /opt/src

  $cd /opt/src

  $wget http://openvswitch.org/releases/openvswitch-1.9.3.tar.gz

  $tar zxvf openvswitch-1.9.3.tar.gz

  $cd openvswitch-1.9.3

  $./configure --prefix=/opt/apps_install/openvswitch --with-linux=/lib/modules/`uname -r`/build

  $make && make install

  $ln -s /opt/apps_install/openvswitch  /opt/apps/openvswitch

  $rmmod bridge

  $cp  /opt/src/openvswitch-1.9.3/datapath/linux/openvswitch.ko   /opt/apps/openvswitch/module/

  $insmod   /opt/apps/openvswitch/module/openvswitch.ko

  $vi /etc/profile

  $export PATH=$PATH:/opt/apps/openvswitch/bin:/opt/apps/openvswitch/sbin

  $.  /etc/profile

  $cp  /opt/src/openvswitch-1.9.3/vswitchd/vswitch.ovsschema  /opt/apps/openvswitch/module/

  $ovsdb-tool create /opt/apps/openvswitch/etc/openvswitch/conf.db /opt/apps/openvswitch/module/vswitch.ovsschema

  $ovsdb-server -v --remote=punix:/opt/apps/openvswitch/var/run/openvswitch/db.sock --remote=db:Open_vSwitch,manager_options --private-key=db:SSL,private_key --certificate=db:SSL,certificate --pidfile --detach --log-file

  $ovs-vsctl --no-wait init

  $ovs-vswitchd --pidfile --detach

  $/opt/apps/openvswitch/bin/ovs-vsctl add-br br0 && ovs-vsctl add-port br0  eth0  && ifconfig eth0 0.0.0.0 && ifconfig br0 10.121.35.51 netmask 255.255.252.0 up && route add default gw 10.121.35.254


0 0
原创粉丝点击