WIP update for new dual-NIC box

This commit is contained in:
Daniel Flanagan 2022-01-31 11:40:03 -06:00
parent 09b5a6d69c
commit 351206f735
9 changed files with 45 additions and 25 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
tags

View file

@ -78,14 +78,15 @@ server=8.8.4.4
# Add domains which you want to force to an IP address here. # Add domains which you want to force to an IP address here.
# The example below send any host in double-click.net to a local # The example below send any host in double-click.net to a local
# web-server. # web-server.
address=/git.lyte.dev/10.0.0.10 address=/dragon.h.lyte.dev/10.0.0.10
address=/h.lyte.dev/10.0.0.10 address=/git.lyte.dev/10.0.0.25
address=/a.lyte.dev/10.0.0.10 address=/h.lyte.dev/10.0.0.25
address=/.h.lyte.dev/10.0.0.10 address=/a.lyte.dev/10.0.0.25
address=/#.h.lyte.dev/10.0.0.10 address=/.h.lyte.dev/10.0.0.25
address=/bw.lyte.dev/10.0.0.10 address=/#.h.lyte.dev/10.0.0.25
address=/files.lyte.dev/10.0.0.10 address=/bw.lyte.dev/10.0.0.25
address=/grafana.lyte.dev/10.0.0.10 address=/files.lyte.dev/10.0.0.25
address=/grafana.lyte.dev/10.0.0.25
# --address (and --server) work with IPv6 addresses too. # --address (and --server) work with IPv6 addresses too.
#address=/www.thekelleys.org.uk/fe80::20d:60ff:fe36:f83 #address=/www.thekelleys.org.uk/fe80::20d:60ff:fe36:f83
@ -231,8 +232,8 @@ dhcp-range=10.0.0.5,10.0.0.250,255.255.255.0,10m
# need to be on the same network. The order of the parameters in these # need to be on the same network. The order of the parameters in these
# do not matter, it's permissible to give name, address and MAC in any # do not matter, it's permissible to give name, address and MAC in any
# order. # order.
dhcp-host=f0:2f:74:c9:9b:61,dragon,10.0.0.5,12h dhcp-host=f0:2f:74:c9:9b:61,dragon,10.0.0.10,12h
dhcp-host=00:50:b6:24:27:0b,faceless,10.0.0.10,12h dhcp-host=00:50:b6:24:27:0b,faceless,10.0.0.25,12h
# Always allocate the host with Ethernet address 11:22:33:44:55:66 # Always allocate the host with Ethernet address 11:22:33:44:55:66
# The IP address 192.168.0.60 # The IP address 192.168.0.60

View file

@ -8,7 +8,7 @@ t="/tmp/nftables.conf"
# we don't care about existing rules - just use ours, thanks # we don't care about existing rules - just use ours, thanks
# sudo nft -s list ruleset >> "$f" # sudo nft -s list ruleset >> "$f"
sudo nvim "$my_config" sudo -E nvim "$my_config"
cat "$my_config" cat "$my_config"
echo "Do you want to load this config? [y/N]" echo "Do you want to load this config? [y/N]"
read -r l read -r l

5
lan0.link Normal file
View file

@ -0,0 +1,5 @@
[Match]
MACAddress=00:01:2e:82:73:5a
[Link]
Name=lan0

View file

@ -1,6 +1,6 @@
[Match] [Match]
Name=lan0 Name=lan0
# MACAddress=00:e0:4c:6d:0c:74 # MACAddress=00:01:2e:82:73:5a
[Network] [Network]
Address=10.0.0.1/24 Address=10.0.0.1/24

View file

@ -1,12 +1,26 @@
#!/usr/bin/env fish #!/usr/bin/env fish
function rmlink if test (id -u) -ne 0
echo "must run as root"
exit 1
end
function relink
rm -f $argv[2] rm -f $argv[2]
ezln $argv[1] $argv[2] ezln $argv[1] $argv[2]
end end
rmlink dnsmasq.conf /etc/dnsmasq.conf function recopy
rmlink usb-ethernet-as-lan0.link /etc/systemd/network/10-usb-eth-adapter.link rm -f $argv[2]
cp $argv[1] $argv[2]
end
cp eth0.network /etc/systemd/network/eth0.network relink dnsmasq.conf /etc/dnsmasq.conf
cp lan0.network /etc/systemd/network/lan0.network
recopy lan0.link /etc/systemd/network/10-lan0.link
recopy wan0.link /etc/systemd/network/10-wan0.link
recopy wan0.network /etc/systemd/network/wan0.network
recopy lan0.network /etc/systemd/network/lan0.network
mkinitcpio -p linux

View file

@ -1,6 +0,0 @@
[Match]
MACAddress=00:e0:4c:6d:0c:74
[Link]
Description=USB to Ethernet Adapter
Name=lan0

5
wan0.link Normal file
View file

@ -0,0 +1,5 @@
[Match]
MACAddress=00:01:2e:82:73:59
[Link]
Name=wan0

View file

@ -1,6 +1,6 @@
[Match] [Match]
Name=eth0 Name=wan0
# MACAddress=dc:a6:32:0a:b5:84 # MACAddress=00:01:2e:82:73:59
[Network] [Network]
DHCP=yes DHCP=yes