| 30 Jun 2023 |
hexa | cloud? https://nixos.wiki/wiki/Install_NixOS_on_Hetzner_Cloud#Network_configuration | 13:59:42 |
@sumner:nevarro.space | yes, cloud. I tried doing the static config, but the issue with that is that it made my private network between Hetzner nodes stop working. | 14:00:54 |
hexa | if you require dhcp, then let networkd do it | 17:37:40 |
hexa | you just need another network definition for your private network, pretty much copy/paste at this point | 17:38:03 |
@sumner:nevarro.space | hmm.. I guess I just don't know how to set that up properly because when I tried that, it just made it so that I couldn't access the internet at all | 17:38:51 |
hexa | wondering if they give you a default route via dhcp on your private network | 17:39:25 |
hexa | never used those | 17:39:27 |
@sumner:nevarro.space | this is what I get with ip a
root@matrix:~/ > ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 96:00:02:23:cd:a5 brd ff:ff:ff:ff:ff:ff
inet 5.161.216.225/32 brd 5.161.216.225 scope global dynamic eth0
valid_lft 71733sec preferred_lft 60933sec
inet6 fe80::9400:2ff:fe23:cda5/64 scope link
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc fq_codel state UP group default qlen 1000
link/ether 86:00:00:44:d6:83 brd ff:ff:ff:ff:ff:ff
altname enp7s0
inet 10.0.1.3/32 brd 10.0.1.3 scope global dynamic eth1
valid_lft 71734sec preferred_lft 60934sec
inet6 fe80::8400:ff:fe44:d683/64 scope link
valid_lft forever preferred_lft forever
| 17:40:43 |
@sumner:nevarro.space | * this is what I get with ip a
root@matrix:~/ > ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 96:00:02:23:cd:a5 brd ff:ff:ff:ff:ff:ff
inet 5.161.216.225/32 brd 5.161.216.225 scope global dynamic eth0
valid_lft 71733sec preferred_lft 60933sec
inet6 fe80::9400:2ff:fe23:cda5/64 scope link
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc fq_codel state UP group default qlen 1000
link/ether 86:00:00:44:d6:83 brd ff:ff:ff:ff:ff:ff
altname enp7s0
inet 10.0.1.3/32 brd 10.0.1.3 scope global dynamic eth1
valid_lft 71734sec preferred_lft 60934sec
inet6 fe80::8400:ff:fe44:d683/64 scope link
valid_lft forever preferred_lft forever
this is with dhcp
| 17:40:57 |
@sumner:nevarro.space | I don't know how to replicate that using just systemd.network | 17:50:45 |
hexa | ip route? | 17:56:52 |
@sumner:nevarro.space | root@matrix:~/ > ip route
default via 172.31.1.1 dev eth0 proto dhcp src 5.161.216.225 metric 1002
10.0.0.0/8 via 10.0.0.1 dev eth1 proto dhcp src 10.0.1.3 metric 1003 mtu 1450
10.0.0.1 dev eth1 proto dhcp scope link src 10.0.1.3 metric 1003 mtu 1450
172.31.1.1 dev eth0 proto dhcp scope link src 5.161.216.225 metric 1002
| 17:58:06 |
hexa | legacy interface names 😲 | 17:59:22 |
@sumner:nevarro.space | I set usePredictableInterfaceNames = false since I saw that recommended somewhere. | 18:01:14 |
hexa | that is as silly recommendation 😄 | 18:01:24 |
hexa | you need a mechanism to ensure the same interface comes up with the same name on every boot | 18:02:03 |
hexa | the ethN scheme is first come, first served | 18:02:11 |
hexa | systemd.network.enable = true;
systemd.network.networks."10-wan" = {
matchConfig.Name = "eth0";
networkConfig.DHCP = "ipv4";
};
systemd.network.networks."10-wan" = {
matchConfig.Name = "eth1";
address = [
"10.0.1.3/32"
]:
routes = [
{ routeConfig.Destination = "10.0.0.0/8"; }
];
};
| 18:03:09 |
hexa | * systemd.network.enable = true;
systemd.network.networks."10-wan" = {
matchConfig.Name = "eth0";
networkConfig.DHCP = "ipv4";
};
systemd.network.networks."10-wan" = {
matchConfig.Name = "eth1";
networkConfig.DHCP = "ipv4";
};
| 18:04:04 |
hexa | * systemd.network.enable = true;
systemd.network.networks."10-wan" = {
matchConfig.Name = "eth0";
networkConfig.DHCP = "ipv4";
};
systemd.network.networks."10-vpn" = {
matchConfig.Name = "eth1";
networkConfig.DHCP = "ipv4";
};
| 18:04:11 |
@sumner:nevarro.space | should I also re-enable usePredictableInterfaceNames and update the matchConfig.Name accordingly, then? | 18:06:01 |
hexa | in that case I would recommend going with matchConfig.MACAddress | 18:06:31 |
hexa | because what are the new names going to be? | 18:06:55 |
hexa | probably mentioned somewhere in dmesg | grep renamed | 18:07:19 |
Zhaofeng Li | (apparently I missed the whole conversation) I pin against MAC addresses as well | 18:16:38 |
Zhaofeng Li | ... and I go one step further and rename the interfaces to wan/lan/bedroom etc | 18:17:05 |
@sumner:nevarro.space | thanks for your help, I went ahead and pinned to mac address and it seems to be working. I'll just have to wait and see if I get pinged in the middle of the night again because my server is down due to forgetting how to connect to the internet. I guess networkd is probably more reliable than using dhcpcd? | 19:10:37 |
| 2 Jul 2023 |
| duponin left the room. | 20:23:43 |
| 4 Jul 2023 |
| jlesquembre joined the room. | 09:14:55 |
| 10 Jul 2023 |
@julian:nekover.se | Hi, why is StrictHostKeyChecking=accept-new enabled per default and is there an option to disable it? | 01:28:01 |