router/link.fish
Daniel Flanagan 8e87d5e259 Ok more
2022-01-31 17:11:33 -06:00

32 lines
726 B
Fish
Executable file

#!/usr/bin/env fish
if test (id -u) -ne 0
echo "must run as root"
exit 1
end
function relink
rm -f $argv[2]
ezln $argv[1] $argv[2]
end
function recopy
rm -f $argv[2]
cp $argv[1] $argv[2]
end
# DNS, DHCP, prefix delegation
recopy dnsmasq.conf /etc/dnsmasq.conf
# let dnsmasq handle DNS
recopy resolved.conf /etc/systemd/resolved.conf
# sysctl flags we need for forwarding and accepting IPv6 router advertisements
recopy ./sysctl-configs /etc/sysctl.d/10-router-configs.conf
# enable systemd-networkd to setup network interfaces with useful names
recopy lan0.link /etc/systemd/network/10-lan0.link
recopy wan0.link /etc/systemd/network/10-wan0.link
# dhcp client configuration
recopy dhcpcd.conf /etc/dhcpcd.conf