Title: FtpServer Configure passive ports Notice: 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. # Configure passive ports When the client wants to use a passive data connection, the server should provide the port to use. By default, FtpServer will choose any available port. However this can be overridden using the configuration for the [passive data connection](configuration_listeners.html). The allowed passive ports can then be specified as a single port (e.g. 20020), multiple ports (e.g. 20020, 20030, 20040) or a range of ports (e.g. 20020-20030). Ranges can be closed (e.g. 20020-20030) or open ended (e.g. 60000-). Open ended ranges start at 1 and end at 65535, that is, the range 60000- will allow all ports between 60000 and 65535. Any combination of specified values or ranges can be used. When the server has used up all passive ports (one per client doing passive data transfer), the next clients will have to wait for an available port. It is therefore advised to provide multiple passive ports. If a value (specific port or start or end of an range) is outside of the allowed values of 0 and 65535, an error will be thrown at startup. ## Examples: | | | |---|---| | 0 | Any available port is used as the passive port | | 123 | Port 123 will be used as the passive port | | 123,133 | Port 123 and 133 will be used as the passive port | | 123-125 | Any port in a range from 123 to 125 will be used as the passive port | | 123-125, 127, 129-130 | Any port in a range from 123 to 125, port 127 or in the range from 129 to 130 will be used as the passive port |