We just signed up with a new ISP and we got a static IP from them.
Our previous ISP just gave one IP and we were able to configure our web server using that. Now, we have got this new IP with a slash notation. This type is new to me. When I used the CIDR calculator, it gave me the following results:
202.184.7.52/30 IP: 202.184.7.52 Netmask: 255.255.255.252 Number of hosts: 2 Network address: 202.184.7.52 Broadcast address: 202.184.7.55
Can someone please help me by explaining what these are? I could not understand what the number of hosts means. Is that telling that I can use two different IP for DNS (A) records? Also, which one should I setup in my router? The network address or broadcast address?
Thank you very much for any answer you may provide.
The /30 means all but two of the 32 bits are used to define the netmask. It also means you've got four IP addresses to play with. (But in reality, only two of which can be hosts)
Your last octet of the netmask is (in binary) 11111100, which leaves the last two bits for you to define your network. (hence the four addresses)
Just looking at the last two bits:
Clear as mud I'm sure.. but hope that adds a little to your understanding
/20
means use the first 20 bits as a netmask. It's usually expressed where the bits outside the netmask are 0 so206.89/16
is roughly 64K addresses all starting with203.89.
The netmask is0xFFFF0000
.So
202.184.7.52/30
means:The last 2 bits are used for hosts within that subnet. See IP Routing on Subnets.
From 202.184.7.52/30 the ip is:202.184.7.52
Let us find the Netmask. /30 means 30 "1" s, 8 in the first octet, 8 in the 2nd, 8 in the 3rd and only 6 in the 4th.
We use the last octet only because we know eight '1's =255
so Netmask becomes: 255.255.255.252
The number of hosts= 2^N -2 =2^2 -2 =2 ( since No of Zeroes in last octet is 2, so N=2)
Finding the network address:
Replace the last two zeroes by 1