Azure Operator Nexus에서 NNI에 ACL 만들기

Azure 운영자 Nexus에서 NNI(네트워크 간 상호 연결) Permit 수준의 ACL(액세스 제어 목록) 및 Deny 작업은 관리 VPN(가상 사설망)에서 SSH(Secure Shell) 액세스를 보호하는 데 도움이 됩니다. NNI 리소스를 만들기 전에 수신 및 송신 ACL을 만든 다음 NNI 페이로드에서 해당 ACL을 참조합니다. 네트워크 패브릭을 프로비전하기 전에 참조된 수신 및 송신 ACL을 만들어야 합니다.

다음은 NNI에서 ACL을 만들기 위한 대략적인 단계입니다.

  1. NNI 수신 및 송신 ACL을 만듭니다.
  2. 관리 NNI에서 Azure Resource Manager 리소스 참조를 업데이트합니다.
  3. NNI를 만들고 네트워크 패브릭을 프로비전합니다.

매개 변수 사용 지침

매개 변수 설명 예제 또는 범위
defaultAction 수행할 기본 작업입니다. 정의하지 않으면 트래픽이 허용됩니다. "defaultAction": "Permit"
resource-group 네트워크 패브릭의 리소스 그룹입니다. nfresourcegroup
resource-name ACL의 이름입니다. example-ingressACL
vlanGroups VLAN(가상 로컬 영역 네트워크) 그룹 목록입니다.
vlans 일치해야 하는 VLAN 목록입니다.
match-configurations 일치 구성의 이름입니다. example_acl. 공백 및 앰퍼샌드 문자(>)는 지원되지 않습니다.
matchConditions 일치해야 하는 조건입니다.
ttlValues TTL(Time to Live). 0-255
dscpMarking 일치해야 하는 DSCP(차별화된 서비스 코드 포인트) 표시입니다. 0-63
portCondition 일치해야 하는 포트 조건입니다.
portType 일치해야 하는 포트 형식입니다. 예: SourcePort 허용되는 값: DestinationPort, SourcePort.
protocolTypes 일치해야 하는 프로토콜입니다. [tcp, udp, range[1-2, 1, 2]]. 프로토콜 번호인 경우 범위 1-255여야 합니다.
vlanMatchCondition 일치해야 하는 VLAN 일치 조건입니다.
layer4Protocol 계층 4 프로토콜입니다. 또는 TCP UDP.이어야 합니다.
ipCondition 일치해야 하는 IP 조건입니다.
actions 일치 조건에 따라 수행할 작업입니다. 예: permit
configuration-type 인라인 또는 파일일 수 있는 구성 형식입니다. 현재 Azure Operator Nexus는 인라인만 지원합니다. 예: inline

또한 다음과 같은 제한 사항에 유의해야 합니다.

  • 인라인 포트 및 인라인 VLAN은 포트 또는 VLAN을 사용하여 azcli정의하는 정적 방법입니다.
  • portGroupNamesvlanGroupNames 포트 및 VLAN을 정의하는 동적 방법입니다.
  • 인라인 포트와 portGroupNames 함께는 허용되지 않습니다.
  • 인라인 VLAN과 vlanGroupNames 함께 허용되지 않습니다.
  • ipGroupNames 함께 ipPrefixValues 사용하면 허용되지 않습니다.
  • 송신 ACL은 IP 옵션, IP 길이, 조각, EtherType, DSCP 표시 또는 TTL 값을 지원하지 않습니다.
  • 수신 ACL은 EtherType 옵션을 지원하지 않습니다.

수신 ACL 만들기

수신 ACL을 만들려면 다음 Azure CLI 명령을 사용할 수 있습니다. 이 명령은 지정된 구성을 사용하여 수신 ACL을 만들고 예상 결과를 출력으로 제공합니다. 사용 사례에 필요한 대로 매개 변수를 조정합니다.

az networkfabric acl create
--resource-group "example-rg"
--location "eastus2euap"
--resource-name "example-Ipv4ingressACL"
--configuration-type "Inline"
--default-action "Permit"
--dynamic-match-configurations "[{ipGroups:[{name:'example-ipGroup',ipAddressType:IPv4,ipPrefixes:['10.20.3.1/20']}],vlanGroups:[{name:'example-vlanGroup',vlans:['20-30']}],portGroups:[{name:'example-portGroup',ports:['100-200']}]}]"
--match-configurations "[{matchConfigurationName:'example-match',sequenceNumber:123,ipAddressType:IPv4,matchConditions:[{etherTypes:['0x1'],fragments:['0xff00-0xffff'],ipLengths:['4094-9214'],ttlValues:[23],dscpMarkings:[32],portCondition:{flags:[established],portType:SourcePort,layer4Protocol:TCP,ports:['1-20']},protocolTypes:[TCP],vlanMatchCondition:{vlans:['20-30'],innerVlans:[30]},ipCondition:{type:SourceIP,prefixType:Prefix,ipPrefixValues:['10.20.20.20/12']}}],actions:[{type:Count,counterName:'example-counter'}]}]"

