--- /dev/null
+{
+ "name": "mynet",
+ "cniVersion": "0.3.0",
+ "plugins": [
+ {
+ "type": "bridge",
+ "bridge": "mynet",
+ "ipMasq": true,
+ "isGateway": true,
+ "ipam": {
+ "type": "host-local",
+ "subnet": "10.244.10.0/24",
+ "routes": [
+ { "dst": "0.0.0.0/0" }
+ ]
+ }
+ },
+ {
+ "type": "tuning",
+ "sysctl": {
+ "net.core.somaxconn": "573"
+ }
+ }
+ ]
+}
+
--- /dev/null
+{
+ "cniVersion": "0.2.0",
+ "name": "mynet",
+ "type": "bridge",
+ "bridge": "cni0",
+ "isGateway": true,
+ "ipMasq": true,
+ "ipam": {
+ "type": "host-local",
+ "subnet": "10.22.0.0/16",
+ "routes": [
+ { "dst": "0.0.0.0/0" }
+ ]
+ }
+}
--- /dev/null
+{
+ "name": "mynet",
+ "cniVersion": "0.3.0",
+ "plugins": [
+ {
+ "type": "bridge",
+ "bridge": "mynet",
+ "ipMasq": true,
+ "isGateway": true,
+ "ipam": {
+ "type": "host-local",
+ "subnet": "10.244.10.0/24",
+ "routes": [
+ { "dst": "0.0.0.0/0" }
+ ]
+ }
+ },
+ {
+ "type": "portmap",
+ "capabilities": {"portMappings": true}
+ }
+ ]
+}
+
--- /dev/null
+{
+ "cniVersion": "0.3.0",
+ "name": "mynet",
+ "type": "bridge",
+ "bridge": "cni4",
+ "isGateway": true,
+ "ipam": {
+ "type": "host-local",
+ "subnet": "172.20.1.0/24",
+ "rangeStart": "172.20.1.1",
+ "rangeEnd": "172.20.1.254",
+ "routes": [
+ { "dst": "0.0.0.0/0" }
+ ]
+ }
+}
+
+
--- /dev/null
+{
+ "cniVersion": "0.3.0",
+ "name": "mynet6",
+ "type": "bridge",
+ "bridge": "cni6",
+ "ipam": {
+ "type": "host-local",
+ "subnet": "3ffe:ffff:0:01ff::/64",
+ "rangeStart": "3ffe:ffff:0:01ff::0010",
+ "rangeEnd": "3ffe:ffff:0:01ff::0020",
+ "routes": [
+ { "dst": "3ffe:ffff:0:01ff::1/64" }
+ ]
+ }
+}
+
+
--- /dev/null
+{
+ "cniVersion": "0.3.0",
+ "name": "mynet14",
+ "type": "bridge",
+ "bridge": "cni4",
+ "isGateway": true,
+ "ipam": {
+ "type": "host-local",
+ "subnet": "172.20.1.0/24",
+ "rangeStart": "172.20.1.1",
+ "rangeEnd": "172.20.1.254",
+ "routes": [
+ { "dst": "0.0.0.0/0" }
+ ]
+ }
+}
+
+
--- /dev/null
+#/bin/bash
+export DEBUG=1
+export NETCONFPATH=/home/mcc/go/src/github.com/containernetworking/cni/cnitool
+export CNI_PATH=/home/mcc/go/src/github.com/containernetworking/cni/bin/
+# export NETCONFPATH=${NETCONFPATH-/etc/cni/net.d}
+# export CNI_COMMAND=ADD
+# export CNI_NETNS=/var/run/netns/mcc-cni-test14
+# export CNI_CONTAINERID=mcc-cni-test14
+
+# export PATH=$CNI_PATH:$PATH
+# export CNI_IFNAME=eth1
+
+export CAP_ARGS='{
+ "portMappings": [
+ {
+ "hostPort": 9090,
+ "containerPort": 80,
+ "protocol": "tcp",
+ "hostIP": "127.0.0.1"
+ }
+ ]
+}'
+
+# ip netns add test0
+
+./cnitool add natnet /var/run/netns/test0
+
+
--- /dev/null
+#/bin/bash
+export DEBUG=1
+export NETCONFPATH=/home/mcc/go/src/github.com/containernetworking/cni/cnitool
+export CNI_PATH=/home/mcc/go/src/github.com/containernetworking/cni/bin/
+# export NETCONFPATH=${NETCONFPATH-/etc/cni/net.d}
+# export CNI_COMMAND=ADD
+# export CNI_NETNS=/var/run/netns/mcc-cni-test14
+# export CNI_CONTAINERID=mcc-cni-test14
+
+# export PATH=$CNI_PATH:$PATH
+# export CNI_IFNAME=eth1
+
+
+export CAP_ARGS='{
+ "tunings": [
+ {
+ "net.core.somaxconn": "569"
+ }
+ ]
+}'
+
+# ip netns add test0
+
+./cnitool add tunenet /var/run/netns/test0
+
+
--- /dev/null
+#/bin/bash
+export DEBUG=1
+export NETCONFPATH=/home/mcc/go/src/github.com/containernetworking/cni/cnitool
+export CNI_PATH=/home/mcc/go/src/github.com/containernetworking/cni/bin/
+# export NETCONFPATH=${NETCONFPATH-/etc/cni/net.d}
+# export CNI_COMMAND=ADD
+# export CNI_NETNS=/var/run/netns/mcc-cni-test14
+# export CNI_CONTAINERID=mcc-cni-test14
+
+# export PATH=$CNI_PATH:$PATH
+# export CNI_IFNAME=eth1
+
+# ip netns add test0
+
+./cnitool add tunenet2 /var/run/netns/test0
+
+
--- /dev/null
+#/bin/bash
+export DEBUG=1
+export NETCONFPATH=/home/mcc/go/src/github.com/containernetworking/cni/cnitool
+export CNI_PATH=/home/mcc/go/src/github.com/containernetworking/cni/bin/
+# export NETCONFPATH=${NETCONFPATH-/etc/cni/net.d}
+# export CNI_COMMAND=ADD
+# export CNI_NETNS=/var/run/netns/mcc-cni-test14
+# export CNI_CONTAINERID=mcc-cni-test14
+
+# export PATH=$CNI_PATH:$PATH
+# export CNI_IFNAME=eth1
+
+export CAP_ARGS='{
+ "portMappings": [
+ {
+ "hostPort": 9090,
+ "containerPort": 80,
+ "protocol": "tcp",
+ "hostIP": "127.0.0.1"
+ }
+ ]
+}'
+
+# ip netns add test0
+
+./cnitool add mynet14 /var/run/netns/test0
+
+
--- /dev/null
+#/bin/bash
+export DEBUG=1
+export NETCONFPATH=/home/mcc/go/src/github.com/containernetworking/cni/cnitool
+export CNI_PATH=/home/mcc/go/src/github.com/containernetworking/plugins/bin
+
+export CAP_ARGS='{
+ "advertise": [
+ {
+ "myAwesomeFlag": "true",
+ "anotherAwesomeArg": "172.19.0.1"
+ }
+ ]
+}'
+
+./cnitool del anycast /var/run/netns/test0
+
+
--- /dev/null
+#/bin/bash
+export DEBUG=1
+export NETCONFPATH=/home/mcc/go/src/github.com/containernetworking/cni/cnitool
+export CNI_PATH=/home/mcc/go/src/github.com/containernetworking/cni/bin/
+# export NETCONFPATH=${NETCONFPATH-/etc/cni/net.d}
+# export CNI_COMMAND=ADD
+# export CNI_NETNS=/var/run/netns/mcc-cni-test14
+# export CNI_CONTAINERID=mcc-cni-test14
+
+# export PATH=$CNI_PATH:$PATH
+# export CNI_IFNAME=eth1
+
+export CAP_ARGS='{
+ "portMappings": [
+ {
+ "hostPort": 9090,
+ "containerPort": 80,
+ "protocol": "tcp",
+ "hostIP": "127.0.0.1"
+ }
+ ]
+}'
+
+# ip netns add test0
+
+./cnitool del natnet /var/run/netns/test0
+
+
--- /dev/null
+#/bin/bash
+export DEBUG=1
+export NETCONFPATH=/home/mcc/go/src/github.com/containernetworking/cni/cnitool
+export CNI_PATH=/home/mcc/go/src/github.com/containernetworking/cni/bin/
+# export NETCONFPATH=${NETCONFPATH-/etc/cni/net.d}
+# export CNI_COMMAND=ADD
+# export CNI_NETNS=/var/run/netns/mcc-cni-test14
+# export CNI_CONTAINERID=mcc-cni-test14
+
+# export PATH=$CNI_PATH:$PATH
+# export CNI_IFNAME=eth1
+
+
+export CAP_ARGS='{
+ "tunings": [
+ {
+ "net.core.somaxconn": "569"
+ }
+ ]
+}'
+
+# ip netns add test0
+
+./cnitool del tunenet /var/run/netns/test0
+
+
--- /dev/null
+#/bin/bash
+export DEBUG=1
+export NETCONFPATH=/home/mcc/go/src/github.com/containernetworking/cni/cnitool
+export CNI_PATH=/home/mcc/go/src/github.com/containernetworking/cni/bin/
+# export NETCONFPATH=${NETCONFPATH-/etc/cni/net.d}
+# export CNI_COMMAND=ADD
+# export CNI_NETNS=/var/run/netns/mcc-cni-test14
+# export CNI_CONTAINERID=mcc-cni-test14
+
+# export PATH=$CNI_PATH:$PATH
+# export CNI_IFNAME=eth1
+
+# ip netns add test0
+
+./cnitool del tunenet2 /var/run/netns/test0
+
+
--- /dev/null
+#/bin/bash
+export DEBUG=1
+export NETCONFPATH=/home/mcc/go/src/github.com/containernetworking/cni/cnitool
+export CNI_PATH=/home/mcc/go/src/github.com/containernetworking/cni/bin/
+# export NETCONFPATH=${NETCONFPATH-/etc/cni/net.d}
+# export CNI_COMMAND=ADD
+# export CNI_NETNS=/var/run/netns/mcc-cni-test14
+# export CNI_CONTAINERID=mcc-cni-test14
+
+# export PATH=$CNI_PATH:$PATH
+# export CNI_IFNAME=eth1
+
+export CAP_ARGS='{
+ "portMappings": [
+ {
+ "hostPort": 9090,
+ "containerPort": 80,
+ "protocol": "tcp",
+ "hostIP": "127.0.0.1"
+ }
+ ]
+}'
+
+# ip netns add test0
+
+./cnitool del mynet14 /var/run/netns/test0
+
+
--- /dev/null
+
+http://feisky.xyz/sdn/container/cni/cni-chain.html
+
+# cat /root/mynet.conflist
+{
+ "name": "mynet",
+ "cniVersion": "0.3.0",
+ "plugins": [
+ {
+ "type": "bridge",
+ "bridge": "mynet",
+ "ipMasq": true,
+ "isGateway": true,
+ "ipam": {
+ "type": "host-local",
+ "subnet": "10.244.10.0/24",
+ "routes": [
+ { "dst": "0.0.0.0/0" }
+ ]
+ }
+ },
+ {
+ "type": "portmap",
+ "capabilities": {"portMappings": true}
+ }
+ ]
+}
+
+
+# export CAP_ARGS='{
+ "portMappings": [
+ {
+ "hostPort": 9090,
+ "containerPort": 80,
+ "protocol": "tcp",
+ "hostIP": "127.0.0.1"
+ }
+ ]
+}'
+
+
+# ip netns add test
+# CNI_PATH=/opt/cni/bin NETCONFPATH=/root ./cnitool add mynet /var/run/netns/test
+{
+ "interfaces": [
+ {
+ "name": "mynet",
+ "mac": "0a:58:0a:f4:0a:01"
+ },
+ {
+ "name": "veth2cfb1d64",
+ "mac": "4a:dc:1f:b7:56:b1"
+ },
+ {
+ "name": "eth0",
+ "mac": "0a:58:0a:f4:0a:07",
+ "sandbox": "/var/run/netns/test"
+ }
+ ],
+ "ips": [
+ {
+ "version": "4",
+ "interface": 2,
+ "address": "10.244.10.7/24",
+ "gateway": "10.244.10.1"
+ }
+ ],
+ "routes": [
+ {
+ "dst": "0.0.0.0/0"
+ }
+ ],
+ "dns": {}
+}
+
+
+# CNI_PATH=/opt/cni/bin NETCONFPATH=/root ./cnitool del mynet /var/run/netns/test
--- /dev/null
+{
+ "name": "mynet-ex",
+ "cniVersion": "0.3.0",
+ "plugins": [
+ {
+ "type": "bridge",
+ "bridge": "mynet",
+ "ipMasq": true,
+ "isGateway": true,
+ "ipam": {
+ "type": "host-local",
+ "subnet": "10.244.10.0/24",
+ "routes": [
+ { "dst": "0.0.0.0/0" }
+ ]
+ }
+ },
+ {
+ "type": "tuning",
+ "capabilities": {"tuning": true}
+ }
+ ]
+}
+
--- /dev/null
+{
+ "name": "natnet",
+ "cniVersion": "0.3.0",
+ "plugins": [
+ {
+ "type": "bridge",
+ "bridge": "cni4",
+ "isGateway": true,
+ "ipam": {
+ "type": "host-local",
+ "subnet": "172.20.1.0/24",
+ "rangeStart": "172.20.1.1",
+ "rangeEnd": "172.20.1.254",
+ "routes": [
+ { "dst": "0.0.0.0/0" }
+ ]
+ }
+ },
+ {
+ "type": "portmap",
+ "capabilities": {"portMappings": true}
+ }
+ ]
+}
+
--- /dev/null
+{
+ "name": "tunenet",
+ "cniVersion": "0.3.0",
+ "plugins": [
+ {
+ "type": "bridge",
+ "bridge": "mynet",
+ "ipMasq": true,
+ "isGateway": true,
+ "ipam": {
+ "type": "host-local",
+ "subnet": "10.244.10.0/24",
+ "routes": [
+ { "dst": "0.0.0.0/0" }
+ ]
+ }
+ },
+ {
+ "type": "tuning",
+ "capabilities": {
+ "tunings": true
+ }
+ }
+ ]
+}
+
--- /dev/null
+{
+ "name": "tunenet2",
+ "cniVersion": "0.3.0",
+ "plugins": [
+ {
+ "type": "bridge",
+ "bridge": "mynet",
+ "ipMasq": true,
+ "isGateway": true,
+ "ipam": {
+ "type": "host-local",
+ "subnet": "10.244.10.0/24",
+ "routes": [
+ { "dst": "0.0.0.0/0" }
+ ]
+ }
+ },
+ {
+ "type": "tuning",
+ "sysctl": {
+ "net.core.somaxconn": "777"
+ }
+ }
+ ]
+}
+
--- /dev/null
+ #/bin/bash
+export DEBUG=1
+export NETCONFPATH=/etc/cni/net.d/
+export CNI_PATH=/home/mcc/go/src/github.com/containernetworking/cni/bin/
+##export CNI_PATH=/home/mcc/go2/src/stash.verizon.com/cni/bin
+export NETCONFPATH=${NETCONFPATH-/etc/cni/net.d}
+export CNI_COMMAND=ADD
+export CNI_NETNS=/var/run/netns/mcc-cni-test14
+export CNI_CONTAINERID=mcc-cni-test14
+
+export PATH=$CNI_PATH:$PATH
+export CNI_IFNAME=eth1
+
+export MCCVAL="Jamal Env Value"
+
+# sudo -E /home/mcambria/github/cni-master/scripts/exec-plugins.sh add mcc-cni-test0 /var/run/netns/mcc-cni-test0
+
+bin/bridge < 01-tuning.conf
+
--- /dev/null
+ #/bin/bash
+export DEBUG=1
+export NETCONFPATH=/etc/cni/net.d/
+export CNI_PATH=/home/mcc/go/src/github.com/containernetworking/cni/bin/
+##export CNI_PATH=/home/mcc/go2/src/stash.verizon.com/cni/bin
+export NETCONFPATH=${NETCONFPATH-/etc/cni/net.d}
+export CNI_COMMAND=DEL
+export CNI_NETNS=/var/run/netns/mcc-cni-test14
+export CNI_CONTAINERID=mcc-cni-test14
+
+export PATH=$CNI_PATH:$PATH
+export CNI_IFNAME=eth1
+
+export MCCVAL="Jamal Env Value"
+
+# sudo -E /home/mcambria/github/cni-master/scripts/exec-plugins.sh add mcc-cni-test0 /var/run/netns/mcc-cni-test0
+
+bin/bridge < 01-tuning.conf
+
--- /dev/null
+ #/bin/bash
+export DEBUG=1
+export NETCONFPATH=/etc/cni/net.d/
+export CNI_PATH=/home/mcc/go/src/github.com/containernetworking/cni/bin/
+##export CNI_PATH=/home/mcc/go2/src/stash.verizon.com/cni/bin
+export NETCONFPATH=${NETCONFPATH-/etc/cni/net.d}
+export CNI_COMMAND=ADD
+export CNI_NETNS=/var/run/netns/mcc-cni-test14
+export CNI_CONTAINERID=mcc-cni-test14
+
+export PATH=$CNI_PATH:$PATH
+export CNI_IFNAME=eth1
+
+export MCCVAL="Jamal Env Value"
+
+# sudo -E /home/mcambria/github/cni-master/scripts/exec-plugins.sh add mcc-cni-test0 /var/run/netns/mcc-cni-test0
+
+bin/bridge < 14-mynet.conf
+
--- /dev/null
+ #/bin/bash
+export DEBUG=1
+export NETCONFPATH=/etc/cni/net.d/
+export CNI_PATH=/home/mcc/go/src/github.com/containernetworking/cni/bin/
+##export CNI_PATH=/home/mcc/go2/src/stash.verizon.com/cni/bin
+export NETCONFPATH=${NETCONFPATH-/etc/cni/net.d}
+export CNI_COMMAND=DEL
+export CNI_NETNS=/var/run/netns/mcc-cni-test14
+export CNI_CONTAINERID=mcc-cni-test14
+
+export PATH=$CNI_PATH:$PATH
+export CNI_IFNAME=eth1
+
+export MCCVAL="Jamal Env Value"
+
+# sudo -E /home/mcambria/github/cni-master/scripts/exec-plugins.sh add mcc-cni-test0 /var/run/netns/mcc-cni-test0
+
+bin/bridge < 14-mynet.conf
+
--- /dev/null
+ #/bin/bash
+export DEBUG=1
+export NETCONFPATH=/etc/cni/net.d/
+export CNI_PATH=/home/mcc/go/src/github.com/containernetworking/cni/bin/
+##export CNI_PATH=/home/mcc/go2/src/stash.verizon.com/cni/bin
+export NETCONFPATH=${NETCONFPATH-/etc/cni/net.d}
+export CNI_COMMAND=ADD
+export CNI_NETNS=/var/run/netns/mcc-cni-test14
+export CNI_CONTAINERID=mcc-cni-test14
+
+export PATH=$CNI_PATH:$PATH
+export CNI_IFNAME=eth1
+
+export MCCVAL="Jamal Env Value"
+
+# sudo -E /home/mcambria/github/cni-master/scripts/exec-plugins.sh add mcc-cni-test0 /var/run/netns/mcc-cni-test0
+
+bin/bridge < 14-mynet.conf
+
--- /dev/null
+ #/bin/bash
+export DEBUG=1
+export NETCONFPATH=/etc/cni/net.d/
+export CNI_PATH=/home/mcc/go/src/github.com/containernetworking/cni/bin/
+##export CNI_PATH=/home/mcc/go2/src/stash.verizon.com/cni/bin
+export NETCONFPATH=${NETCONFPATH-/etc/cni/net.d}
+export CNI_COMMAND=ADD
+export CNI_NETNS=/var/run/netns/mcc-cni-test16
+export CNI_CONTAINERID=mcc-cni-test16
+
+export PATH=$CNI_PATH:$PATH
+export CNI_IFNAME=eth1
+
+export MCCVAL="Jamal Env Value"
+
+# sudo -E /home/mcambria/github/cni-master/scripts/exec-plugins.sh add mcc-cni-test0 /var/run/netns/mcc-cni-test0
+
+bin/bridge < 16-mynet.conf
+
--- /dev/null
+ #/bin/bash
+export DEBUG=1
+export NETCONFPATH=/etc/cni/net.d/
+export CNI_PATH=/home/mcc/go/src/github.com/containernetworking/cni/bin/
+##export CNI_PATH=/home/mcc/go2/src/stash.verizon.com/cni/bin
+export NETCONFPATH=${NETCONFPATH-/etc/cni/net.d}
+export CNI_COMMAND=DEL
+export CNI_NETNS=/var/run/netns/mcc-cni-test16
+export CNI_CONTAINERID=mcc-cni-test16
+
+export PATH=$CNI_PATH:$PATH
+export CNI_IFNAME=eth1
+
+export MCCVAL="Jamal Env Value"
+
+# sudo -E /home/mcambria/github/cni-master/scripts/exec-plugins.sh add mcc-cni-test0 /var/run/netns/mcc-cni-test0
+
+bin/bridge < 16-mynet.conf
+
--- /dev/null
+ #/bin/bash
+export DEBUG=1
+export NETCONFPATH=/etc/cni/net.d/
+export CNI_PATH=/home/mcc/go/src/github.com/containernetworking/cni/bin/
+##export CNI_PATH=/home/mcc/go2/src/stash.verizon.com/cni/bin
+export NETCONFPATH=${NETCONFPATH-/etc/cni/net.d}
+export CNI_COMMAND=ADD
+export CNI_NETNS=/var/run/netns/mcc-cni-test1
+export CNI_CONTAINERID=mcc-cni-test1
+
+export PATH=$CNI_PATH:$PATH
+export CNI_IFNAME=eth1
+
+export MCCVAL="Jamal Env Value"
+
+# sudo -E /home/mcambria/github/cni-master/scripts/exec-plugins.sh add mcc-cni-test0 /var/run/netns/mcc-cni-test0
+
+bridge < 14-mynet.conf
+