diff options
-rwxr-xr-x | router.customize | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/router.customize b/router.customize index 2a5dc26..02a64a3 100755 --- a/router.customize +++ b/router.customize @@ -31,6 +31,42 @@ export LC_ALL=C rootdir="$1" +# Configure network ports. eth0 is WAN and gets its adress using DHCP. +# The rest will serve the LAN and dnsmasq will serve address to LAN via +# DHCP on these ports. The LAN interfaces have a static config. + +cat <<EOF > "$rootdir/etc/network/interfaces.d/router.conf" +auto eth0 +inet eth0 inet dhcp + +auto eth1 +iface eth1 inet static + address 10.0.0.2 + netmask 255.255.255.0 + gateway 10.0.0.255 + +auto eth2 +iface eth2 inet static + address 10.0.0.3 + netmask 255.255.255.0 + gateway 10.0.0.255 + +auto eth3 +iface eth3 inet static + address 10.0.0.4 + netmask 255.255.255.0 + gateway 10.0.0.255 +EOF + +# Configure dnsmasq to server 10.0.0.x addresss on the LAN ports. +cat <<EOF > "$rootdir/etc/dnsmasq.d/router.conf" +interface=eth1 +interface=eth2 +interface=eth3 +dhcp-range=10.0.0.10,10.0.0.250,255.255.255.0,720h +EOF + + # Create an account for ansible. chroot "$rootdir" adduser --gecos 'Ansible' --disabled-password ansible |