Read the following article to learn what is CNI
[CNI] Bridge Network In Docker
[CNI] Container Network Interface Introduction
[CNI] Write A CNI Plugin By Golang
A example repository about how to write your own CNI (Container Network Interface) plugin.
To build the CNI binary
$ vagrant up
$ vagrant ssh
$ cd $GOPATH/src/github.com/hwchiu/CNI_Tutorial_2018
$ go build .
Setup a netns and use the CNI to handle the IP address
$ ip netns add ns1
Execute a CNI:
$ sh test.sh
$ brctl show
$ ip netns exec ns1 ifconfig -a
Delete a netns:
$ ip netns del ns1
Delete a bridge:
$ ifconfig test down
$ brctl delbr test