feld,
@feld@bikeshed.party avatar

added an IPv6 address to my Pleroma instance, watching tcpdump, federation does not involve any IPv6 at all.

feld,
@feld@bikeshed.party avatar

mastodon.social has ipv6 so that should at least be showing up in the logs when i post

feld,
@feld@bikeshed.party avatar

heyyyy alright I got it working: now the question is why was my change required.

feld,
@feld@bikeshed.party avatar

this post can be ignored, it's just testing...

feld,
@feld@bikeshed.party avatar

hmmm. strange strange.

feld,
@feld@bikeshed.party avatar

@lanodan I know you're definitely an ipv6 user -- what OS are you hosting on and have you confirmed that IPv6 connections are used for outbound federation traffic? I am curious if somehow my required config changes are FreeBSD-specific...

feld,
@feld@bikeshed.party avatar

@lanodan here's the background:

I run Pleroma in a FreeBSD jail. The jail network interface by default does not have IPv6 enabled.

I use an erl_inetrc config file. This was my config for a long time:

%% -- ERLANG INET CONFIGURATION FILE --
{inet6, false}.
{edns, 0}.
{cache_size, 0}.

Interestingly, changing this to {inet6, true} is not sufficient! I also need to add {tcp, inet6_tcp}.

The final config looks like this:

%% -- ERLANG INET CONFIGURATION FILE --
{inet6, true}.
{tcp, inet6_tcp}.
{edns, 0}.
{cache_size, 0}.

"And now it works?" -- hah, funny! It does not. Very strange. But then I remembered a requirement I always have to do for my Elixir/Phoenix projects is to change the Endpoint config to listen on IPv4 specifically: {0, 0, 0, 0}. The default is {0, 0, 0, 0, 0, 0, 0, 0} which fails.

Now that I have IPv6 enabled for the jail interface, this bind works. I'm not receiving traffic on IPv6, so it shouldn't be required... but it is!

If I bind Phoenix to IPv4 only I make ZERO outbound requests with IPv6 even though it could! How weird is that? It's not like Phoenix should be able to interfere with Gun, but somehow it does. I wonder if Phoenix tickles some internal Erlang/BEAM networking settings that is equivalent to modifying the erl_inetrc at runtime???

Either way, I need all 3 of these settings or it doesn't work.

feld,
@feld@bikeshed.party avatar

@lanodan I take one thing back: setting {tcp, inet6_tcp}. seems to make it want to ONLY use IPv6 which I didn't notice at first :sweatdrop:

edit: haha yes, this is 100% what it does. OOPS.

lanodan,
@lanodan@queer.hacktivis.me avatar

@feld So now it works? Because it should work fine (as IPv4 used to drop at home and few people I know screwed up their IPv4 config but not their IPv6 one).

feld,
@feld@bikeshed.party avatar

@lanodan nope, there's a lower level issue at hand here. The only way to get Erlang/Elixir to automatically prefer IPv6 by doing AAAA lookups for hostnames first is modify every library / HTTP client or hijack functions in the OTP inet module. Otherwise as long as there's an A record it's going to prefer that first because that's just how everything is written right now 😭

Add this to your Pleroma and magic happens. I'm currently using it.

https://github.com/skunkwerks/inet64_tcp

lanodan,
@lanodan@queer.hacktivis.me avatar

@feld Isn't preferring IPv4 or IPv6 an horrible mess thanks to Unix getaddrinfo(3)?
At least I don't think Erlang is normally doing name resolution by itself (even though imho non-C languages should).

feld,
@feld@bikeshed.party avatar

@lanodan there is a true happy eyeballs implementation that may ship with Gun in the future. That's the best option if it materializes

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • rosin
  • thenastyranch
  • ethstaker
  • osvaldo12
  • mdbf
  • DreamBathrooms
  • InstantRegret
  • magazineikmin
  • Youngstown
  • ngwrru68w68
  • slotface
  • GTA5RPClips
  • kavyap
  • cubers
  • JUstTest
  • everett
  • cisconetworking
  • tacticalgear
  • anitta
  • khanakhh
  • normalnudes
  • Durango
  • modclub
  • tester
  • provamag3
  • Leos
  • megavids
  • lostlight
  • All magazines