A local network is interfaced with one or more external network elements
via a gateway that implements an address substitution mechanism for
ensuring that communications between devices attached to the local
network are not routed through an external network as a result of, e.g.,
disparity in their remotely-assigned Internet protocol (IP) addresses. In
accordance with the invention, the gateway is configured to intercept
communications from devices on the local network in order to determine
remotely-assigned IP address information for those devices. After such
information is determined for a given device, the gateway creates a set
of address substitution information that includes sub-network compatible
addresses for use by other devices on the local network when
communicating with the given device. Advantageously, the created address
substitution information when utilized by the other devices on the local
network to communicate with the given device ensures that such
communications are not routed outside the local network regardless of IP
address disparity between the devices.