diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6e92f57 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +tags diff --git a/dnsmasq.conf b/dnsmasq.conf index 7e922d4..28c04af 100644 --- a/dnsmasq.conf +++ b/dnsmasq.conf @@ -78,14 +78,15 @@ server=8.8.4.4 # 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 # web-server. -address=/git.lyte.dev/10.0.0.10 -address=/h.lyte.dev/10.0.0.10 -address=/a.lyte.dev/10.0.0.10 -address=/.h.lyte.dev/10.0.0.10 -address=/#.h.lyte.dev/10.0.0.10 -address=/bw.lyte.dev/10.0.0.10 -address=/files.lyte.dev/10.0.0.10 -address=/grafana.lyte.dev/10.0.0.10 +address=/dragon.h.lyte.dev/10.0.0.10 +address=/git.lyte.dev/10.0.0.25 +address=/h.lyte.dev/10.0.0.25 +address=/a.lyte.dev/10.0.0.25 +address=/.h.lyte.dev/10.0.0.25 +address=/#.h.lyte.dev/10.0.0.25 +address=/bw.lyte.dev/10.0.0.25 +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=/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 # do not matter, it's permissible to give name, address and MAC in any # order. -dhcp-host=f0:2f:74:c9:9b:61,dragon,10.0.0.5,12h -dhcp-host=00:50:b6:24:27:0b,faceless,10.0.0.10,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.25,12h # Always allocate the host with Ethernet address 11:22:33:44:55:66 # The IP address 192.168.0.60 diff --git a/firewall-edit.sh b/firewall-edit.sh index 3109ca9..ff254a1 100755 --- a/firewall-edit.sh +++ b/firewall-edit.sh @@ -8,7 +8,7 @@ t="/tmp/nftables.conf" # we don't care about existing rules - just use ours, thanks # sudo nft -s list ruleset >> "$f" -sudo nvim "$my_config" +sudo -E nvim "$my_config" cat "$my_config" echo "Do you want to load this config? [y/N]" read -r l diff --git a/lan0.link b/lan0.link new file mode 100644 index 0000000..f010fe6 --- /dev/null +++ b/lan0.link @@ -0,0 +1,5 @@ +[Match] +MACAddress=00:01:2e:82:73:5a + +[Link] +Name=lan0 diff --git a/lan0.network b/lan0.network index 37adb07..d8578c4 100644 --- a/lan0.network +++ b/lan0.network @@ -1,6 +1,6 @@ [Match] Name=lan0 -# MACAddress=00:e0:4c:6d:0c:74 +# MACAddress=00:01:2e:82:73:5a [Network] Address=10.0.0.1/24 diff --git a/link.fish b/link.fish index b6371a4..5b9dd28 100755 --- a/link.fish +++ b/link.fish @@ -1,12 +1,26 @@ #!/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] ezln $argv[1] $argv[2] end -rmlink dnsmasq.conf /etc/dnsmasq.conf -rmlink usb-ethernet-as-lan0.link /etc/systemd/network/10-usb-eth-adapter.link +function recopy + rm -f $argv[2] + cp $argv[1] $argv[2] +end -cp eth0.network /etc/systemd/network/eth0.network -cp lan0.network /etc/systemd/network/lan0.network +relink dnsmasq.conf /etc/dnsmasq.conf + +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 diff --git a/usb-ethernet-as-lan0.link b/usb-ethernet-as-lan0.link deleted file mode 100644 index 81926cf..0000000 --- a/usb-ethernet-as-lan0.link +++ /dev/null @@ -1,6 +0,0 @@ -[Match] -MACAddress=00:e0:4c:6d:0c:74 - -[Link] -Description=USB to Ethernet Adapter -Name=lan0 diff --git a/wan0.link b/wan0.link new file mode 100644 index 0000000..f8956c6 --- /dev/null +++ b/wan0.link @@ -0,0 +1,5 @@ +[Match] +MACAddress=00:01:2e:82:73:59 + +[Link] +Name=wan0 diff --git a/eth0.network b/wan0.network similarity index 68% rename from eth0.network rename to wan0.network index 057de6c..2297a54 100644 --- a/eth0.network +++ b/wan0.network @@ -1,6 +1,6 @@ [Match] -Name=eth0 -# MACAddress=dc:a6:32:0a:b5:84 +Name=wan0 +# MACAddress=00:01:2e:82:73:59 [Network] DHCP=yes