aboutsummaryrefslogtreecommitdiff
path: root/etc/local.d/00-net.start
diff options
context:
space:
mode:
Diffstat (limited to 'etc/local.d/00-net.start')
-rwxr-xr-xetc/local.d/00-net.start21
1 files changed, 21 insertions, 0 deletions
diff --git a/etc/local.d/00-net.start b/etc/local.d/00-net.start
new file mode 100755
index 0000000..9c28f09
--- /dev/null
+++ b/etc/local.d/00-net.start
@@ -0,0 +1,21 @@
+#!/bin/sh
+. /etc/local.d/vars.sh
+
+ip link set dev $wan address $wan_hwaddr
+ip link set up $wan
+udhcpc -b -i $wan
+
+# dhcpv6
+dhcpcd
+
+ip link set up $lan
+ip -4 addr add $lan_ip/$lan_mask_bits dev $lan
+
+# We are indeed, a router.
+sysctl -w net.ipv4.ip_forward=1
+# Even though we're a router, accept router advertisements anyway
+sysctl -w net.ipv6.conf.all.accept_ra=2
+# IP Forwarding, but for ipv6 as well
+sysctl -w net.ipv6.conf.all.forwarding=1
+
+. /etc/local.d/vars_end.sh