From 12192865c3ca0e1c2139afabab508e0087b14982 Mon Sep 17 00:00:00 2001 From: Mitchell Riedstra Date: Wed, 23 Feb 2022 20:19:37 -0500 Subject: Initial --- etc/local.d/00-dhcpcd.start | 44 +++++++++++++++++++++++++++++++ etc/local.d/00-net.start | 21 +++++++++++++++ etc/local.d/01-iptables.start | 59 ++++++++++++++++++++++++++++++++++++++++++ etc/local.d/02-dnsmasq.start | 23 ++++++++++++++++ etc/local.d/03-miniupnpd.start | 33 +++++++++++++++++++++++ etc/local.d/radvd.hook | 42 ++++++++++++++++++++++++++++++ etc/local.d/vars.sh | 17 ++++++++++++ etc/local.d/vars_end.sh | 3 +++ 8 files changed, 242 insertions(+) create mode 100755 etc/local.d/00-dhcpcd.start create mode 100755 etc/local.d/00-net.start create mode 100755 etc/local.d/01-iptables.start create mode 100755 etc/local.d/02-dnsmasq.start create mode 100755 etc/local.d/03-miniupnpd.start create mode 100755 etc/local.d/radvd.hook create mode 100755 etc/local.d/vars.sh create mode 100755 etc/local.d/vars_end.sh (limited to 'etc') diff --git a/etc/local.d/00-dhcpcd.start b/etc/local.d/00-dhcpcd.start new file mode 100755 index 0000000..65d8957 --- /dev/null +++ b/etc/local.d/00-dhcpcd.start @@ -0,0 +1,44 @@ +#!/bin/sh +. /etc/local.d/vars.sh +# Not actually starting dhcpcd here, just writing out the configuration +# file based on what we have in vars +# +# This file also installs the `radvd.hook` to enable ipv6 router advertisements +# on the lan interface. + +# Write out our dhcpcd conf, take note that I've specifically disabled ipv4 +# here. I could enable it, however to keep a static ipv4 address the same as +# with a previous router it makes sense to have a DHCPv4 server not using a +# duid. ( So, udhcpc is still used ) +cat > /etc/dhcpcd.conf < "$conf" < "$conf" < /etc/radvd.conf + +/etc/init.d/radvd restart +} + +case "$reason" in +DELEGATED6) +write_radvd +;; +esac + diff --git a/etc/local.d/vars.sh b/etc/local.d/vars.sh new file mode 100755 index 0000000..dcc326c --- /dev/null +++ b/etc/local.d/vars.sh @@ -0,0 +1,17 @@ +# You can replace tty1 with ttyS0 for serial output +exec >/dev/tty1 2>&1 +printf '\033[1;32m' # Green output for our scripts, comment out to disable. +echo "Starting script: $0" +set -x + +wan=eth0 # WAN / ISP uplink interface, assumed ip is provided by DHCP +wan_hwaddr=EA:5D:EA:DB:EE:FF +lan=eth1 # LAN interface +# `sipcalc` is a useful program here +lan_ip=192.168.0.1 +lan_net=192.168.0.0 +lan_mask_bits=24 +domain=router.local +dhcp_range=192.168.0.30,192.168.0.230,24h +# Specifically overrides upstream on `dnsmasq` for the DHCP clients +dns_servers="1.1.1.1 8.8.4.4" diff --git a/etc/local.d/vars_end.sh b/etc/local.d/vars_end.sh new file mode 100755 index 0000000..d2c4c2c --- /dev/null +++ b/etc/local.d/vars_end.sh @@ -0,0 +1,3 @@ +set +x +echo "Ending script: $0" +printf '\033[0m\n' # Stop color output -- cgit v1.2.3