anchor.diff:  
           preStart =
             ''
  +            set +e # continue in case of errors
  +          
               ${flip concatMapStrings cfg.interfaces (i:
                 optionalString (i.macAddress != "")
                   ''
                     echo "Setting MAC address of ${i.name} to ${i.macAddress}..."
  -                  ip link set "${i.name}" address "${i.macAddress}" || true
  +                  ip link set "${i.name}" address "${i.macAddress}"
                   '')
               }
   
               for i in $(cd /sys/class/net && ls -d *); do
                   echo "Bringing up network device $i..."
  -                ip link set "$i" up || true
  +                ip link set "$i" up
               done
   
               # Configure the manually specified interfaces.
  
positive.code: 
              # Set the default gateway.
              ${optionalString (cfg.defaultGateway != "") ''
                  ip route add default via "${cfg.defaultGateway}" || true
              ''}
  
              # Run any user-specified commands.
              ${pkgs.stdenv.shell} ${pkgs.writeText "local-net-cmds" cfg.localCommands} || true
  
              # Create bridge devices.
              ${concatStrings (attrValues (flip mapAttrs cfg.bridges (n: v: ''
                  echo "Creating bridge ${n}..."
                  ${pkgs.bridge_utils}/sbin/brctl addbr "${n}" || true
                  ${flip concatMapStrings v.interfaces (i: ''
                    ${pkgs.bridge_utils}/sbin/brctl addif "${n}" "${i}" || true
                    ip addr flush dev "${i}" || true
                  '')}
                  # !!! Should delete (brctl delif) any interfaces that
                  # no longer belong to the bridge.
              '')))}
  
negative.code:                 ''
                    echo "Configuring interface ${i.name}..."
                    ip addr add "${i.ipAddress}""${optionalString (i.subnetMask != "") ("/" + i.subnetMask)}" \
                      dev "${i.name}"
                  '')
              }
  
  