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

routeros_ipv6_dhcp_client - wrong ipv6 address representation #610

Open
outworlder opened this issue Nov 28, 2024 · 3 comments
Open

routeros_ipv6_dhcp_client - wrong ipv6 address representation #610

outworlder opened this issue Nov 28, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@outworlder
Copy link

Describe the bug
Given the following ipv6 address definition:

/ipv6 address
 4  G 2600:1700:a646:41d:4aa9:8aff:fe75:d2c5/64   user-vlan      users        yes 

And the following resource:

resource "routeros_ipv6_address" "user_vlan" {
  address = "2600:1700:a646:41d:4aa9:8aff:fe75:d2c5/64"
  eui_64 = true
  from_pool = routeros_ipv6_dhcp_client.user_vlan.pool_name
  interface = routeros_interface_vlan.users.name
}

resource "routeros_ipv6_dhcp_client" "user_vlan" {
  add_default_route = true
  advertise = true
  interface = "vrrp1"
  pool_name = "user-vlan"
  request = ["address", "prefix"]
  use_interface_duid = true
  use_peer_dns = false
  pool_prefix_length = "64"
}

When running Terraform plan and importing the existing resource, this is the plan:

  # routeros_ipv6_dhcp_client.user_vlan will be imported
    resource "routeros_ipv6_dhcp_client" "user_vlan" {
        add_default_route      = true
        address                = "2600:1700:a646:410::40, 48m6s"
        default_route_distance = 1
        dhcp_options           = []
        dhcp_server_v6         = "fe80::fa63:d9ff:fe49:3e50"
        disabled               = false
        duid                   = "0x0003000100005e000201"
        id                     = "*3"
        interface              = "vrrp1"
        invalid                = false
        pool_name              = "user-vlan"
        pool_prefix_length     = 64
        prefix                 = "2600:1700:a646:41d::/64, 48m6s"
        prefix_hint            = "::/0"
        request                = [
            "address",
            "prefix",
        ]
        status                 = "bound"
        use_interface_duid     = true
        use_peer_dns           = false
    }

It is showing some sort of timestamp as part of both the prefix and address, which is not correct.

Note that the actual IPV6 address is correct:

  # routeros_ipv6_address.user_vlan will be imported
    resource "routeros_ipv6_address" "user_vlan" {
        actual_interface = "users"
        address          = "2600:1700:a646:41d:4aa9:8aff:fe75:d2c5/64"
        advertise        = true
        disabled         = false
        dynamic          = false
        eui_64           = true
        from_pool        = "user-vlan"
        global           = true
        id               = "*60"
        interface        = "users"
        invalid          = false
        no_dad           = false
    }

Since the 'address' property is read-only on the routeros_ipv6_dhcp_client, this seems to be a problem when importing resources.

To Reproduce
Given the TF section above, apply that on a imported routeros_ipv6_dhcp_client and routeros_ipv6_adress.

Expected behavior
The correct IPV6 address should be displayed when running plan (for example: "2600:1700:a646:41d:4aa9:8aff:fe75:d2c5/64")

Additional context

 tofu version
OpenTofu v1.8.6
on darwin_arm64
+ provider registry.opentofu.org/terraform-routeros/routeros v1.70.0
@outworlder outworlder added the bug Something isn't working label Nov 28, 2024
@vaerh
Copy link
Collaborator

vaerh commented Nov 29, 2024

Hi, I'll try to take a look at it soon.
Very interesting error in the plan:

image

@vaerh
Copy link
Collaborator

vaerh commented Nov 29, 2024

I on CHR 7.15.3 was unable to reproduce the problem. Could you please run

TF_LOG_PROVIDER=1 TF_LOG=debug ROS_LOG_COLOR=1 terraform import routeros_ipv6_dhcp_client.user_vlan *X

and post the green MT response lines?

@vaerh
Copy link
Collaborator

vaerh commented Dec 4, 2024

@outworlder Please look at my previous post.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants