| 1 | <!DOCTYPE html> |
| 2 | <html> |
| 3 | <head> |
| 4 | <title>ProFTPD: IPv6</title> |
| 5 | </head> |
| 6 | |
| 7 | <body bgcolor=white> |
| 8 | |
| 9 | <hr> |
| 10 | <center><h2><b>ProFTPD: IPv6</b></h2></center> |
| 11 | <hr> |
| 12 | |
| 13 | <p> |
| 14 | ProFTPD has support for IPv6 connections enabled by default. To disable IPv6 |
| 15 | functionality at build time, use the proper <code>configure</code> option, |
| 16 | <i>e.g.</i>: |
| 17 | <pre> |
| 18 | $ ./configure --disable-ipv6 ... |
| 19 | </pre> |
| 20 | To disable IPv6 support at <i>runtime</i>, use the <a href="../modules/mod_core.html#UseIPv6"><code>UseIPv6</code></a> directive in your <code>proftpd.conf</code>: |
| 21 | <pre> |
| 22 | # Disable IPv6 support |
| 23 | UseIPv6 off |
| 24 | </pre> |
| 25 | The <a href="../modules/mod_core.html#DefaultAddress"><code>DefaultAddress</code></a>, <a href="../modules/mod_core.html#MasqueradeAddress"><code>MasqueradeAddress</code></a>, and <a href="../modules/mod_core.html#VirtualHost"><code><VirtualHost></code></a> directives can take both IP addresses and DNS names as |
| 26 | parameters. If IP addresses are used, either IPv4 or IPv6, they work as one |
| 27 | expects. Things are more involved when a DNS name is given as a parameter. |
| 28 | |
| 29 | <p> |
| 30 | It is possible for a DNS name to have multiple IP addresses, both <code>A</code> |
| 31 | (IPv4) and <code>AAAA</code> (IPv6) records. Thus <code>DefaultAddress</code> |
| 32 | and <code><VirtualHost></code> will resolve a DNS name to its addresses; |
| 33 | if multiple addresses are found, they will be added automatically. |
| 34 | <pre> |
| 35 | <VirtualHost localhost> |
| 36 | ... |
| 37 | </VirtualHost> |
| 38 | </pre> |
| 39 | on an IPv6-enabled host, would be treated as: |
| 40 | <pre> |
| 41 | <VirtualHost 127.0.0.1 ::1> |
| 42 | ... |
| 43 | </VirtualHost> |
| 44 | </pre> |
| 45 | <b>Note</b> that <code>MasqueradeAddress</code> does <i>not</i> resolve a DNS |
| 46 | name to all possible addresses. ProFTPD can only <em>masquerade</em> as one |
| 47 | address, and so, if given a DNS name, <code>MasqueradeAddress</code> will use |
| 48 | the <i>first</i> IP address returned by the DNS lookup. |
| 49 | |
| 50 | <p> |
| 51 | <b>Known Issues</b><br> |
| 52 | |
| 53 | <p> |
| 54 | <i>Wildcard Sockets</i><br> |
| 55 | Various Unix platforms handle wildcard sockets differently with regard to IPv6 |
| 56 | address. For example, on Mac OSX, one must configure a virtual host to listen |
| 57 | for <i>both</i> the IPv4 and IPv6 wildcard addresses in order to accept both |
| 58 | IPv4 and IPv6 connections: |
| 59 | <pre> |
| 60 | # Listen for all IPv4 AND all IPv6 connections |
| 61 | <VirtualHost 0.0.0.0 ::> |
| 62 | ... |
| 63 | </VirtualHost> |
| 64 | </pre> |
| 65 | |
| 66 | <p> |
| 67 | However, on Solaris, binding to an IPv6 address will accept both IPv4 and IPv6 |
| 68 | connections to that address automatically. On BSD systems, the behavior |
| 69 | is affected by the <code>net.inet6.ip6.v6only</code> <code>sysctl</code> |
| 70 | setting; on Linux, it is the <code>net.ipv6.bindv6only</code> |
| 71 | <code>sysctl</code> setting. |
| 72 | |
| 73 | <p> |
| 74 | Note that the above are issues only if <a href="../modules/mod_core.html#SocketBindTight"><code>SocketBindTight</code></a> is <em>not</em> enabled, <i>i.e.</i> |
| 75 | if wildcard sockets are used. |
| 76 | |
| 77 | <p> |
| 78 | <i>Broken Implementations</i><br> |
| 79 | HP-UX 11i has a broken <code>getaddrinfo(2)</code> implementation. To fix |
| 80 | this, a patch from HP-UX is needed. See these <a href="http://docs.hp.com/hpux/onlinedocs/T1306-90004/T1306-90004.html">release notes</a> for IPv6 on HP-UX |
| 81 | 11i. Alternatively, you can use ProFTPD's fallback implementation by building |
| 82 | ProFTPD with the <code>--builtin-getaddrinfo</code> compile option. |
| 83 | |
| 84 | <p> |
| 85 | <i>Badly Parsed DNS names</i><br> |
| 86 | Certain DNS names may be handled improperly when IPv6 support is enabled, |
| 87 | <i>e.g.</i>: |
| 88 | <pre> |
| 89 | Allow from .ee |
| 90 | </pre> |
| 91 | Attempting to start up ProFTPD with a configuration that contains the above |
| 92 | line <em>will</em> fail, with the following error being reported: |
| 93 | <pre> |
| 94 | getaddrinfo '.ee' error: Name or service not known |
| 95 | Fatal: Allow: bad ACL definition: '.ee': Success on line 13 of '/path/to/proftpd.conf' |
| 96 | </pre> |
| 97 | The issue is that ProFTPD's ACL parser has to guess, for a given string, |
| 98 | whether the string is for an IP address (either IPv4 or IPv6) or a DNS name, |
| 99 | which may or may not contain explicit or implicit glob characters. One of the |
| 100 | tests that the ACL parser uses is to see if the string contains any characters |
| 101 | that <i>cannot</i> appear in an IPv4 or IPv6 address. If the string has any |
| 102 | non-IP address characters, it is treated as a DNS name string, otherwise, it is |
| 103 | an IP address string. |
| 104 | |
| 105 | <p> |
| 106 | The range of characters which can appear in an IP address string is: |
| 107 | <pre> |
| 108 | 0123456789ABCDEFabcdef.: |
| 109 | </pre> |
| 110 | The string ".ee" contains all characters that are legal in an IP address string; |
| 111 | hence why the ACL parser is trying to resolve that IP address, and failing. As |
| 112 | a counterexample, ".us" works. |
| 113 | |
| 114 | <p> |
| 115 | One way of working around this issue is to explicitly put glob characters in |
| 116 | the string, so that the ACL parser can determine more easily that it is a DNS |
| 117 | glob, <i>e.g.</i>: |
| 118 | <pre> |
| 119 | Allow from *.ee |
| 120 | </pre> |
| 121 | Note that this issue <b>only</b> applies if IPv6 support is enabled. |
| 122 | |
| 123 | <p> |
| 124 | <hr> |
| 125 | <font size=2><b><i> |
| 126 | © Copyright 2017 The ProFTPD Project<br> |
| 127 | All Rights Reserved<br> |
| 128 | </i></b></font> |
| 129 | <hr> |
| 130 | |
| 131 | </body> |
| 132 | </html> |