Skip to content

Instantly share code, notes, and snippets.

@zilin
Last active December 28, 2023 22:11
Show Gist options
  • Save zilin/b2982d7276dd340328dd to your computer and use it in GitHub Desktop.
Save zilin/b2982d7276dd340328dd to your computer and use it in GitHub Desktop.
Accessing docker container private network easily from your boot2docker host
-----
(from http://ispyker.blogspot.com/2014/04/accessing-docker-container-private.html)
add a Host-only adapter in VirtualBox
OSX:
# show route table
netstat -nr
# set vm host as the gateway of the docker containers' prviate network
sudo route -n add 172.17.0.0/16 192.168.56.101
or
sudo route add -net 172.17.0.0 -netmask 255.255.0.0 192.168.56.101
Linux:
# show route table
route
# set vm host as the gateway of the docker containers' prviate network
route add -net 172.17.0.0 netmask 255.255.0.0 gw 192.168.56.101
@angelotinho
Copy link

Will this let me call into. docker container on another host?

@Aref-Riant
Copy link

how can i set an IDS Container, like Snort, as gateway for another container. so it could analyse the traffic and pass it to deserved destination?

@F4LK0N
Copy link

F4LK0N commented May 14, 2023

Thanks! Exactly what I need! \o/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment