Translation of subnets seems to be not working
See original GitHub issueI try to add a subnet to virtual network configuration. But I realise that generated ARM template doesn’t contain the subnet. My configuration looks as follows:
let bastionSubnet = subnet {
name "AzureBastionSubnet"
prefix "10.1.0.0/27"
}
let virtualNetwork env = vnet {
name (sprintf "vnet-%s" env)
add_address_spaces [ "10.0.0.0/16" ]
add_subnets [ bastionSubnet ]
}
let machine env = vm {
name (sprintf "machine-%s" env)
vm_size Vm.Standard_B1s
operating_system Vm.UbuntuServer_1804LTS
os_disk 128 Vm.StandardSSD_LRS
username "heheheheheheh"
subnet_prefix "10.0.0.0/24"
depends_on (virtualNetwork env)
}
While generated ARM template looks like this:
{
"apiVersion": "2018-11-01",
"location": "centralus",
"name": "vnet-test",
"properties": {
"addressSpace": {
"addressPrefixes": [
"10.0.0.0/16"
]
},
"subnets": [
{
"name": "machine-test-subnet",
"properties": {
"addressPrefix": "10.0.0.0/24",
"delegations": []
}
}
]
},
"tags": {},
"type": "Microsoft.Network/virtualNetworks"
}
As you may see the only subnet added to the VirtualNetwork is a machine subnet. When I remove creation of a machine from the script, the template looks as follows:
{
"apiVersion": "2018-11-01",
"location": "centralus",
"name": "vnet-test",
"properties": {
"addressSpace": {
"addressPrefixes": [
"10.0.0.0/16"
]
},
"subnets": [
{
"name": "AzureBastionSubnet",
"properties": {
"addressPrefix": "10.1.0.0/27",
"delegations": []
}
}
]
},
"tags": {},
"type": "Microsoft.Network/virtualNetworks"
}
I think that the problem is here where the Subnets would be overriden(?)
I would appreciate any hint regarding that I’m doing something wrong or where I could take a look to fix the issue and provide a PR : )
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (7 by maintainers)
Top Results From Across the Web
OpenVPN site-to-site with subnet translation?
Hello everyone, I'm attempting to configure a site-to-site OpenVPN link with subnet translation. This seems straightforward, except I must have a ...
Read more >Using Site-to-site VPN Translation - Cisco Meraki
To configure VPN subnet translation: Navigate to Security & SD-WAN > Configure > Site-to-site VPN. Set VPN subnet translation to Enabled. This ...
Read more >Subnets on single switch problem
Hi i recently completed a CCENT and am now moving onto to CCNA. I came across a network recently shown in the attachment...
Read more >Help with Subnet Routing not working : r/Tailscale
RPi is 192.168.2.3 on our work network, but I can not connect to anything on that subnet from home that is not running...
Read more >Solved: Not getting subnet translation to work
Solved: We are trying to replace a Cisco router with a FortiGate running 5.4 but are unable to get subnet translation to work...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You’ll need to use
link_to_vnet
andsubnet_name
to specify thevnet
andsubnet
to use, otherwise the implicitly generated vnet will overwrite things.One other item is that the
AzureBastionSubnet
is not contained within the vnet address space you defined. To make sure the pieces fit, I suggest using the builder to carve out subnets within the address space:@ninjarobot , @isaacabraham thanks to that everything seems to be working as expected. Thank you!