• notabot@piefed.social
    link
    fedilink
    English
    arrow-up
    11
    ·
    22 hours ago

    Nah, put your gateway in a different subnet, but on the same network segment, and add a static /32 route to it on every client.

    • cheet@infosec.pub
      link
      fedilink
      arrow-up
      2
      ·
      15 hours ago

      Is there a specific reason behind this? Never considered it but I could see it being useful since most specific routes win.

      • notabot@piefed.social
        link
        fedilink
        English
        arrow-up
        3
        ·
        15 hours ago

        Mostly to make the next sysadmin (or yourself in 6 months) weep. There’s nothing preventing there being multiple IP subnets on a single network segment, but you’d usually handle that with separate VLANs, or at least an interface alias, so the machine saw both subnets. About the only reason I could see for just adding a static route would be if you’re in the middle of reconfiguring your network to a new subnet but you still need the hosts you haven’t updated to be able to route.

        • jj4211@lemmy.world
          link
          fedilink
          arrow-up
          2
          ·
          11 hours ago

          The real nightmare when someone puts two ip addresses on the same host through different interfaces. Now that makes for some confusing troubleshooting and explanations in various applications.

          What really gets me is in about 3/4 networks in the last couple of weeks I’ve been asked to help troubleshoot, the problem has been duplicate IP addresses. I don’t know what is going on with people…

    • chronicledmonocle@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      15 hours ago

      That won’t work, unless I’m misunderstanding you. You’d still need a gateway within your subnet to handle inter-subnet routing or an additional address on the gateway network.

      • jj4211@lemmy.world
        link
        fedilink
        arrow-up
        4
        ·
        11 hours ago

        It can be made to work, just really really stupid.

        Ultimately the ‘gateway’ is really a mac address, and the IP is just the thing to ARP to get the mac address. And you can do some gnarly things to pull off things like off-subnet gateway addresses.

        You should never ever do it, but you can if you hate yourself enough.

        Becomes easier in IPv6 to do these shenigans too.

        • chronicledmonocle@lemmy.world
          link
          fedilink
          arrow-up
          1
          ·
          4 hours ago

          Technically, sure, but you have to do a ton of fuckery and I have no idea why anybody would do all that work rather than just use an IP in the subnet.

      • notabot@piefed.social
        link
        fedilink
        English
        arrow-up
        2
        ·
        11 hours ago

        By adding a host, or /32, route to the gateway you should then be able to use it as the default gateway on your main subnet. I was not being serious when I suggested it, as another comment says, it’s a pretty stupid idea, and there really isn’t any sane usecase for it, except possibly one of those 1am “if it’s stupid but it works it’s still stupid, but it’ll do until morning” type fixes that you shudder to recall years later.