cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
955
Views
0
Helpful
4
Replies

vlan subnet mask issue

Hi all

i created a vlan with ip address 172.19.1.254 255.255.255.0 ..i assigned a static ip for a server in this vlan with

IP address172.19.1.1

Subnet mask : 255.255.255.0

Gateway : 172.19.1.254

the machine is working fine but this server is working even when the subnet mask is 255.255.0.0  i though it should be a class subnet mask only but it is working both ways i dont know why..

can you please let me know any settings i have to do in my switch or in the server

thanks

Karthik

4 Replies 4

Amit Aneja
Level 3
Level 3

Kartik,

You should have the same subnet mask for the IP address on switch as well as on server.

What you are seeing is expected. When you assign a /16 mask on the server, what really matters is the first 16 bits of the IP address. So, with /16, the network range is 172.19.0.0 -172.19.255.255 & since 172.19.1.254 falls in this range, it is in the same subnet & hence it can be pinged.

With /24 mask, the range is 172.19.1.0 - 172.19.1.255, still 172.19.1.254 falls in the range & can be pinged. What really matters is that your gateway should be in the same subnet.

I would use /24, if I have less than 255 (253 ideally) users in that vlan, if that specific vlan has more than 255 users, let's say 500, I will use subnet mask of /16 on both server & vlan interface.

HTH,

Amit

So what you are saying is the subnet mask doesn’t matter the gateway should be correct ? am I right

Reza Sharifi
Hall of Fame
Hall of Fame

Hi,

The server and the switch both have a class C address and it works just fine.  Since both devices are in the same subnet, you can have one mask of 16 and the other one 24.  In this case the server does not need to use the gateway.

You need the correct gateway if you are leaving the local subnet.

HTH

Understood thank you

Review Cisco Networking products for a $25 gift card