Use first or last free IP for the default gateway?

41,507

Solution 1

I am of the "put the gateway at the top of the subnet" religion. It makes absolutely no difference, though.

For kicks, I've put the gateway in a /23 on the ".0" or ".255" address (i.e. 192.168.0.0/23, spanning 192.168.0.0 to 192.168.1.254, with 192.168.0.255 and 192.168.1.0 both being valid host IPs)... That's some good fun, that. I enjoy watching the heads of people who don't understand IP subnetting asplode when I tell them-- "The default gateway is 192.168.0.255..."

Solution 2

I would use 192.168.100.1, then asign IP starting at 192.168.100.10 (I keep some free IP if I need to add some network device like load balancer, etc.)

Why ? Imagine you need to shrink the network to a /25, if you have used 192.168.100.254 you must change the gateway all host.
Ok you will tell me, I can use 192.168.100.254 and start affecting IP from the top instead of the bottom then shrink to 192.168.100.128/25 instead of 192.168.100.0/24. That's right.
Now imagine you need to extend the network to 192.168.100.0/23. If a gateway set as 192.168.100.1, the gateway is still the first IP of the network when 192.168.100.254 would be in middle.

That why I prefer to take the first IP most of the time, it's also easier for others person, they just know that the gateway if the first IP in the subnet and most of the time changing the subnet will not affect this statement.

Solution 3

From what I've seen, it's almost entirely personal/organizational preference. As long as you are consistent, neither way is wrong. If you really wanted to, you could set up the router to have both IPs (but this would be silly.)

Solution 4

Less important than "is the gateway high or low?" is "did you document what you did so so in the future people will know how to find things?"

Solution 5

Usually people stick with what the device shipped with - which is very often 192.168.0.1. I work in an environment where the convention is that the gateway is .254, managed switches live on .253 downwards, backup connection on .1, servers on .2 upwards.

Share:
41,507

Related videos on Youtube

HopelessN00b
Author by

HopelessN00b

Updated on September 17, 2022

Comments

  • HopelessN00b
    HopelessN00b over 1 year

    Please assume a simple LAN on 192.168.100.0/24. Would you configure the default router on 192.168.100.1 or 192.168.100.254 and why?

    Thanks

  • Pranit Bauva
    Pranit Bauva almost 14 years
    From school I remember that the last IP should be used. But in real life I see most routers on the first IP. I wonder if there is a spec or convention for either way.
  • Antoine Benkemoun
    Antoine Benkemoun almost 14 years
    That sounds like fun =D
  • MrGigu
    MrGigu almost 14 years
    That's probably because most "routers" these days are consumer-spec devices that also do DHCP, and the fewer number of characters Mrs Jones has to type (10.1.1.1 vs 192.168.101.254) the less chance she'll get it wrong.
  • Qwerty
    Qwerty almost 14 years
    +1 for consistency
  • Qwerty
    Qwerty almost 14 years
    +1 for making a good point and being Evan Anderson. =)
  • TomTom
    TomTom almost 14 years
    BAD argument - if you this way need to shring the network, you still need to change the network mask on all host. Ergo go to all hosts anyway -> same situation.
  • radius
    radius almost 14 years
    Yes but this is a lot easier... if you change gateway on host first, you loose network on host untill you changed all host then the gateway IP (Of course you can't change gateway first or you loose your host, then can't do the change). Changing the mask doesn't imply a cut!
  • radius
    radius almost 14 years
    (I assume you need to go through the router to connect to hosts to do modification)
  • mpez0
    mpez0 almost 14 years
    I was at one lab where we had a segment where we worked on "completely legal per standard, but different from common practice" stuff to check for standards compliance. One of the head explodey things was non-contigous netmasks, like aaaaaaaa or ffff00ff.
  • Pranit Bauva
    Pranit Bauva almost 14 years
    Okay. That's a small but also interesting advantage for low IPs.
  • Admin
    Admin almost 14 years
    I think this is a valid answer. In the case of changing the subnet size it feels more natural to keep the low adresses and take care of the other hosts in the next step.
  • Arioch 'The
    Arioch 'The almost 14 years
    I agree, consistency is important.
  • psychowood
    psychowood almost 14 years
    Sure (I promise)
  • Rob Moir
    Rob Moir almost 14 years
    @ John Gardeniers: I'd love to say that people who don't understand subnetting shouldn't be debugging a tcp/ip network... but we all know that doesn't always work
  • Spence
    Spence almost 14 years
    @mp3z0: Didn't CIDR made non-contiguous subnet masks illegal?
  • PF4Public
    PF4Public almost 8 years
    +1 for documenting