Re: IP range in pg_hba.conf?

Поиск
Список
Период
Сортировка
От Thom Brown
Тема Re: IP range in pg_hba.conf?
Дата
Msg-id CAA-aLv6ZYPOTbgqZugmPk1oZj_AWdf+-3sLr8krDnZJX3QdzFg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: IP range in pg_hba.conf?  (Zhidong <zhidong.she@gmail.com>)
Список pgsql-general
2011/11/8 Zhidong <zhidong.she@gmail.com>:
> 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

В списке pgsql-general по дате отправления:

Предыдущее
От: Zhidong
Дата:
Сообщение: Re: IP range in pg_hba.conf?
Следующее
От: Lori Corbani
Дата:
Сообщение: Re: function within a function/rollbacks/exception handling