From: Michael C Cambria Date: Thu, 18 May 2017 19:55:33 +0000 (+0000) Subject: Learning about cnitool and chained plugins X-Git-Url: https://git.halfball.org/?a=commitdiff_plain;h=db531c02731cb535a0a03e1b0d0f697fa386fbbb;p=cni.git Learning about cnitool and chained plugins --- diff --git a/01-tuning.conf b/01-tuning.conf new file mode 100644 index 0000000..82daa90 --- /dev/null +++ b/01-tuning.conf @@ -0,0 +1,26 @@ +{ + "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" + } + } + ] +} + diff --git a/10-mynet.conf b/10-mynet.conf new file mode 100644 index 0000000..c8234ce --- /dev/null +++ b/10-mynet.conf @@ -0,0 +1,15 @@ +{ + "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" } + ] + } +} diff --git a/14-chain.conf b/14-chain.conf new file mode 100644 index 0000000..b5e6af8 --- /dev/null +++ b/14-chain.conf @@ -0,0 +1,24 @@ +{ + "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} + } + ] +} + diff --git a/14-mynet.conf b/14-mynet.conf new file mode 100644 index 0000000..c14be09 --- /dev/null +++ b/14-mynet.conf @@ -0,0 +1,18 @@ +{ + "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" } + ] + } +} + + diff --git a/16-mynet.conf b/16-mynet.conf new file mode 100644 index 0000000..e27b874 --- /dev/null +++ b/16-mynet.conf @@ -0,0 +1,17 @@ +{ + "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" } + ] + } +} + + diff --git a/cnitool/14-mynet.conf b/cnitool/14-mynet.conf new file mode 100644 index 0000000..7738ab2 --- /dev/null +++ b/cnitool/14-mynet.conf @@ -0,0 +1,18 @@ +{ + "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" } + ] + } +} + + diff --git a/cnitool/cnitool b/cnitool/cnitool new file mode 100755 index 0000000..5d7c747 Binary files /dev/null and b/cnitool/cnitool differ diff --git a/cnitool/mcc-add-nat.sh b/cnitool/mcc-add-nat.sh new file mode 100755 index 0000000..762bd9e --- /dev/null +++ b/cnitool/mcc-add-nat.sh @@ -0,0 +1,28 @@ +#/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 + + diff --git a/cnitool/mcc-add-tuning.sh b/cnitool/mcc-add-tuning.sh new file mode 100755 index 0000000..b012c19 --- /dev/null +++ b/cnitool/mcc-add-tuning.sh @@ -0,0 +1,26 @@ +#/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 + + diff --git a/cnitool/mcc-add-tuning2.sh b/cnitool/mcc-add-tuning2.sh new file mode 100755 index 0000000..a8dc94b --- /dev/null +++ b/cnitool/mcc-add-tuning2.sh @@ -0,0 +1,17 @@ +#/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 + + diff --git a/cnitool/mcc-add.sh b/cnitool/mcc-add.sh new file mode 100755 index 0000000..41aa638 --- /dev/null +++ b/cnitool/mcc-add.sh @@ -0,0 +1,28 @@ +#/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 + + diff --git a/cnitool/mcc-del-anycast.sh b/cnitool/mcc-del-anycast.sh new file mode 100755 index 0000000..7cbb9c5 --- /dev/null +++ b/cnitool/mcc-del-anycast.sh @@ -0,0 +1,17 @@ +#/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 + + diff --git a/cnitool/mcc-del-nat.sh b/cnitool/mcc-del-nat.sh new file mode 100755 index 0000000..9c73b5f --- /dev/null +++ b/cnitool/mcc-del-nat.sh @@ -0,0 +1,28 @@ +#/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 + + diff --git a/cnitool/mcc-del-tuning.sh b/cnitool/mcc-del-tuning.sh new file mode 100755 index 0000000..d4abb5f --- /dev/null +++ b/cnitool/mcc-del-tuning.sh @@ -0,0 +1,26 @@ +#/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 + + diff --git a/cnitool/mcc-del-tuning2.sh b/cnitool/mcc-del-tuning2.sh new file mode 100755 index 0000000..f1bbd71 --- /dev/null +++ b/cnitool/mcc-del-tuning2.sh @@ -0,0 +1,17 @@ +#/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 + + diff --git a/cnitool/mcc-del.sh b/cnitool/mcc-del.sh new file mode 100755 index 0000000..d032b96 --- /dev/null +++ b/cnitool/mcc-del.sh @@ -0,0 +1,28 @@ +#/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 + + diff --git a/cnitool/mcc-example.txt b/cnitool/mcc-example.txt new file mode 100644 index 0000000..1480fe1 --- /dev/null +++ b/cnitool/mcc-example.txt @@ -0,0 +1,77 @@ + +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 diff --git a/cnitool/mynet.conf b/cnitool/mynet.conf new file mode 100644 index 0000000..0c5827c --- /dev/null +++ b/cnitool/mynet.conf @@ -0,0 +1,24 @@ +{ + "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} + } + ] +} + diff --git a/cnitool/nat-mynet.conflist b/cnitool/nat-mynet.conflist new file mode 100644 index 0000000..e54ac83 --- /dev/null +++ b/cnitool/nat-mynet.conflist @@ -0,0 +1,25 @@ +{ + "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} + } + ] +} + diff --git a/cnitool/tunenet.conflist b/cnitool/tunenet.conflist new file mode 100644 index 0000000..4f23a7a --- /dev/null +++ b/cnitool/tunenet.conflist @@ -0,0 +1,26 @@ +{ + "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 + } + } + ] +} + diff --git a/cnitool/tunenet2.conflist b/cnitool/tunenet2.conflist new file mode 100644 index 0000000..57b6188 --- /dev/null +++ b/cnitool/tunenet2.conflist @@ -0,0 +1,26 @@ +{ + "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" + } + } + ] +} + diff --git a/mcc-01-tuning-add.sh b/mcc-01-tuning-add.sh new file mode 100755 index 0000000..e9da580 --- /dev/null +++ b/mcc-01-tuning-add.sh @@ -0,0 +1,19 @@ + #/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 + diff --git a/mcc-01-tuning-del.sh b/mcc-01-tuning-del.sh new file mode 100755 index 0000000..69f9000 --- /dev/null +++ b/mcc-01-tuning-del.sh @@ -0,0 +1,19 @@ + #/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 + diff --git a/mcc-14-manual-add.sh b/mcc-14-manual-add.sh new file mode 100755 index 0000000..eb3a5e8 --- /dev/null +++ b/mcc-14-manual-add.sh @@ -0,0 +1,19 @@ + #/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 + diff --git a/mcc-14-manual-del.sh b/mcc-14-manual-del.sh new file mode 100755 index 0000000..1d7695a --- /dev/null +++ b/mcc-14-manual-del.sh @@ -0,0 +1,19 @@ + #/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 + diff --git a/mcc-14-manual.sh b/mcc-14-manual.sh new file mode 100755 index 0000000..eb3a5e8 --- /dev/null +++ b/mcc-14-manual.sh @@ -0,0 +1,19 @@ + #/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 + diff --git a/mcc-16-manual-add.sh b/mcc-16-manual-add.sh new file mode 100755 index 0000000..e6e9cbc --- /dev/null +++ b/mcc-16-manual-add.sh @@ -0,0 +1,19 @@ + #/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 + diff --git a/mcc-16-manual-del.sh b/mcc-16-manual-del.sh new file mode 100755 index 0000000..6ddd7eb --- /dev/null +++ b/mcc-16-manual-del.sh @@ -0,0 +1,19 @@ + #/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 + diff --git a/mcc-manual-add.sh b/mcc-manual-add.sh new file mode 100644 index 0000000..46b8431 --- /dev/null +++ b/mcc-manual-add.sh @@ -0,0 +1,19 @@ + #/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 +