How does the Linux system obtain the current export public network ip

Method 1: curl cip.cc

┌──(root㉿kali)-[/usr]
└─# curl cip.cc
IP      : 12.10.6.1
地址    : 中国  浙江  
运营商  : 联通

数据二  : 浙江省xxx | 联通

数据三  : 中国浙江省xxx | 联通

URL     : http://www.cip.cc/12.10.6.1

Method 2: curl https://ip.hao86.com

┌──(root㉿kali)-[/usr]
└─# curl https://ip.hao86.com
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
        <link rel="icon" href="https://static.hao86.com/images/ip.png" type="image/png" >
                <meta name="renderer" content="webkit"/>
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
        <meta http-equiv="Cache-Control" content="no-transform" />
        <meta name="applicable-device" content="pc,mobile" />
                <meta http-equiv="mobile-agent" content="format=xhtml; url=https://ipm.hao86.com/"/>
        <meta http-equiv="mobile-agent" content="format=html5; url=https://ipm.hao86.com/"/>
        <link rel="alternate" media="only screen and(max-width: 640px)" href="https://ipm.hao86.com/"/>
                        <title>ip地址查询_本机ip_我的ip地址_本地ip查询【内网 外网】</title>
        <meta name="keywords" content="ip,ip地址,ip地址查询,本机ip,我的ip,我的ip地址,查ip,ip查询,ip查询地址,本机ip地址查询"/>
        <meta name="description" content="好工具为您提供x'x'x'x'x'x'xxxxxxxx,IP地址
                    <script src="https://static.hao86.com/pc/common/js/hao86_output.js"></script>
    <link rel="stylesheet" href="https://static.hao86.com/pc/common/css/swiper.min.css">
    <link rel="stylesheet" href="https://static.hao86.com/pc/common/css/base.css">
    <link rel="stylesheet" href="https://static.hao86.com/pc/common/css/commonality.css?v=202109141850">
    <link rel="stylesheet" href="https://static.hao86.com/pc/layui-v2.6.8/layui/css/layui.css">
        <link rel="stylesheet" type="text/css" href="/oldtool/css/css.css" />
    <link rel="stylesheet" type="text/css" href="/oldtool/css/new_css/view.min.css" />

Method 3: Obtain the egress gateway, thereby reversing the egress ip, traceroute

This method is suitable for the case of multi-carrier egress

┌──(root㉿kali)-[/usr]
└─# traceroute baidu.com
traceroute to baidu.com (110.242.68.66), 30 hops max, 60 byte packets
 1  192.168.2.1 (192.168.2.1)  8.962 ms  8.704 ms  8.829 ms
 2  10.10.10.10 (10.10.10.10)  1.127 ms  1.158 ms  0.931 ms
 3  1.1.2.1 (1.1.2.1)  4.834 ms  5.724 ms  5.118 ms
 4  124.90.33.185 (124.90.33.185)  5.333 ms 101.68.76.65 (101.68.76.65)  6.238 ms 124.90.33.185 (124.90.33.185)  4.433 ms
 5  124.160.66.5 (124.160.66.5)  5.181 ms  6.083 ms  5.091 ms
 6  124.160.233.157 (124.160.233.157)  4.793 ms 101.71.244.33 (101.71.244.33)  7.344 ms  7.297 ms
 7  * 219.158.96.189 (219.158.96.189)  22.820 ms 219.158.118.45 (219.158.118.45)  25.430 ms
 8  110.242.66.174 (110.242.66.174)  34.400 ms 110.242.66.162 (110.242.66.162)  29.424 ms 110.242.66.166 (110.242.66.166)  34.260 ms
 9  221.194.45.130 (221.194.45.130)  32.247 ms  32.589 ms 221.194.45.134 (221.194.45.134)  30.163 ms

Guess you like

Origin blog.csdn.net/weixin_42517271/article/details/129175179