예상 출력

{
    "properties": {
        "lastSyncedTime": "2023-06-17T08:56:23.203Z",
        "configurationState": "Succeeded",
        "provisioningState": "Accepted",
        "administrativeState": "Enabled",
        "annotation": "annotation",
        "configurationType": "File",
        "aclsUrl": "https://ACL-Storage-URL",
        "matchConfigurations": [{
            "matchConfigurationName": "example-match",
            "sequenceNumber": 123,
            "ipAddressType": "IPv4",
            "matchConditions": [{
                "etherTypes": ["0x1"],
                "fragments": ["0xff00-0xffff"],
                "ipLengths": ["4094-9214"],
                "ttlValues": [23],
                "dscpMarkings": [32],
                "portCondition": {
                    "flags": ["established"],
                    "portType": "SourcePort",
                    "l4Protocol": "TCP",
                    "ports": ["1-20"],
                    "portGroupNames": ["example-portGroup"]
                },
                "protocolTypes": ["TCP"],
                "vlanMatchCondition": {
                    "vlans": ["20-30"],
                    "innerVlans": [30],
                    "vlanGroupNames": ["example-vlanGroup"]
                },
                "ipCondition": {
                    "type": "SourceIP",
                    "prefixType": "Prefix",
                    "ipPrefixValues": ["10.20.20.20/12"],
                    "ipGroupNames": ["example-ipGroup"]
                }
            }]
        }],
        "actions": [{
            "type": "Count",
            "counterName": "example-counter"
        }]
    },
    "tags": {
        "keyID": "KeyValue"
    },
    "location": "eastUs",
    "id": "/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/accessControlLists/acl",
    "name": "example-Ipv4ingressACL",
    "type": "microsoft.managednetworkfabric/accessControlLists",
    "systemData": {
        "createdBy": "email@address.com",
        "createdByType": "User",
        "createdAt": "2023-06-09T04:51:41.251Z",
        "lastModifiedBy": "UserId",
        "lastModifiedByType": "User",
        "lastModifiedAt": "2023-06-09T04:51:41.251Z"
    }
}

송신 ACL 만들기

송신 ACL을 만들려면 다음 Azure CLI 명령을 사용할 수 있습니다. 이 명령은 지정된 구성을 사용하여 송신 ACL을 만들고 예상 결과를 출력으로 제공합니다. 사용 사례에 필요한 대로 매개 변수를 조정합니다.

az networkfabric acl create
--resource-group "example-rg"
--location "eastus2euap"
--resource-name "example-Ipv4egressACL"
--configuration-type "File"
--acls-url "https://ACL-Storage-URL"
--default-action "Permit"
--dynamic-match-configurations "[{ipGroups:[{name:'example-ipGroup',ipAddressType:IPv4,ipPrefixes:['10.20.3.1/20']}],vlanGroups:[{name:'example-vlanGroup',vlans:['20-30']}],portGroups:[{name:'example-portGroup',ports:['100-200']}]}]"

예상 출력

{
    "properties": {
        "lastSyncedTime": "2023-06-17T08:56:23.203Z",
        "configurationState": "Succeeded",
        "provisioningState": "Accepted",
        "administrativeState": "Enabled",
        "annotation": "annotation",
        "configurationType": "File",
        "aclsUrl": "https://ACL-Storage-URL",
        "dynamicMatchConfigurations": [{
            "ipGroups": [{
                "name": "example-ipGroup",
                "ipAddressType": "IPv4",
                "ipPrefixes": ["10.20.3.1/20"]
            }],
            "vlanGroups": [{
                "name": "example-vlanGroup",
                "vlans": ["20-30"]
            }],
            "portGroups": [{
                "name": "example-portGroup",
                "ports": ["100-200"]
            }]
        }]
    },
    "tags": {
        "keyID": "KeyValue"
    },
    "location": "eastUs",
    "id": "/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/accessControlLists/acl",
    "name": "example-Ipv4egressACL",
    "type": "microsoft.managednetworkfabric/accessControlLists",
    "systemData": {
        "createdBy": "email@address.com",
        "createdByType": "User",
        "createdAt": "2023-06-09T04:51:41.251Z",
        "lastModifiedBy": "UserId",
        "lastModifiedByType": "User",
        "lastModifiedAt": "2023-06-09T04:51:41.251Z"
    }
}

