zebra icon indicating copy to clipboard operation
zebra copied to clipboard

listen_addr doesn't accept "[::]"

Open imcdona opened this issue 2 months ago • 3 comments

What happened?

When I specify listen_addr = "[::]" I expect zebra to listen on the default port on all IPv6 addresses

Instead I get this error:

error: Zebra could not parse the provided config file. This might mean you are using a deprecated format of the file. You can generate a valid config by running "zebrad generate", and diff it against yours to examine any format inconsistencies.
error: zebrad fatal error: parse error: invalid IP address syntax; Hint: addresses can be a IPv4, IPv6 (with brackets), or a DNS name, the port is optional for key `network` at line 8 column 1

Note that specifying a port along with [::] works as expected: listen_addr = "[::]:8233"

What were you doing when the issue happened?

Attempting to start Zebra in a docker container

Zebra logs

error: Zebra could not parse the provided config file. This might mean you are using a deprecated format of the file. You can generate a valid config by running "zebrad generate", and diff it against yours to examine any format inconsistencies.
error: zebrad fatal error: parse error: invalid IP address syntax; Hint: addresses can be a IPv4, IPv6 (with brackets), or a DNS name, the port is optional for key `network` at line 8 column 1

Zebra Version

zebrad 1.6.1

Which operating systems does the issue happen on?

  • [X] Linux
  • [ ] macOS
  • [ ] Windows
  • [ ] Other OS

OS details

zfnd/zebra docker image

Additional information

No response

imcdona avatar Apr 30 '24 18:04 imcdona

It doesn't like the brackets, listen_addr = "::" should work if you don't want to specify a port.

arya2 avatar Apr 30 '24 20:04 arya2

@arya2 should we document this in the zebra book?

mpguerra avatar May 03 '24 07:05 mpguerra

@arya2 should we document this in the zebra book?

I'll update the config deserialization to accept this format too, I think that would be a better UX.

arya2 avatar May 03 '24 14:05 arya2