Jump to content

Systemd/networkd: Difference between revisions

m
→‎Static: nixfmt
No edit summary
m (→‎Static: nixfmt)
Line 178: Line 178:
     matchConfig.Name = "enp1s0";
     matchConfig.Name = "enp1s0";
     address = [
     address = [
        # configure addresses including subnet mask
      # configure addresses including subnet mask
        "192.0.2.100/24"
      "192.0.2.100/24"
        "2001:DB8::2/64"
      "2001:DB8::2/64"
     ];
     ];
     routes = [
     routes = [
Line 187: Line 187:
       { routeConfig.Gateway = "192.0.2.1"; }
       { routeConfig.Gateway = "192.0.2.1"; }
       # or when the gateway is not on the same network
       # or when the gateway is not on the same network
       { routeConfig = {
       {
        Gateway = "172.31.1.1";
        routeConfig = {
        GatewayOnLink = true;
          Gateway = "172.31.1.1";
      }; }
          GatewayOnLink = true;
        };
      }
     ];
     ];
     # make the routes on this interface a dependency for network-online.target
     # make the routes on this interface a dependency for network-online.target
moderator
29

edits