blob: f1a91eeca383998739f625eede641e63d1c806f3 [file] [log] [blame]
---
title: Choosing Between IPv4 and IPv6
---
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
By default, <%=vars.product_name_long%> uses Internet Protocol version 4 for <%=vars.product_name%> address specifications. You can switch to Internet Protocol version 6 if all your machines support it. You may lose performance, so you need to understand the costs of making the switch.
- IPv4 uses a 32-bit address. IPv4 was the first protocol and is still the main one in use, but its address space is expected to be exhausted within a few years.
- IPv6 uses a 128-bit address. IPv6 succeeds IPv4, and will provide a much greater number of addresses.
Based on current testing with <%=vars.product_name%> , IPv4 is generally recommended. IPv6 connections tend to take longer to form and the communication tends to be slower. Not all machines support IPv6 addressing. To use IPv6, all machines in your distributed system must support it or you will have connectivity problems.
**Note:**
Do not mix IPv4 and IPv6 addresses. Use one or the other, across the board.
IPv4 is the default version.
To use IPv6, set the Java property, `java.net.preferIPv6Addresses`, to `true`.
These examples show the formats to use to specify addresses in <%=vars.product_name%> .
- IPv4:
``` pre
192.0.2.0
```
- IPv6:
``` pre
2001:db8:85a3:0:0:8a2e:370:7334
```