Contents
How to setup PostgreSQL on an IPv6 enabled network?
PostgreSQL is a great open source database, not only because it supports lot of database features, but also because it supports different network setup. For example, you can set it up on an IPv6 enabled network in just a few steps. This blog will demonstrate how to setup PostgreSQL on an IPv6 network in Linux.
What are the different network address types in PostgreSQL?
Network Address Types. PostgreSQL offers data types to store IPv4, IPv6, and MAC addresses, as shown in Table 8-21. It is better to use these types instead of plain text types to store network addresses, because these types offer input error checking and specialized operators and functions (see Section 9.12).
Why does Linux use IPv6 instead of IPv4?
Because operating systems prefer IPv6 over IPv4, that is the reason why IPv6 is used (although on Linux, this can be configured through /etc/gai.conf ). The address ::1 is never used as a source address, and you don’t have a global address ( 2000::/3 ), which leaves the link-local address ( fe80::/10) as the source address.
What’s the length of an IPv6 host address?
In IPv6, the address length is 128 bits, so 128 bits specify a unique host address. Note that if you want to accept only networks, you should use the cidr type rather than inet.
Do you need a link local address for IPv6?
Not like IPv4, all the interface of an IPv6 enabled host require a link-local address. The link-local address will always start with the prefix fe80:: and it is generated during TCP/IP stack boot up on that interface. The interesting part is that link-local address doesn’t request a DHCP server or any manual configuration.
Why do we use IPv6 instead of IPv4?
This is somewhat an advanced topic though. IPv6 is used because you are connecting to localhost. localhost resolves to both 127.0.0.1 and ::1. Because operating systems prefer IPv6 over IPv4, that is the reason why IPv6 is used (although on Linux, this can be configured through /etc/gai.conf ).
How can I get access to my PostgreSQL server?
Also if you are on a windows domain, you can use LDAP, SSPI, or Kerberos 5 authentication and thus allow access only to domain members. This is somewhat an advanced topic though.