Attached is an application called ExtIP. The original intent was to simply recover the External IP address used by a NAT router, but it ended up being much more. In order to use this program, your router must support Universal Plug and Play (UPnP), which most home routers do. However, not all routers support all functions, as evidenced by the descriptions below. Our own router does not support querying of the Mapping Collection, so some of the functions have not been fully tested.
If your router does not support UPnP, or it has not been turned on, executing any of the functions will produce a message stating "UPnPNAT not Found!".
If you know the external port number of an existing mapping, you can enter that number and recover the External IP address used on the WAN (Wide Area Network), as well as the Internal IP address and the Internal port. The older "GetIpAddrTable" is used to recover the Internal IP address, and uses the last address in the table. If you have more than one active Network Interface, it could produce a wrong result. It will also not produce a correct External IP address if you are using a double NAT configuration (not recommended). (tested)
If you would like to find out the External IP address and you do not know the port number used, you can leave the port number blank, and the program will scroll through the mapping collection and return the first one it finds. (not tested)
Clicking on the Get Ports button will scroll through the port mapping collection and add the External ports to the list box. Clicking on one of them will add it to the External Port box. (not tested)
You can also add a port mapping by entering an External Port number and clicking on the "Add Port Map" button. Normally the Internal Port number matches the External Port, and it will default to that, or you can add a different number. If the port mapping already exists, it will error out. (tested)
You should also be able to delete a port mapping, but our router does not support that function. (not tested)
This program does not support IPv6, because IPv6 does not require the use of NAT.
J.A. Coutts
If your router does not support UPnP, or it has not been turned on, executing any of the functions will produce a message stating "UPnPNAT not Found!".
If you know the external port number of an existing mapping, you can enter that number and recover the External IP address used on the WAN (Wide Area Network), as well as the Internal IP address and the Internal port. The older "GetIpAddrTable" is used to recover the Internal IP address, and uses the last address in the table. If you have more than one active Network Interface, it could produce a wrong result. It will also not produce a correct External IP address if you are using a double NAT configuration (not recommended). (tested)
If you would like to find out the External IP address and you do not know the port number used, you can leave the port number blank, and the program will scroll through the mapping collection and return the first one it finds. (not tested)
Clicking on the Get Ports button will scroll through the port mapping collection and add the External ports to the list box. Clicking on one of them will add it to the External Port box. (not tested)
You can also add a port mapping by entering an External Port number and clicking on the "Add Port Map" button. Normally the Internal Port number matches the External Port, and it will default to that, or you can add a different number. If the port mapping already exists, it will error out. (tested)
You should also be able to delete a port mapping, but our router does not support that function. (not tested)
This program does not support IPv6, because IPv6 does not require the use of NAT.
J.A. Coutts