ExternalAddress Property  
 

Get and set the external IP address used for passive mode data transfers.

Syntax

object.ExternalAddress[ = ipaddress ]

Remarks

When using passive mode file transfers, the server creates a second listening (passive) socket that is used to exchange data between the client and server. The client sends the PASV command, and the server responds with its IP address and the ephemeral port number that was selected for the transfer. If the server is located behind a router that performs Network Address Translation (NAT), the address that the server will return will typically be a non-routable IP address assigned to the local system on the LAN side of the network. Setting the ExternalAddress property will instruct the server to return a different IP address in response to the PASV command sent by the client. Typically you would use the address assigned to the router on the Internet side of the connection.

If the ExternalAddresss property is not assigned a specific address, reading this property value will cause the control to automatically determine its external IP address. This requires that you have an active connection to the Internet; checking the value of this property on a system that uses dial-up networking may cause the operating system to automatically connect to the Internet service provider. The control may be unable to determine the external IP address for the local host for a number of reasons, particularly if the system is behind a firewall or uses a proxy server that restricts access to external sites on the Internet. If the external address for the local host cannot be determined, the property will return an empty string.

This property will not change the IP address the server is using to listen for client connections. The only way to change the listening IP address is to stop and restart the server using the new address. This property only changes the IP address that is reported to clients when a passive data connection is used. Incorrect use of this property can prevent the client from establishing a data connection to the server. The address must be in the same address family as the local address that the server was started with. For example, if the server was started using an IPv4 address, the IP address assigned to this property cannot be an IPv6 address.

Data Type

String

See Also

ClientAddress Property, ServerAddress Property