Skip to content

Commit 0391ce2

Browse files
More examples in the IP prefix how-to guide.
1 parent 54cbf41 commit 0391ce2

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed

articles/operator-nexus/how-to-ip-prefixes.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,72 @@ To create an IP Prefix resource, follow these steps: 
6060
6161
6262
1. Create the IP Prefix resource using the azcli command. You can use the same command as in the previous step, or modify it as per your requirements.
63+
64+
3. Verify that the IP Prefix resource is created successfully. You can use the `az networkfabric ipprefix show` command to show the details of the IP Prefix resource. You can use the following example as a reference: 
65+
66+
```azurecli
67+
networkfabric ipprefix show \
68+
--resource-group myResourceGroup \
69+
--name myIpPrefix 
70+
```
71+
72+
In this example, `myResourceGroup` is the name of the resource group where you created the IP Prefix resource, and `myIpPrefix` is the name of the IP Prefix resource. 
73+
74+
The response should contain the properties and rules of the IP Prefix resource, such as the id, type, ipPrefixRules, location, name, provisioningState, resourceGroup, and tags. 
75+
76+
### Show an IP Prefix resource
77+
78+
To get the details of an existing IP Prefix resource by its ID or name, use the following command: 
79+
80+
```azurecli
81+
# Get the details of an IP Prefix resource by its name
82+
az networkfabric ipprefix show \
83+
--resource-group myResourceGroup \
84+
--name myIpPrefix
85+
```
86+
87+
The REST API response body for getting the details of an IP Prefix resource by its ID is as follows: 
88+
89+
```
90+
{
91+
"id": "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/myIpPrefix",
92+
"location": "eastus",
93+
"name": "myIpPrefix",
94+
"properties": {
95+
"ipPrefixRules": [
96+
{
97+
"action": "Permit",
98+
"condition": "EqualTo",
99+
"networkPrefix": "10.10.10.0/28",
100+
"sequenceNumber": 10
101+
},
102+
{
103+
"action": "Permit",
104+
"condition": "EqualTo",
105+
"networkPrefix": "20.20.20.0/24",
106+
"sequenceNumber": 20
107+
}
108+
]
109+
}
110+
}
111+
```
112+
113+
## Updating an IP Prefix Resource 
114+
115+
To update an IP Prefix resource, follow these steps: 
116+
117+
1. Specify the properties and rules of the IP Prefix resource that you want to update. You can use the same JSON template as in the previous section, or modify it as per your requirements. 
118+
119+
2. Update the IP Prefix resource using the Azure CLI command or the REST API method. You can use the following examples as a reference: 
120+
121+
```azurecli
122+
az networkfabric ipprefix update \
123+
-g "example-rg" \
124+
--resource-name "example-ipprefix" \
125+
--ip-prefix-rules "[{action:Permit,sequenceNumber:4155123341,networkPrefix:'10.10.10.10/30',condition:GreaterThanOrEqualTo,subnetMaskLength:10}]"
126+
```
127+
128+
In this example, `resourceGroupName` is the name of the resource group where you created the IP Prefix resource, `ipPrefixName` is the name of the IP Prefix resource, and the `--add` option adds a new rule to the ipPrefixRules property. The new rule denies routes with network prefix 30.30.30.0/24 and has a sequence number of 30. 
129+
130+
131+

0 commit comments

Comments
 (0)