Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question

10 Answers 10

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..."

share|improve this answer
4  
I've used both as well, but usually for more practical reasons than just seeing peoples heads asplode ;) –  Mark Henderson May 20 '10 at 22:23
    
That sounds like fun =D –  Antoine Benkemoun May 20 '10 at 22:51
3  
That may be fun buts can cause problems later when someone who doesn't properly understand subnetting has to debug a network problem. –  John Gardeniers May 21 '10 at 5:31
    
+1 for making a good point and being Evan Anderson. =) –  Qwerty May 21 '10 at 6:17
1  
@ 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 –  RobM May 21 '10 at 14:52

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.)

share|improve this answer
    
+1 for consistency –  Qwerty May 21 '10 at 6:13

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|improve this answer

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.

share|improve this answer
1  
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. –  TomTom May 21 '10 at 6:17
1  
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 May 21 '10 at 6:23
    
(I assume you need to go through the router to connect to hosts to do modification) –  radius May 21 '10 at 6:30
1  
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. –  Thomas May 21 '10 at 14:23

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?"

share|improve this answer
    
Sure (I promise) –  Thomas May 21 '10 at 14:27

There is no hard and fast rule about this, but on nearly all of the networks I've designed and/or worked on, the lowest IP in the subnet is used for the router/default gateway. In your case, this would be 192.168.100.1.

As for your "why?" question - it's really just a convention that the networking community has settled on. If you want to put the default gateway somewhere else, feel free, but really you may be asking for confusion at some point in the future.

share|improve this answer
    
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. –  Thomas May 20 '10 at 22:25
2  
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. –  Mark Henderson May 21 '10 at 2:20
    
Okay. That's a small but also interesting advantage for low IPs. –  Thomas May 21 '10 at 14:17

I've always had the router at the bottom. Then come the servers, followed by any other devices that need or benefit from fixed addresses. Printers are at the top, also with fixed addresses. Everything in between is DHCP.

That's just the way I do it but as others have already pointed out, it makes absolutely no difference. The only thing that does matter is that you adopt a consistent scheme and stick to it. Don't forget to document it.

share|improve this answer

Toss a coin - it doesn't matter - what's more important is to stick with the result for all subnets to maintain consistency.

share|improve this answer

This is down to site practice and preferences.

The only "rule" I would suggest is whichever one you pick, be consistent. If you manage many networks or one large complex network with lots of subnets and sometimes the router is at 192.168.x.1 and sometimes its on 192.168.x.254... that is a great way to confuse everyone.

share|improve this answer
1  
I agree, consistency is important. –  Thomas May 21 '10 at 14:24

It doesn't matter what IP the default gateway has, but it's good to have a consistent policy throughout the network. It's usually easiest to say "lowest usable" or "highest usable" since those two are available on any network from a /30 to a /0.

share|improve this answer

protected by Chris S Oct 17 at 14:04

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?