Guide to NixOS based router 2023 - part 2 - software

Hi,

I finally finished second part of my blogpost that you can find here https://github.com/ghostbuster91/blogposts/blob/a2374f0039f8cdf4faddeaaa0347661ffc2ec7cf/router2023-part2/main.md

I tried to gather all best nix and networking practices that I learned so far. I hope that this guide will serve as a reference for others who might want also to setup their own home routers using nix.

Please let me know what you think of it.

10 Likes

This is a great write-up! I appreciate the detail. Now I am on a Banana Pi click-spiral; thank you for that!

1 Like

Thank you for this, very useful. A question I would like to ask:

Is dnsmasq a (better) alternative to what I’ve tried below?
systemd.network.networks.enp3s0.dhcpServerConfig.UplinkInterface = “:auto”;

Mine ‘works’ gives out addresses, but WIP for me because the mesh wifi attached cannot see ‘internet’ after experimenting some time so far.

I am new to the detail of Linux networking , have more to learn here, and keen to copy/find the canonical way.

Your blog is the best I have come across and is much appreciated.

I’d need to see a diagram of this , to work out exactly what the problem was?

you mention mesh wifi, do you think thats related? i presume everything is bridge and lives on the same subnet, if it’s doesn’t then your gateway is going to be have to told about these extra subnets on your network, else you won’t be able to get traffic back from the gateway. default routes don’‘t cut it when you have more than once choice’.

1 Like

Thank you - I will generate a diagram. It is between gateway (5g modem) wireless AP as a NixOS router [wireless client] and [wired dhcp sever] to the ethernet port on a mesh master (1 of 3). Being a wireless client I think the bridge is not possible?

3: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    inet 192.168.10.1/24 brd 192.168.10.255 scope global enp3s0
4: wlp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    inet 192.168.9.102/24 metric 1024 brd 192.168.9.255 scope global dynamic wlp2s0

default via 192.168.9.1 dev wlp2s0 proto dhcp src 192.168.9.102 metric 1024 
192.168.9.0/24 dev wlp2s0 proto kernel scope link src 192.168.9.102 metric 1024 
192.168.9.1 dev wlp2s0 proto dhcp scope link src 192.168.9.102 metric 1024

I want to give https://mermaid.js.org/#/ , because it can generate markdown that github can render…

so it might be fun.

not sure discourse can render it…

1 Like