Binding Serf to IPv6 Link Local Address

Skip to first unread message

Jeremy Brown

Jul 14, 2017, 2:16:08 PM7/14/17
to Serf

I am working on a project where I am attempting to bind "serf agent" using an IPv6 link local address in fe80::/64 space.  I understand that with Linux using these addresses are a bit tricky, as since all interfaces have IPv6LL addresses, you usually either need to bind the command to a specific interface or qualify the address with "%ifname" at the end.

I have tried both options but am getting an error:

serf agent -node=$(hostname) -iface=eth0 -bind=[fe80::a00:27ff:fe89:a670]
++ hostname
+ serf agent -node=sn-08002789a670 -iface=eth0 '-bind=[fe80::a00:27ff:fe89:a670]'
==> Starting Serf agent...
==> Failed to start the Serf agent: Error creating Serf: Failed to create memberlist: Failed to start TCP listener. Err: listen tcp [fe80::a00:27ff:fe89:a670]:7946: bind: invalid argument

Using "-bind=[fe80::a00:27ff:fe89:a670%eth0]" results in the same error - with our without the "iface" parameter.

To test, I assigned this system a IPv6 ULA address.  These are similar to RFC1918 private address space in IPv4.  Using that, I had no issue:

serf agent -node=$(hostname) -iface=eth0 -bind=[fd12:3456:789a:1::]
==> Starting Serf agent...
==> Starting Serf agent RPC...
==> Serf agent running!
Node name: 'sn-08002789a670'
Bind addr: '[fd12:3456:789a:1::]:7946'
          RPC addr
: ''
Encrypted: false
Snapshot: false
Profile: lan

==> Log data will now stream in as it occurs:

2017/07/14 17:58:36 [INFO] agent: Serf agent starting
2017/07/14 17:58:36 [WARN] memberlist: Binding to public address without encryption!
2017/07/14 17:58:36 [INFO] serf: EventMemberJoin: sn-08002789a670 fd12:3456:789a:1::
2017/07/14 17:58:37 [INFO] agent: Received event: member-join

So my question is: has anyone had any success using IPv6 link local with Serf?  I can, of course, allocate a ULA address and use that - but I'm wondering if it's needed.

If the use case is needed: all machines that need to communicate are on the same layer 2 network, and there is no need to route to any other networks.  I am trying to utilize the address that IPv6 sets up automatically on all interfaces, as the things I want to do with Serf happen before the system has been allocated any sort of IPv4 or IPv6 address.  I can use something like avahi-autoipd to get an IPv4 link local - but I would like to keep that address space empty for other various reasons.

Thanks in advance for the advice.

- Jeremy
Reply all
Reply to author
0 new messages