From bff48c1a12919c66de2f8891d538eb9203720940 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Tue, 9 Aug 2016 09:59:01 +0300 Subject: Configure LAN2-4 to provide DHCP for LAN --- router.customize | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) 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 < "$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 < "$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 -- cgit v1.2.1