![]() ![]() I've tried a version of this that uses PREROUTING/POSTROUTING instead of INPUT/OUTPUT and that resulted in an immediate "connection refused. A OUTPUT -p tcp -m tcp -dport 6379 -j DNAT -to-destination 10.1.0.2:6379Īttempting to connect to Redis with redis-cli using the above rules just hangs forever. Here is one of the things I tried: $ sudo iptables -t nat -S What iptables rules can I use to achieve this effect? I have tried several variations of iptables rules on the NAT table, but I either get "connection refused" when trying to connect to the local address/port, or the connection just hangs forever. I'd like to forward traffic to 127.0.0.1:6379 to 10.1.0.2:6379. Loopback alias ip-address is the simplest way to make localhost and docker containers communications identical on OSX and Linux. Assume that this program cannot be configured to point at a different IP. There is a program that will be running in container B that expects Redis to be available at port 6379 on the loopback interface. Using Docker's linking feature, a user inside container B can connect to Redis on through 10.1.0.2:6379, which travels through the virtual eth0 interface set up by Docker. Container B is running an interactive shell and needs to access Redis. 5 Answers Sorted by: 36 It depends what you want lo or lo: which is an interface alias. When an operator executes docker run, the container process that runs is isolated in that it has its own file system, its own networking, and its own isolated process tree separate from the host. This will allow you to create device nodes inside your container. Method 1 probably Wondering whats the IP address of your running docker container You can inspect the running container to get that information. A container is a process which runs on a host. 2 Answers Sorted by: 25 If you're using systemd-nspawn, start up your container with the -capabilit圜APMKNOD command line switch. Container A is running a Redis server on port 6379. Docker runs processes in isolated containers. I have a new Ubuntu 14.04 install, and want to use Docker to run my old stuff that needs 12.04. The loopback addresses are built into the IP domain system, enabling devices to transmit and receive the data packets. ![]() SE doesnt allow me to delete my question, but its not relevant anymore. A loopback address is a distinct reserved IP address range that starts from 127.0.0.0 ends at 127.255.255.255 though 127.255.255.255 is the broadcast address for 127.0.0.0/8. I never figured out how to fix this specific problem back then, but Docker and everything else involved moved on. I have two Docker containers that I'm trying to network together in a specific way. 36 Edit 2020: This is a six year old question. ![]()
0 Comments
Leave a Reply. |