nat-api icon indicating copy to clipboard operation
nat-api copied to clipboard

The obtained external IP is not a real public IP address.

Open masx200 opened this issue 4 years ago • 1 comments

const NatAPI = require('nat-api')

const client = new NatAPI()


// Get external IP
client.externalIp(function(err, ip) {
  if (err) return console.log('Error', err)
  console.log('External IP:', ip)
})




External IP: 192.168.1.8


The obtained external IP is not a real public IP address.

You should request a website that can view the public IP address to get the real public external IP.

https://db-ip.com/

masx200 avatar Sep 03 '20 15:09 masx200

If the device is behind the multi-layer nat device, how to map the port to the external public ip?

https://www.ip.cn/

masx200 avatar Sep 03 '20 15:09 masx200