]> git.feebdaed.xyz Git - linuxyz.git/commitdiff
ovs
authorseantywork <seantywork@gmail.com>
Wed, 10 Dec 2025 13:57:29 +0000 (13:57 +0000)
committerseantywork <seantywork@gmail.com>
Wed, 10 Dec 2025 13:57:29 +0000 (13:57 +0000)
README.md
ovs/.gitignore [new file with mode: 0644]
ovs/install.sh [new file with mode: 0755]
ovs/start.sh [new file with mode: 0755]
ovs/test.sh [new file with mode: 0755]

index c144659c979b69560e595bd11c42f9a256a31f85..a38203e53c44af2904aaee9869e3f466b65d701c 100644 (file)
--- a/README.md
+++ b/README.md
@@ -3046,6 +3046,43 @@ conntrack -D -p tcp --dport 993
 
 ```
 
+# OPENVSWITCH OVS
+
+```shell
+
+sudo apt update 
+sudo apt install build-essential make autoconf libtool
+git clone https://github.com/openvswitch/ovs.git
+
+cd ovs 
+
+git switch -c myovs origin/branch-3.6
+
+./boot.sh 
+
+./configure
+
+make 
+
+sudo make install
+```
+
+```shell
+# create, add
+sudo ovs-vsctl add-br ovs-br0
+
+sudo ovs-vsctl add-port ovs-br0 veth11
+
+sudo ovs-vsctl add-port ovs-br0 veth21
+
+sudo ip link set up veth11
+
+sudo ip link set up veth21
+
+sudo ip link set ovs-br0 up
+
+```
+
 
 # FIREWALL  
 
diff --git a/ovs/.gitignore b/ovs/.gitignore
new file mode 100644 (file)
index 0000000..e055b0a
--- /dev/null
@@ -0,0 +1 @@
+ovs
\ No newline at end of file
diff --git a/ovs/install.sh b/ovs/install.sh
new file mode 100755 (executable)
index 0000000..778f4bd
--- /dev/null
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+sudo apt update 
+sudo apt install build-essential make autoconf libtool
+git clone https://github.com/openvswitch/ovs.git
+
+cd ovs 
+
+git switch -c myovs origin/branch-3.6
+
+./boot.sh 
+
+./configure
+
+make 
+
+sudo make install
+
diff --git a/ovs/start.sh b/ovs/start.sh
new file mode 100755 (executable)
index 0000000..0a394ab
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+mkdir -p /usr/local/etc/openvswitch
+
+sudo ovsdb-tool create /usr/local/etc/openvswitch/conf.db vswitchd/vswitch.ovsschema
+
+sudo /usr/local/share/openvswitch/scripts/ovs-ctl start
+
+sudo ovs-vsctl --no-wait init
+
+# sudo ovs-vswitchd --pidfile --detach --log-file
\ No newline at end of file
diff --git a/ovs/test.sh b/ovs/test.sh
new file mode 100755 (executable)
index 0000000..e266f49
--- /dev/null
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+sudo ovs-vsctl add-br ovs-br0
+
+sudo ip netns add net1
+
+sudo ip netns add net2
+
+sudo ip link add dev veth11 type veth peer name veth12 netns net1
+
+sudo ip link add dev veth21 type veth peer name veth22 netns net2
+
+sudo ovs-vsctl add-port ovs-br0 veth11
+
+sudo ovs-vsctl add-port ovs-br0 veth21
+
+sudo ip netns exec net1 ip addr add 192.168.64.12/24 dev veth12
+
+sudo ip netns exec net2 ip addr add 192.168.64.22/24 dev veth22
+
+sudo ip netns exec net1 ip link set veth12 up
+
+sudo ip netns exec net1 ip link set veth22 up
+
+sudo ip link set up veth11
+
+sudo ip link set up veth21
+
+sudo ip link set ovs-br0 up
+
+sudo sysctl -w net.ipv4.ip_forward=1
\ No newline at end of file