Last active
August 26, 2021 16:45
-
-
Save subh007/1fe29e61d15b619e09b5 to your computer and use it in GitHub Desktop.
OVS-config
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/sh | |
echo "setting the environment" | |
echo "if the br0 exist then delete the br0" | |
sudo ovs-vsctl del-br br0 | |
echo "creating the veth" | |
sudo ip link add veth0 type veth peer name veth1 | |
sudo ip link add veth2 type veth peer name veth3 | |
sudo ip link add veth4 type veth peer name veth5 | |
sudo ip link add veth6 type veth peer name veth7 | |
sudo ip link add veth8 type veth peer name veth9 | |
echo "up the interface" | |
sudo ifconfig veth0 up | |
sudo ifconfig veth1 up | |
sudo ifconfig veth2 up | |
sudo ifconfig veth3 up | |
sudo ifconfig veth4 up | |
sudo ifconfig veth5 up | |
sudo ifconfig veth6 up | |
sudo ifconfig veth7 up | |
sudo ifconfig veth8 up | |
sudo ifconfig veth9 up | |
sudo ovs-vsctl add-br br0 | |
sudo ovs-vsctl add-port br0 veth0 | |
sudo ovs-vsctl add-port br0 veth2 | |
sudo ovs-vsctl add-port br0 veth4 | |
sudo ovs-vsctl add-port br0 veth6 | |
sudo ovs-vsctl add-port br0 veth8 | |
sudo ifconfig br0 1.1.1.2 netmask 255.255.255.0 | |
sudo ifconfig veth1 1.1.1.1 netmask 255.255.255.0 | |
#To Add Controller: | |
sudo ovs-vsctl set-controller br0 tcp:1.1.1.1:6633 | |
#To see Port Details/Build Number for OVS: | |
sudo ovs-vsctl show | |
echo "===== successfully created the environment =======" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment