blob: 62f05c6025e1a454120607befeebc7c398a2645a [file] [log] [blame]
Andy Bavier0e8511f2016-03-01 13:13:42 -05001#!/bin/bash
2
3IFACE=$1
4
5# Assumes that mgmtbr is set up on 10.10.1.1 interface
6apt-get install bridge-utils dnsmasq
7brctl addbr mgmtbr
8ifconfig $IFACE 0.0.0.0
9brctl addif mgmtbr $IFACE
10ifconfig mgmtbr 10.10.1.1/24 up
11
12cat <<EOF > /etc/dnsmasq.d/cord
13dhcp-range=10.10.1.3,10.10.1.253
14interface=mgmtbr
15dhcp-option=option:router,10.10.1.1
16EOF
17
18service dnsmasq restart
19
20# Assumes eth0 is the public interface
21iptables -t nat -I POSTROUTING -s 10.10.1.0/24 \! -d 10.10.1.0/24 -j MASQUERADE