我使用智能手机 USB 共享互联网。
通过内部路由器连接时也是如此。
只能查到内网IP,看不到真实IP。
我怎样才能找到它。
是否配置
enp0s20f0u3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.42.228 netmask 255.255.255.0 broadcast 192.168.42.255
inet6 fe80::1e25:40f2:93d6:20fa prefixlen 64 scopeid 0x20<link>
ether 42:39:19:9d:ea:b3 txqueuelen 1000 (Ethernet)
RX packets 8831 bytes 6881241 (6.8 MB)
RX errors 3 dropped 0 overruns 0 frame 3
TX packets 7230 bytes 1269771 (1.2 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
enp4s0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether f4:8e:38:ee:82:17 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 2002 bytes 137278 (137.2 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2002 bytes 137278 (137.2 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
答案1
首先安装 curl:
sudo apt install curl
然后在终端中发出命令来获取你的公共 IP:
curl ipinfo.io/ip
答案2
在终端:
curl icanhazip.com