Updated networking config
This commit is contained in:
@ -54,7 +54,7 @@
|
|||||||
"network": {
|
"network": {
|
||||||
"format": "<span font=\"FontAwesome\"></span> {ipaddr}",
|
"format": "<span font=\"FontAwesome\"></span> {ipaddr}",
|
||||||
"format-disconnected": "<span font=\"FontAwesome\"></span> ",
|
"format-disconnected": "<span font=\"FontAwesome\"></span> ",
|
||||||
"interface": "enp7s0",
|
"interface": "enp10s0",
|
||||||
"tooltip-format": "{ifname} via {gwaddr}"
|
"tooltip-format": "{ifname} via {gwaddr}"
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -34,6 +34,46 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
mkStaticSystemdNetwork = {interface, ip, router, nameserver}: {
|
||||||
|
# name = "enp0s31f6"; # Network interface name?
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
# See man systemd.link, man systemd.netdev, man systemd.network
|
||||||
|
matchConfig = {
|
||||||
|
# This corresponds to the [MATCH] section
|
||||||
|
Name = interface; # Match ethernet interface
|
||||||
|
};
|
||||||
|
|
||||||
|
# Static IP + DNS + Gateway
|
||||||
|
address = ip;
|
||||||
|
gateway = router;
|
||||||
|
dns = nameserver;
|
||||||
|
|
||||||
|
# routes = [
|
||||||
|
# {
|
||||||
|
# routeConfig.Gateway = (lib.head router);
|
||||||
|
# }
|
||||||
|
# ];
|
||||||
|
|
||||||
|
# See man systemd.network
|
||||||
|
networkConfig = {
|
||||||
|
# This corresponds to the [NETWORK] section
|
||||||
|
DHCP = "no";
|
||||||
|
|
||||||
|
# TODO: What does this all do?
|
||||||
|
# IPv6AcceptRA = true;
|
||||||
|
# MulticastDNS = "yes"; # Needed?
|
||||||
|
# LLMNR = "no"; # Needed?
|
||||||
|
# LinkLocalAddressing = "no"; # Needed?
|
||||||
|
};
|
||||||
|
|
||||||
|
linkConfig = {
|
||||||
|
# This corresponds to the [LINK] section
|
||||||
|
# RequiredForOnline = "routable";
|
||||||
|
RequiredForOnline = "no"; # Don't make nixos-rebuild wait for systemd-networkd-wait-online.service
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
mkNetworkNamespace = name: ''
|
mkNetworkNamespace = name: ''
|
||||||
${pkgs.iproute}/bin/ip netns add ${name} # Create the Namespace
|
${pkgs.iproute}/bin/ip netns add ${name} # Create the Namespace
|
||||||
${pkgs.iproute}/bin/ip -n ${name} link set lo up # Enable the Loopback device
|
${pkgs.iproute}/bin/ip -n ${name} link set lo up # Enable the Loopback device
|
||||||
|
@ -46,11 +46,11 @@ with mylib.networking; {
|
|||||||
};
|
};
|
||||||
|
|
||||||
networking.hosts = {
|
networking.hosts = {
|
||||||
"192.168.86.42" = ["nixinator"];
|
"192.168.86.50" = ["nixinator"];
|
||||||
"192.168.86.69" = ["proxmox"];
|
"192.168.86.4" = ["proxmox"];
|
||||||
"192.168.86.100" = ["truenas"];
|
"192.168.86.20" = ["truenas"];
|
||||||
"192.168.86.102" = ["opnsense"];
|
"192.168.86.5" = ["opnsense"];
|
||||||
"192.168.86.105" = ["servenix"];
|
"192.168.86.25" = ["servenix"];
|
||||||
};
|
};
|
||||||
|
|
||||||
# Enable flakes
|
# Enable flakes
|
||||||
|
@ -60,7 +60,7 @@ in {
|
|||||||
networking = {
|
networking = {
|
||||||
# Gets inherited from flake in nixos mylib and passed through the module option
|
# Gets inherited from flake in nixos mylib and passed through the module option
|
||||||
hostName = cfg.hostname; # Define your hostname.
|
hostName = cfg.hostname; # Define your hostname.
|
||||||
enableIPv6 = true;
|
enableIPv6 = false;
|
||||||
|
|
||||||
# Disable a lot of stuff not needed for systemd-networkd
|
# Disable a lot of stuff not needed for systemd-networkd
|
||||||
networkmanager.enable = false;
|
networkmanager.enable = false;
|
||||||
|
@ -29,6 +29,17 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
systemd-networkd = {
|
systemd-networkd = {
|
||||||
|
networks = {
|
||||||
|
# This should override the default network 50-ether
|
||||||
|
"10-ether-2_5G" = mylib.networking.mkStaticSystemdNetwork {
|
||||||
|
interface = "enp10s0";
|
||||||
|
ip = ["192.168.86.50/24"];
|
||||||
|
router = ["192.168.86.5"];
|
||||||
|
nameserver = ["192.168.86.25"];
|
||||||
|
};
|
||||||
|
# "10-ether-1G" = mylib.networking.mkStaticSystemdNetwork {...};
|
||||||
|
};
|
||||||
|
|
||||||
wireguard-tunnels = {
|
wireguard-tunnels = {
|
||||||
wg0-de-115 = (
|
wg0-de-115 = (
|
||||||
mylib.networking.mkWireguardService
|
mylib.networking.mkWireguardService
|
||||||
|
Reference in New Issue
Block a user