Discussion:
Binding both IPv4 and IPv6
Andrea Brancatelli
2018-09-17 14:04:17 UTC
Permalink
Hello,

I'm trying to have CouchDB bind Both to IPv6 and IPv4 but I don't seem
to able to do it properly.

I google ad bit and found the magic "any" keyword to be used in
bind_address (the documentation just report ::1 to enable ipv6 or
0.0.0.0 to enable ipv4 but not the combination of both), yet even with
"any" I only get a IPv4 Binding.

I'm on FreeBSD and still on Couch 1.7.2.

Anyone has any hint on this?

Thanks
--
Andrea Brancatelli
Joan Touzet
2018-09-18 14:17:03 UTC
Permalink
Hi Andrea,

CouchDB doesn't support IPv6 at this time. You'll need to use a 6in4
(proto 41) bridge or tunnel to access Couch from IPv6 networks.

-Joan

----- Original Message -----
From: "Andrea Brancatelli" <***@schema31.it>
To: ***@couchdb.apache.org
Sent: Monday, September 17, 2018 10:04:17 AM
Subject: Binding both IPv4 and IPv6

Hello,

I'm trying to have CouchDB bind Both to IPv6 and IPv4 but I don't seem
to able to do it properly.

I google ad bit and found the magic "any" keyword to be used in
bind_address (the documentation just report ::1 to enable ipv6 or
0.0.0.0 to enable ipv4 but not the combination of both), yet even with
"any" I only get a IPv4 Binding.

I'm on FreeBSD and still on Couch 1.7.2.

Anyone has any hint on this?

Thanks
--
Andrea Brancatelli
Dave Cottlehuber
2018-09-18 19:39:00 UTC
Permalink
Post by Andrea Brancatelli
Hello,
I'm trying to have CouchDB bind Both to IPv6 and IPv4 but I don't seem
to able to do it properly.
I google ad bit and found the magic "any" keyword to be used in
bind_address (the documentation just report ::1 to enable ipv6 or
0.0.0.0 to enable ipv4 but not the combination of both), yet even with
"any" I only get a IPv4 Binding.
I'm on FreeBSD and still on Couch 1.7.2.
Anyone has any hint on this?
Thanks
Sadly its a linuxism**. It's called dual-stack mode, Linux lets you enable/disable it through the net.ipv6.bindv6only sysctl but BSDs don’t support this, at least from my understanding.

The easiest thing is to use nginx, haproxy or similar or even pf to relay ip6 traffic to/from the 2 stacks.  You'll likely only need a single rule or bind statement for this anyway.

I prefer the simplicity of using a proxy server to enable this, but you could try this out:

/etc/rc.conf: ipv6_ipv4mapping="YES"

then binding couch to IPv6 ::1, and rebooting and seeing what happens. I don't have IPv6 at home so I can't check this without risking an inaccessible server. If I'm right, the IPv6 only couchdb would "see" all IPv4 addresses presented as IPv6 mapped ones.

A+
Dave

** also found on Windows and elsewhere...

Loading...