mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-12-16 06:50:21 +00:00
An environment with AF_INET6 sockets but no loopback interface creates
nothing but pain.
If an IPv4 server binds to 0.0.0.0:8080, clients may connect to
0.0.0.0:8080, which automatically picks 127.0.0.1 as a source address.
However, when a server binds to [::]:8080, the absence of ::1 causes
clients to fail with ENETUNREACH.
For a demonstration, run the following in a python shell:
import socket
s = socket.socket(socket.AF_INET6, socket.SOCK_STREAM, 0)
s.bind(("", 0))
print s.getsockname() # Example: ('::', 39079, 0, 0)
s.listen(10)
c = socket.socket(socket.AF_INET6, socket.SOCK_STREAM, 0)
c.connect(s.getsockname())
print c.getsockname(), c.getpeername()
This yields the following error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/socket.py", line 224, in meth
return getattr(self._sock,name)(*args)
socket.error: [Errno 101] Network is unreachable
|
||
|---|---|---|
| .. | ||
| azure | ||
| docker | ||
| ec2 | ||
| gce | ||
| kvm | ||
| oracle | ||
| virtualbox | ||
| __init__.py | ||
| README.rst | ||
Providers in bootstrap-vz represent various cloud providers and virtual machines. bootstrap-vz is an extensible platform with loose coupling and a significant amount of tooling, which allows for painless implementation of new providers. The virtualbox provider for example is implemented in only 89 lines of python, since most of the building blocks are a part of the common task library. Only the kernel and guest additions installation are specific to that provider.