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.
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…
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.
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.
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.
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.
Is there a specific reason behind this? Never considered it but I could see it being useful since most specific routes win.
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.
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…
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.
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.
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.
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.