-
Notifications
You must be signed in to change notification settings - Fork 17
Examples
Tomofumi Hayashi edited this page Apr 14, 2017
·
10 revisions
koko
runs at container hosts (not inside container), create interface (vxlan or veth) and put it in container namespace.
koko
supports following scenarios.
# Config veth for Docker containers
./koko -d <container>:<linkname>[:<ipaddr/mask>] \
-d <container>:<linkname>[:<ipaddr>/<prefixlen>]
<container>: Docker's container identifier (CONTAINER ID or name)
<linkname>: veth link name
(optional) <ipaddr>/<prefixlen>: IPv4 address with netmask (e.g. 192.168.1.1/24)
# Config veth for netns
./koko -n <netns name>:<linkname>[:<ipaddr/mask>] \
-n <netns name>:<linkname>[:<ipaddr>/<prefixlen>]
<netns name>: netns name that is given by 'ip netns' command
<linkname>: veth link name
(optional) <ipaddr>/<prefixlen>: IPv4 address with netmask (e.g. 192.168.1.1/24)
# Config veth for Docker containers
./koko -d <container>:<linkname>[:<ipaddr/mask>] \
-n <netns name>:<linkname>[:<ipaddr>/<prefixlen>]
<container>: Docker's container identifier (CONTAINER ID or name)
<linkname>: veth link name
<netns name>: netns name that is given by 'ip netns' command
(optional) <ipaddr>/<prefixlen>: IPv4 address with netmask (e.g. 192.168.1.1/24)
Following commands must be executed both container hosts to connect between two containers.
# Config vxlan for Docker container
./koko -d <container>:<linkname>[:<ipaddr/mask>] \
-x <parent IF>:<remote IP>:<vxlan id>
<container>: Docker's container identifier (CONTAINER ID or name)
<linkname>: veth link name
(optional) <ipaddr>/<prefixlen>: IPv4 address with netmask (e.g. 192.168.1.1/24)
<parent IF>: Egress IF name for vxlan (e.g. eth0)
<remote IP>: Unicast destination IP address for endpoint
<vxlan id>: vxlan id
Following commands must be executed both container hosts to connect between two containers.
# Config vxlan with IPv4 addr for netns
./koko -n <netns name>:<linkname>[:<ipaddr/mask>] \
-x <parent IF>:<remote IP>:<vxlan id>
<netns name>: netns name that is given by 'ip netns' command
<linkname>: veth link name
(optional) <ipaddr>/<prefixlen>: IPv4 address with netmask (e.g. 192.168.1.1/24)
<parent IF>: Egress IF name for vxlan (e.g. eth0)
<remote IP>: Unicast destination IP address for endpoint
<vxlan id>: vxlan id
For each container hosts, execute koko
with above (Docker<->vxlan and netns<->vxlan)