Last active
June 20, 2022 12:08
-
-
Save olegslavkin/af989e7a850eb67fa779 to your computer and use it in GitHub Desktop.
Install Openvswitch from source (Ubuntu 14.04.3 Server)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!#/bin/bash | |
# Install openvswitch Ubuntu 14.04.3 | |
# Author: Oleg Slavkin ([email protected]) | |
echo "-------------------------------" | |
echo "Step 1. Install git package" | |
echo "-------------------------------" | |
sudo apt-get update | |
sudo apt-get -y install git | |
echo "Step 2. Clone Openvswitch git Repo" | |
git --depth=1 clone https://github.com/openvswitch/ovs.git | |
echo "Step 3. Install tools" | |
sudo apt-get -y install autoconf libtool make | |
echo "Step 4. Build OvS" | |
cd ovs/ | |
./boot.sh | |
./configure --with-linux=/lib/modules/`uname -r`/build | |
make | |
echo "Step 5. Install OpenVswitch" | |
sudo make install | |
sudo make modules_install | |
echo "Step 6. Create OvS Database" | |
sudo ovsdb-tool create /usr/local/etc/openvswitch/conf.db vswitchd/vswitch.ovsschema | |
echo "Step 7. Run OvS..." | |
sudo 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 | |
sudo ovs-vsctl --no-wait init | |
sudo ovs-vswitchd --pidfile --detach |
Hi,
you can use the following command to create your database:
/usr/share/openvswitch/scripts/ovs-ctl start
any time you needed you can use the following command to restart the connection from your OVS to controller:
/usr/share/openvswitch/scripts/ovs-ctl restart
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sir , how can i solved it ?
~$ sudo mn
*** Creating network
*** Adding controller
*** Adding hosts:
h1 h2
*** Adding switches:
ovs-vsctl: unix:/usr/local/var/run/openvswitch/db.sock: database connection failed (No such file or directory)
ovs-vsctl exited with code 1
*** Error connecting to ovs-db with ovs-vsctl
Make sure that Open vSwitch is installed, that ovsdb-server is running, and that
"ovs-vsctl show" works correctly.
You may wish to try "service openvswitch-switch start".
Cdt,