In Mobile Internet Protocol (Mobile IP), a foreign agent is a router serving as a mobility agent for a mobile node. As specified in IETF RFC 2002), a foreign agent works in conjunction with another type of mobility agent known as a home agent to support Internet traffic forwarding for a device connecting to the Internet from any location other than its home network.
The home agent tunnels datagrams (packets) intended for the mobile node to a care-of address, which is either the IP address for the foreign agent, or an IP address acquired through some external means, such as Dynamic Host Configuration Protocol (DHCP). The foreign agent detunnels packets and delivers them to the mobile node.
The operational mode using the foreign agent's static IP address as the care-of address was favored in the Internet Protocol version 4 (IPv4) environment (which has a limited number of IP addresses available), because it meant that many devices could use the same care-of address. However, because Internet Protocol version 6 (IPv6) virtually does away with address constraints, Mobile IPv6 (MIPv6) minimizes the use of foreign agents.