diff options
author | maride <maride@darknebu.la> | 2018-09-04 11:07:18 +0200 |
---|---|---|
committer | maride <maride@darknebu.la> | 2018-09-04 11:07:18 +0200 |
commit | 939ef7db9b3f209c4fa521a8d6ef4231ee397760 (patch) | |
tree | b5133ec3db5512d9cdc1c1e137bcbf6990baf9ac | |
parent | cbb1ab24a40b5e84adcd44a4d0d4d7fdd9f49f5f (diff) |
Un-hardcode network name, remove fixed IP block to avoid collision on the host system
-rw-r--r-- | src/access.go | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/access.go b/src/access.go index 34b2470..6f9cd73 100644 --- a/src/access.go +++ b/src/access.go @@ -13,6 +13,10 @@ import ( "time" ) +const( + vpnHostNetworkName = "vpnhostnet" +) + var vpnContainerID string var vpnNetworkID string var vpnHostNetworkID string @@ -107,14 +111,6 @@ func setupNetwork() (error) { if vpnNetworkID == "" { response, err := dockerCli.NetworkCreate(dockerCtx, VPNNetworkName, types.NetworkCreate{ Internal: true, - IPAM: &network.IPAM{ - Config: []network.IPAMConfig{ - { - Subnet: "10.13.37.0/24", - Gateway: "10.13.37.254", - }, - }, - }, }) if err != nil { @@ -132,7 +128,7 @@ func setupVPNHostNetwork() (error) { setupDockerCLI() if vpnHostNetworkID == "" { - response, err := dockerCli.NetworkCreate(dockerCtx, "vpnhostnet", types.NetworkCreate{ + response, err := dockerCli.NetworkCreate(dockerCtx, vpnHostNetworkName, types.NetworkCreate{ Internal: false, }) |