Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug unifi_network -> subnet always assume 1 as ip address #299

Open
daco-tech opened this issue Dec 30, 2022 · 3 comments
Open

Bug unifi_network -> subnet always assume 1 as ip address #299

daco-tech opened this issue Dec 30, 2022 · 3 comments

Comments

@daco-tech
Copy link

unifi_network->subnet always assume .1 ip address for the VLAN ip address.

Example configuration:

'
resource "unifi_network" "vlan_devices" {
name = "99_Devices"
purpose = "corporate"
vlan_id = var.vlan_id_devices
subnet = "10.16.99.254/24"
dhcp_start = "10.16.99.6"
dhcp_stop = "10.16.99.253"
dhcp_enabled = true
wan_gateway = "0.0.0.0"
igmp_snooping = true
intra_network_access_enabled = false

lifecycle {
ignore_changes = [
wan_gateway,
]
}
}
'

This configuration ends always with the network IP Address 10.16.99.1 instead of applying 10.16.99.254.

When I re-run changing to .1 the state assumes no changes. When I get back to .254, it assumes again no changes.

@ednxzu
Copy link

ednxzu commented Mar 23, 2023

I might be misunderstanding, but 10.16.99.254/24 isn't a valid cidr block?

@linuxdaemon
Copy link

subnet maps to the ip_network field in unifi which is an interface spec, so subnet = "10.16.99.254/24" means the network is 10.16.99.0/24 with the gateway listening on .254. I ran in to this exact same issue, with these settings in the UI:
Screenshot 2024-02-11 at 17 01 08

I ran terraform import and modified the resource to match my live config, terraform plan showed no changes, and then it changed the gateway IP for the network to 10.254.0.1. The json response from the API has "ip_subnet": "10.254.128.1/16".

@DevOpsFu
Copy link

DevOpsFu commented May 5, 2024

My PR fixes this issue:

#454

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants