Search Postgresql Archives

Re: IP range in pg_hba.conf?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2011/11/8 Zhidong <zhidong.she@xxxxxxxxx>:
> Can you guys explain why it is 10.17.64.0/20? Thanks!

11111111 = 255 in binary
11110000 = 240 in binary

So a CIDR mask of 8 would cover the first 8 bits, 16 the next 8, but
when we reach 20 we've covered 20 bits.

The first 255 is the first 8 bits.  The next 255 is bits 9-16.  Bits
17-20 brings it up to 240.  The rest are zeros.

0.0.0.0 = /0
255.0.0.0 = /8
255.255.0.0 = /16
255.255.255.0 = /24
255.255.255.255 = /32

And inbetween you get:

255.255.240.0 = /20

255    255    240    0
11111111 11111111 11110000 00000000
First 20 binary digits are masked.

-- 
Thom Brown
Twitter: @darkixion
IRC (freenode): dark_ixion
Registered Linux user: #516935

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux