question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to bind all interfaces dual-stack?

See original GitHub issue

I wish to write a server application that binds to all interfaces in a dual-stack IPv4/IPv6 environment.

I thought the example server would be doing that, as it appears to bind to ‘::0’. In other applications, like CherryPy, binding to that address makes the server available on all interfaces, IPv4 and IPv6, but in aiosmtpd, the server is only reachable on IPv6. As a result, when the application moves to an environment that only supports IPv4 (looking at you, Docker), the application is unreachable.

Reading up on the docs for create_server, I see that passing a None value for the host should bind to all interfaces on both stacks, and indeed, that’s the behavior I see.

But aiosmtpd doesn’t allow passing None due to the the localhost default behavior.

I did find one interface that worked, but I’m not happy with it:

	cont = controller.Controller(proxy, port=8025)
	# no really, I want all interfaces
	cont.hostname = None
	cont.start()

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
Mortalcommented, Mar 11, 2018

I think we can label this issue “rubber ducking” 😃

Thanks for the PR and for figuring this out!

0reactions
jaracocommented, Mar 11, 2018

I’ve presented a PR, and that approach feels minimally invasive to address the concern.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bind to all interfaces for IPv4 and IPv6 in haproxy - Server Fault
To listen on the same port for IPv6 and IPv4, use this: bind :::80 v4v6. Admittedly, this was an intuitive guess that appears...
Read more >
Create dual-stack socket on all loopback interfaces on Windows
A server can bind a dual-stack socket to both IPv4 and IPv6 on a single port. A client should use AF_UNSPEC with getaddrinfo()...
Read more >
Dual Stack Tunnels over an External Interface | Junos OS
Dual-stack tunnels—parallel IPv4 and IPv6 tunnels over a single physical interface to a peer—are supported for route-based site-to-site VPNs.
Read more >
556 (bind to multiple IPv4 and IPv6 addresses)
it looks like it is not possible not bind OpenVPN in dual stack mode on specific IPs. If I run the server plain...
Read more >
Dual Stack bind and communication - Consul
It binds to all addresses available (done: bind = "[::]" ); It advertises both v4/v6 public interfaces: (done:.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found