-1

Is there a universal and/or generic default gateway address in IPv4?

I'm looking for something similar to the way you can always reference a NICs IP address from itself with 127.0.0.1 regardless of any other factors, making deployments much simpler with many machines over many networks, since you don't have to keep track of the individual IP anymore in many situations.

In my case, I'm deploying numerous machines over many different networks, and it would be very handy if there was a way to reference the default gateway similarly, without needing to manually keep track of which network is which. The scripts I'm writing for deployment would greatly benefit from such a feature, and would be much easier to use and maintain.

Giffyguy
  • 365
  • 4
  • 6
  • 21
  • 1
    I think you're looking for DHCP. – Hyppy Jan 12 '15 at 18:08
  • @Hyppy I'm not looking for DHCP. DHCP is used on some of the networks, and not used on others. Certain machines use DHCP and certain machines use static IP configuration. I'm looking for a way to reference the default gateway's IP address regardless of what the configuration happens to be for a specific machine. – Giffyguy Jan 12 '15 at 18:10
  • Static IP configurations generally have three components. IP, netmask, and gateway. If you can't configure all three, then DHCP is the tried-and-true answer. – Hyppy Jan 12 '15 at 18:11
  • 1
    Nothing universal for this – krisFR Jan 12 '15 at 18:12
  • If you have a standard like "always use x.x.x.1" for the gateway, that might help. But you may still have problems with different masks unless you standardize those also. As Hyppy said, it's a triplet. – Celery Man Jan 12 '15 at 18:30
  • @CeleryMan Yeah, the networks are subnets with varying subnet masks. It's a messy situation to keep track of everything. The ability to just have the machine be able to make requests to an abstract address like `127.0.0.2` to reference whatever its configured gateway is, would help clean things up a lot. – Giffyguy Jan 12 '15 at 18:33
  • Theoretically, if your machines supported a RIP listener and the gateways distributed RIP routes, then the hosts could populate their routing tables without having a default gateway hard-configured. But that's ugly compared to DHCP, and it's not really what you were asking for. – Celery Man Jan 12 '15 at 18:39
  • 127.0.0.1 does not belongs to any NIC, it is the address of the loopback interface, device name "lo". – Matías Jan 12 '15 at 23:10

1 Answers1

5

No, there really is no such thing.

Sven
  • 98,649
  • 14
  • 180
  • 226