Skip to content

Instantly share code, notes, and snippets.

View essigt's full-sized avatar

Tim Essig essigt

View GitHub Profile
@essigt
essigt / setup-bridge.sh
Created March 22, 2018 15:26 — forked from ismell/setup-bridge.sh
Scripts to re-create the docker0 bridge and setup a different ip subnet
#!/bin/bash -e
IFADDR="192.168.3.1/24"
if [[ ! ip link show docker0 ]]; then
ip link add docker0 type bridge
ip addr add "$IFADDR" dev docker0
ip link set docker0 up
iptables -t nat -A POSTROUTING -s "$IFADDR" ! -d "$IFADDR" -j MASQUERADE
fi