Resource Manager 참조 업데이트

이 단계를 사용하면 NNI 리소스를 만드는 동안 ACL(참조가 제공된 경우 수신 및 송신)을 만들 수 있습니다. NNI를 만든 후 네트워크 패브릭을 프로비전하기 전에 NNI를 다시 배치할 수 있습니다.

  • ingressAclId: 수신 ACL에 대한 참조 ID입니다.
  • egressAclId: 송신 ACL에 대한 참조 ID입니다.

Resource Manager 리소스 ID를 가져오려면 사용 중인 구독의 리소스 그룹으로 이동합니다.

다음 명령은 제공된 수신 및 송신 ACL과 연결하여 NNI 리소스에 대한 Resource Manager 참조를 업데이트합니다. 사용 사례에 필요한 대로 매개 변수를 조정합니다.

az networkfabric nni create
--resource-group "example-rg"
--fabric "example-fabric"
--resource-name "example-nniwithACL"
--nni-type "CE"
--is-management-type "True"
--use-option-b "True"
--layer2-configuration "{interfaces:['/subscriptions/xxxxx-xxxx-xxxx-xxxx-xxxxx/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-networkDevice/networkInterfaces/example-interface'],mtu:1500}"
--option-b-layer3-configuration "{peerASN:28,vlanId:501,primaryIpv4Prefix:'10.18.0.124/30',secondaryIpv4Prefix:'10.18.0.128/30',primaryIpv6Prefix:'10:2:0:124::400/127',secondaryIpv6Prefix:'10:2:0:124::402/127'}"
--ingress-acl-id "/subscriptions/xxxxx-xxxx-xxxx-xxxx-xxxxx/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accesscontrollists/example-Ipv4ingressACL"
--egress-acl-id "/subscriptions/xxxxx-xxxx-xxxx-xxxx-xxxxx/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accesscontrollists/example-Ipv4egressACL"

ACL 세부 정보 표시

지정된 ACL의 세부 정보를 표시하려면 다음 명령을 사용합니다.

az networkfabric acl show --resource-group "example-rg" --resource-name "example-acl"

ACL 나열

지정된 리소스 그룹 내의 모든 ACL을 나열하려면 다음 명령을 사용합니다.

az networkfabric acl list --resource-group "ResourceGroupName"

ISD 외부 네트워크에서 ACL 만들기

다음 정보를 사용하여 ISD(격리할기본) 외부 네트워크에 대한 수신 및 송신 ACL을 만듭니다. 그런 다음 외부 네트워크에 대한 Resource Manager 리소스 참조를 업데이트합니다.

ISD 외부 네트워크에 대한 송신 ACL 만들기

제공된 구성을 사용하여 지정된 ISD 외부 네트워크에 대한 송신 ACL을 만들려면 다음 명령을 사용합니다. 사용 사례에 필요한 대로 매개 변수를 조정합니다.

az networkfabric acl create
--resource-group "example-rg"
--location "eastus2euap"
--resource-name "example-Ipv4egressACL"
--annotation "annotation"
--configuration-type "Inline"
--default-action "Deny"
--match-configurations "[{matchConfigurationName:'L3ISD_EXT_OPTA_EGRESS_ACL_IPV4_CE_PE',sequenceNumber:1110,ipAddressType:IPv4,matchConditions:[{ipCondition:{type:SourceIP,prefixType:Prefix,ipPrefixValues:['10.18.0.124/30','10.18.0.128/30','10.18.30.16/30','10.18.30.20/30']}},{ipCondition:{type:DestinationIP,prefixType:Prefix,ipPrefixValues:['10.18.0.124/30','10.18.0.128/30','10.18.30.16/30','10.18.30.20/30']}}],actions:[{type:Count}]}]"

예상 출력

실행이 성공하면 이 명령은 생성된 ACL에 대한 정보를 다음 형식으로 반환합니다. 이 출력에는 구성 및 상태에 대한 세부 정보가 포함됩니다.

