Forked from zilin/add static route for docker containers
Created
June 27, 2021 08:44
-
-
Save SaeedSoltoon/71f8303cca2ca46a467eaf70d043ca22 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment