From 3abe79333bc4fc9afefcc8333e4894279559cd1c Mon Sep 17 00:00:00 2001 From: mi2428 Date: Wed, 27 Feb 2019 11:30:47 +0900 Subject: [PATCH] Attached containers directly to the host's network namespace (fix #1) :wrench: Signed-off-by: mi2428 --- 4000_mgmt.conf | 2 +- 4010_noc-private.conf | 2 +- 4030_camp-guest.conf | 2 +- 4031_camp-guest-nofw.conf | 2 +- 4032_camp-guest-isp.conf | 2 +- Makefile | 10 +--------- docker-compose.yml | 36 +++++------------------------------- 7 files changed, 11 insertions(+), 45 deletions(-) diff --git a/4000_mgmt.conf b/4000_mgmt.conf index 132e737..83afb49 100644 --- a/4000_mgmt.conf +++ b/4000_mgmt.conf @@ -2,7 +2,7 @@ "Dhcp4": { "interfaces-config": { "interfaces": [ - "*" + "ens160" ], "dhcp-socket-type": "raw" }, diff --git a/4010_noc-private.conf b/4010_noc-private.conf index 5a9c9ed..a4ff652 100644 --- a/4010_noc-private.conf +++ b/4010_noc-private.conf @@ -2,7 +2,7 @@ "Dhcp4": { "interfaces-config": { "interfaces": [ - "*" + "ens161" ], "dhcp-socket-type": "raw" }, diff --git a/4030_camp-guest.conf b/4030_camp-guest.conf index 44a8547..7aa488e 100644 --- a/4030_camp-guest.conf +++ b/4030_camp-guest.conf @@ -2,7 +2,7 @@ "Dhcp4": { "interfaces-config": { "interfaces": [ - "*" + "ens256" ], "dhcp-socket-type": "raw" }, diff --git a/4031_camp-guest-nofw.conf b/4031_camp-guest-nofw.conf index d197f3f..b376428 100644 --- a/4031_camp-guest-nofw.conf +++ b/4031_camp-guest-nofw.conf @@ -2,7 +2,7 @@ "Dhcp4": { "interfaces-config": { "interfaces": [ - "*" + "ens192" ], "dhcp-socket-type": "raw" }, diff --git a/4032_camp-guest-isp.conf b/4032_camp-guest-isp.conf index b07728c..f693913 100644 --- a/4032_camp-guest-isp.conf +++ b/4032_camp-guest-isp.conf @@ -2,7 +2,7 @@ "Dhcp4": { "interfaces-config": { "interfaces": [ - "*" + "ens224" ], "dhcp-socket-type": "raw" }, diff --git a/Makefile b/Makefile index e113888..72227ba 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,5 @@ .PHONY: default -default: init run log - -.PHONY: init -init: - docker network create -d bridge -o parent=ens160 mgmt - docker network create -d bridge -o parent=ens161 noc-private - docker network create -d bridge -o parent=ens192 camp-guest-nofw - docker network create -d bridge -o parent=ens224 camp-guest-isp - docker network create -d bridge -o parent=ens256 camp-guest +default: run log .PHONY: run run: diff --git a/docker-compose.yml b/docker-compose.yml index edb9021..68541c9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,8 +10,7 @@ services: - ./4000_mgmt.conf:/etc/kea/kea-dhcp4.conf:ro ports: - 10.0.100.0:67:67 - networks: - vid4000: + network_mode: host kea-dhcp-noc-private: # build: . @@ -22,8 +21,7 @@ services: - ./4010_noc-private.conf:/etc/kea/kea-dhcp4.conf:ro ports: - 203.178.156.66:67:67 - networks: - vid4010: + network_mode: host kea-dhcp-cmap-guest: # build: . @@ -34,8 +32,7 @@ services: - ./4030_camp-guest.conf:/etc/kea/kea-dhcp4.conf:ro ports: - 203.178.158.2:67:67 - networks: - vid4030: + network_mode: host kea-dhcp-cmap-guest-nofw: # build: . @@ -46,8 +43,7 @@ services: - ./4031_camp-guest-nofw.conf:/etc/kea/kea-dhcp4.conf:ro ports: - 203.178.157.2:67:67 - networks: - vid4031: + network_mode: host kea-dhcp-cmap-guest-isp: # build: . @@ -58,26 +54,4 @@ services: - ./4032_camp-guest-isp.conf:/etc/kea/kea-dhcp4.conf:ro ports: - 10.0.32.2:67:67 - networks: - vid4032: - -networks: - vid4000: - external: - name: mgmt - - vid4010: - external: - name: noc-private - - vid4030: - external: - name: camp-guest - - vid4031: - external: - name: camp-guest-nofw - - vid4032: - external: - name: camp-guest-isp + network_mode: host