{
    "administrativeState": "Disabled",
    "annotation": "annotation",
    "configurationState": "Succeeded",
    "configurationType": "Inline",
    "defaultAction": "Deny",
    "id": "/subscriptions/xxxxx-xxxx-xxxx-xxxx-xxxxx/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-Ipv4egressACL",
    "location": "eastus2euap",
    "matchConfigurations": [
        {
            "actions": [
                {
                    "type": "Count"
                }
            ],
            "ipAddressType": "IPv4",
            "matchConditions": [
                {
                    "ipCondition": {
                        "ipPrefixValues": [
                            "10.18.0.124/30",
                            "10.18.0.128/30",
                            "10.18.30.16/30",
                            "10.18.30.20/30"
                        ],
                        "prefixType": "Prefix",
                        "type": "SourceIP"
                    }
                },
                {
                    "ipCondition": {
                        "ipPrefixValues": [
                            "10.18.0.124/30",
                            "10.18.0.128/30",
                            "10.18.30.16/30",
                            "10.18.30.20/30"
                        ],
                        "prefixType": "Prefix",
                        "type": "DestinationIP"
                    }
                }
            ],
            "matchConfigurationName": "L3ISD_EXT_OPTA_EGRESS_ACL_IPV4_CE_PE",
            "sequenceNumber": 1110
        }
    ],
    "name": "example-Ipv4egressACL",
    "provisioningState": "Succeeded",
    "resourceGroup": "example-rg",
    "systemData": {
        "createdAt": "2023-09-11T10:20:20.2617941Z",
        "createdBy": "email@address.com",
        "createdByType": "User",
        "lastModifiedAt": "2023-09-11T10:20:20.2617941Z",
        "lastModifiedBy": "email@address.com",
        "lastModifiedByType": "User"
    },
    "type": "microsoft.managednetworkfabric/accesscontrollists"
}

ISD 외부 네트워크에 대한 수신 ACL 만들기

제공된 구성을 사용하여 지정된 ISD 외부 네트워크에 대한 수신 ACL을 만들려면 다음 명령을 사용합니다. 사용 사례에 필요한 대로 매개 변수를 조정합니다.

az networkfabric acl create
--resource-group "example-rg"
--location "eastus2euap"
--resource-name "example-Ipv4ingressACL"
--annotation "annotation"
--configuration-type "Inline"
--default-action "Deny"
--match-configurations "[{matchConfigurationName:'L3ISD_EXT_OPTA_INGRESS_ACL_IPV4_CE_PE',sequenceNumber:1110,ipAddressType:IPv4,matchConditions:[{ipCondition:{type:SourceIP,prefixType:Prefix,ipPrefixValues:['10.18.0.124/30','10.18.0.128/30','10.18.30.16/30','10.18.30.20/30']}},{ipCondition:{type:DestinationIP,prefixType:Prefix,ipPrefixValues:['10.18.0.124/30','10.18.0.128/30','10.18.30.16/30','10.18.30.20/30']}}],actions:[{type:Count}]}]"

예상 출력

실행이 성공하면 이 명령은 생성된 ACL에 대한 정보를 다음 형식으로 반환합니다. 이 출력에는 구성 및 상태에 대한 세부 정보가 포함됩니다.

{
    "administrativeState": "Disabled",
    "annotation": "annotation",
    "configurationState": "Succeeded",
    "configurationType": "Inline",
    "defaultAction": "Deny",
    "id": "/subscriptions/xxxxx-xxxx-xxxx-xxxx-xxxxx/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-Ipv4ingressACL",
    "location": "eastus2euap",
    "matchConfigurations": [
        {
            "actions": [
                {
                    "type": "Count"
                }
            ],
            "ipAddressType": "IPv4",
            "matchConditions": [
                {
                    "ipCondition": {
                        "ipPrefixValues": [
                            "10.18.0.124/30",
                            "10.18.0.128/30",
                            "10.18.30.16/30",
                            "10.18.30.20/30"
                        ],
                        "prefixType": "Prefix",
                        "type": "SourceIP"
                    }
                },
                {
                    "ipCondition": {
                        "ipPrefixValues": [
                            "10.18.0.124/30",
                            "10.18.0.128/30",
                            "10.18.30.16/30",
                            "10.18.30.20/30"
                        ],
                        "prefixType": "Prefix",
                        "type": "DestinationIP"
                    }
                }
            ],
            "matchConfigurationName": "L3ISD_EXT_OPTA_INGRESS_ACL_IPV4_CE_PE",
            "sequenceNumber": 1110
        }
    ],
    "name": "example-Ipv4ingressACL",
    "provisioningState": "Succeeded",
    "resourceGroup": "example-rg",
    "systemData": {
        "createdAt": "2023-09-11T10:20:20.2617941Z",
        "createdBy": "email@address.com",
        "createdByType": "User",
        "lastModifiedAt": "2023-09-11T10:27:27.2317467Z",
        "lastModifiedBy": "email@address.com",
        "lastModifiedByType": "User"
    },
    "type": "microsoft.managednetworkfabric/accesscontrollists"
}