diff --git a/cni/azure-windows-swift-overlay-dualstack.conflist b/cni/azure-windows-swift-overlay-dualstack.conflist index cd5003c8d1..4b4e06e594 100644 --- a/cni/azure-windows-swift-overlay-dualstack.conflist +++ b/cni/azure-windows-swift-overlay-dualstack.conflist @@ -5,7 +5,6 @@ "plugins": [ { "type": "azure-vnet", - "mode": "bridge", "bridge": "azure0", "capabilities": { "portMappings": true, diff --git a/cni/azure-windows-swift-overlay.conflist b/cni/azure-windows-swift-overlay.conflist index cd5003c8d1..4b4e06e594 100644 --- a/cni/azure-windows-swift-overlay.conflist +++ b/cni/azure-windows-swift-overlay.conflist @@ -5,7 +5,6 @@ "plugins": [ { "type": "azure-vnet", - "mode": "bridge", "bridge": "azure0", "capabilities": { "portMappings": true, diff --git a/cni/azure-windows-swift.conflist b/cni/azure-windows-swift.conflist index 8f9fafee37..962a9cab69 100644 --- a/cni/azure-windows-swift.conflist +++ b/cni/azure-windows-swift.conflist @@ -5,7 +5,6 @@ "plugins": [ { "type": "azure-vnet", - "mode": "bridge", "bridge": "azure0", "executionMode": "v4swift", "capabilities": { diff --git a/cns/hnsclient/hnsclient_windows.go b/cns/hnsclient/hnsclient_windows.go index 58bf884b74..991e2c4908 100644 --- a/cns/hnsclient/hnsclient_windows.go +++ b/cns/hnsclient/hnsclient_windows.go @@ -30,7 +30,6 @@ const ( // HNS network types hnsL2Bridge = "l2bridge" - hnsL2Tunnel = "l2tunnel" // hcnSchemaVersionMajor indicates major version number for hcn schema hcnSchemaVersionMajor = 2 @@ -145,7 +144,7 @@ func CreateDefaultExtNetwork(networkType string) error { return nil } - if networkType != hnsL2Bridge && networkType != hnsL2Tunnel { + if networkType != hnsL2Bridge { return fmt.Errorf("Invalid hns network type %s", networkType) } diff --git a/cns/service/main.go b/cns/service/main.go index 20050c9a9b..f05b6df71a 100644 --- a/cns/service/main.go +++ b/cns/service/main.go @@ -244,7 +244,7 @@ var args = acn.ArgumentList{ { Name: acn.OptCreateDefaultExtNetworkType, Shorthand: acn.OptCreateDefaultExtNetworkTypeAlias, - Description: "Create default external network for windows platform with the specified type (l2bridge or l2tunnel)", + Description: "Create default external network for windows platform with the specified type (l2bridge)", Type: "string", DefaultValue: "", }, diff --git a/network/network_windows.go b/network/network_windows.go index 4d870827ca..ecd01149e2 100644 --- a/network/network_windows.go +++ b/network/network_windows.go @@ -24,7 +24,6 @@ import ( const ( // HNS network types. hnsL2bridge = "l2bridge" - hnsL2tunnel = "l2tunnel" CnetAddressSpace = "cnetAddressSpace" vEthernetAdapterPrefix = "vEthernet" baseDecimal = 10 @@ -113,6 +112,7 @@ func (nm *networkManager) newNetworkImplHnsV1(nwInfo *EndpointInfo, extIf *exter // Initialize HNS network. hnsNetwork := &hcsshim.HNSNetwork{ Name: nwInfo.NetworkID, + Type: hnsL2bridge, NetworkAdapterName: networkAdapterName, Policies: policy.SerializePolicies(policy.NetworkPolicy, nwInfo.NetworkPolicies, nil, false, false), } @@ -132,16 +132,6 @@ func (nm *networkManager) newNetworkImplHnsV1(nwInfo *EndpointInfo, extIf *exter vlanid = (int)(vlanPolicy.VLAN) } - // Set network mode. - switch nwInfo.Mode { - case opModeBridge: - hnsNetwork.Type = hnsL2bridge - case opModeTunnel: - hnsNetwork.Type = hnsL2tunnel - default: - return nil, errNetworkModeInvalid - } - // Populate subnets. for _, subnet := range nwInfo.Subnets { hnsSubnet := hcsshim.Subnet{ @@ -233,6 +223,7 @@ func (nm *networkManager) configureHcnNetwork(nwInfo *EndpointInfo, extIf *exter // Initialize HNS network. hcnNetwork := &hcn.HostComputeNetwork{ Name: nwInfo.NetworkID, + Type: hcn.L2Bridge Ipams: []hcn.Ipam{ { Type: hcnIpamTypeStatic, @@ -287,16 +278,6 @@ func (nm *networkManager) configureHcnNetwork(nwInfo *EndpointInfo, extIf *exter vlanid = (int)(vlanID) } - // Set network mode. - switch nwInfo.Mode { - case opModeBridge: - hcnNetwork.Type = hcn.L2Bridge - case opModeTunnel: - hcnNetwork.Type = hcn.L2Tunnel - default: - return nil, errNetworkModeInvalid - } - // AccelnetNIC flag: hcn.EnableIov(9216) - treat Delegated/FrontendNIC also the same as Accelnet // For L1VH with accelnet, hcn.DisableHostPort and hcn.EnableIov must be configured if nwInfo.NICType == cns.NodeNetworkInterfaceFrontendNIC {