Created
May 31, 2016 06:24
-
-
Save Cloudo/6f042aea7dde7c9d9d95ce374cf764c6 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
| #Script to set custom iprange for dockers bridge, also starts docker | |
| cat << EOF >> /etc/rc.local | |
| #docker | |
| subnet="10.0.41.1/16" | |
| if ! [[ "$(ip link show docker0)" ]]; then | |
| ip link add docker0 type bridge | |
| ip addr add "$subnet" dev docker0 | |
| ip link set docker0 up | |
| iptables -t nat -A POSTROUTING -s "$subnet" ! -d "$subnet" -j MASQUERADE | |
| fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment