V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
q84055472
V2EX  ›  宽带症候群

如何查看 IP 是否是否是公网 IP

  •  
  •   q84055472 · 330 天前 · 3248 次点击
    这是一个创建于 330 天前的主题,其中的信息可能已经有所发展或是发生改变。

    如何查看 IP 是否是否是公网 IP 116.23.174.

    IPv6 地址 240e:3b4:480:ca70:2d5f:db6d:10cd:

    21 条回复    2023-05-27 12:30:59 +08:00
    renfei
        1
    renfei  
       330 天前
    去查 保留 IP 地址段,只要不在保留地址段里,那就是公网 IP 咯
    zictos
        2
    zictos  
       330 天前
    贴一个 chatgpt 回答,明确告知是 chatgpt 回复应该是允许的吧?
    想要确定一个 IP 地址是否为公网 IP ,你需要首先理解公网 IP 和私有 IP 的区别。

    公网 IP 地址(也称为全球唯一 IP 地址)是在互联网上被路由的,并且可以直接访问的。而私有 IP 地址,也称为内部网络 IP 地址,是被保留用于局域网的,它们在互联网上是不可达的。

    IPv4 的私有 IP 地址范围如下:

    10.0.0.0 至 10.255.255.255
    172.16.0.0 至 172.31.255.255
    192.168.0.0 至 192.168.255.255
    IPv6 的私有地址(也称为唯一本地地址,ULA )的前缀通常为 fd00::/8 。

    根据你提供的 IP 地址,116.23.174.x (你未提供第四部分)属于公网 IP 地址,因为它不在任何 IPv4 的私有地址范围内。

    对于 IPv6 地址 240e:3b4:480:ca70:2d5f:db6d:10cd:xxxx (你未提供最后一部分),这也是一个公网 IP 地址,因为它不在 fd00::/8 这个范围内。

    在实际应用中,你也可以通过各种在线工具查询 IP 地址的属性,例如 IP 地址归属地查询工具,或者通过网络命令如 ping ,traceroute 等来检查 IP 地址的连通性。
    C47CH
        3
    C47CH  
       330 天前   ❤️ 1
    百度看 ip 是否与本机一致。
    brader
        4
    brader  
       330 天前
    贴到 ip138 去看看咯
    googlefans
        5
    googlefans  
       330 天前
    @C47CH 那也不一定吧 ip 是会变的
    tin3w5
        6
    tin3w5  
       330 天前 via iPhone
    省省吧!早些年某些大学里给每个学生分配的都是“伪公网”ip 。ip 地址都是 172.14.0.0/16 或者 69.54.x.x……说白了都是一些明知是国外的 ip 分配给你,你咋整?
    maybeonly
        7
    maybeonly  
       330 天前
    在机器上抓包
    找外边的别人 ping 你
    你能收到那边过来的 ping 包
    那就是公网
    q84055472
        8
    q84055472  
    OP
       330 天前 via Android
    @maybeonly 怎么用工具 ping ?
    tediorelee
        9
    tediorelee  
       330 天前
    是 openwrt 的话直接 socat 把 openwrt 的 webui 映射到公网试试看手机流量能不能访问就好了,我一般都这么干
    tool2d
        10
    tool2d  
       330 天前 via Android
    是不是公网 IP 意义不大,手机是公网 IP ,但是很多入站规则都被封了。
    一个被端口全封的公网,不是一个好公网。
    clino
        12
    clino  
       330 天前
    zhs227
        13
    zhs227  
       330 天前
    Rust 代码里有一个 isGlobal ,我觉得写的比较全面,可以看看。
    poplar50
        14
    poplar50  
       330 天前 via iPhone
    路由器查看你的 ip ,然后百度 ip ,看返回结果,如果两者一致,你就是公网 ip 。
    cwek
        15
    cwek  
       330 天前
    @maybeonly 如果家庭网络的话,还是隔着一层家内 NAT ,但一样是可以拿公网 IP 玩。
    cwek
        16
    cwek  
       330 天前   ❤️ 1
    v4 ,可以用路由跟踪,看第 2 跳的地址是什么,如果像 100.64.0.0/10 的,可能是 NAT444 ,平替的话,用 ping 设定 ttl 为 2 。
    v6 类似,不过现在 v6 不太可能给你上 NAT 。(有最简单的 NAT-PT )
    titanium98118
        17
    titanium98118  
       330 天前 via Android
    ipv6 肯定是公网的,ipv4 在多个网站查看的 ip 跟路由器上拨号取得的一样就是公网 ip
    Mikuchan
        18
    Mikuchan  
       330 天前
    找一个查 port 的网站,看自己路由器里映射出去的 port 能不能扫到
    alamak76
        19
    alamak76  
       329 天前
    ip2location.io 就可以了。

    {
    "ip": "116.23.174.1",
    "country_code": "CN",
    "country_name": "China",
    "region_name": "Guangdong",
    "city_name": "Guangzhou",
    "latitude": 23.127361,
    "longitude": 113.26457,
    "zip_code": "510140",
    "time_zone": "+08:00",
    "asn": "4134",
    "as": "Asia Pacific Network Information Centre",
    "isp": "ChinaNet Guangdong Province Network",
    "domain": "chinatelecom.com.cn",
    "net_speed": "DSL",
    "idd_code": "86",
    "area_code": "020",
    "weather_station_code": "CHXX0037",
    "weather_station_name": "Guangzhou",
    "mcc": "460",
    "mnc": "03/11",
    "mobile_brand": "China Telecom",
    "elevation": 11,
    "usage_type": "ISP/MOB",
    "address_type": "Unicast",
    "continent": {
    "name": "Asia",
    "code": "AS",
    "hemisphere": [
    "north",
    "east"
    ],
    "translation": {
    "lang": "en",
    "value": "Asia"
    }
    },
    "district": "-",
    "country": {
    "name": "China",
    "alpha3_code": "CHN",
    "numeric_code": 156,
    "demonym": "Chinese",
    "flag": "https://cdn.ip2location.io/assets/img/flags/cn.png",
    "capital": "Beijing",
    "total_area": 9596961,
    "population": 1439323776,
    "currency": {
    "code": "CNY",
    "name": "Chinese Yuan Renminbi",
    "symbol": "\u00a5"
    },
    "language": {
    "code": "ZH",
    "name": "Chinese"
    },
    "tld": "cn",
    "translation": {
    "lang": "en",
    "value": "China"
    }
    },
    "region": {
    "name": "Guangdong",
    "code": "CN-GD",
    "translation": {
    "lang": "en",
    "value": "Guangdong"
    }
    },
    "city": {
    "name": "Guangzhou",
    "translation": {
    "lang": null,
    "value": null
    }
    },
    "time_zone_info": {
    "olson": "Asia/Shanghai",
    "current_time": "2023-05-26T10:29:54+08:00",
    "gmt_offset": 28800,
    "is_dst": false,
    "sunrise": "05:42",
    "sunset": "19:05"
    },
    "geotargeting": {
    "metro": "-"
    },
    "ads_category": "IAB19-18",
    "ads_category_name": "Internet Technology",
    "is_proxy": false,
    "proxy": {
    "last_seen": 0,
    "proxy_type": "-",
    "threat": "-",
    "provider": "-"
    }
    }
    sunsumin37
        20
    sunsumin37  
       328 天前
    查看路由器的 wan 口 ip ,再百度本机 ip 地址,如果是相同的就是公网 ip ,但是意义不大,因为大部分人家里的公网 ip 会变,也就是动态公网 ip ,打个比方就是我们小区这一块都在一个大局域网里,但是确实是公网 ip
    S179276SP
        21
    S179276SP  
       328 天前
    trace 自己的 IP ,如果第一跳是自己的那就是公网 IP ,如果是**********那就不是。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1039 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 23:02 · PVG 07:02 · LAX 16:02 · JFK 19:02
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.