Method for obtaining public network IP address under Linux

  
        In the Linux environment, sometimes if you can't use the ifconfig command due to permissions or other reasons, you can use the following method to view the external network ip
1. How to view the public IP address under the LINUX server, you can use the following method:
curl http://members.3322.org/dyndns/getip
2. Enter curl ipinfo.io or curl ifconfig.me in the terminal to get the external network of the machine through the API provided by the IP address detection website. IP, or return all results in JSON format.

Copyright © Windows knowledge All Rights Reserved