Linux查看公有IP和私有IP的办法

mac2024-05-15  30

查看公有IP:

curl ifconfig.mecurl -4/-6 icanhazip.comcurl ipinfo.io/ipcurl api.ipify.orgcurl checkip.dyndns.orgdig +short myip.opendns.com @resolver1.opendns.comhost myip.opendns.com resolver1.opendns.comcurl ident.mecurl bot.whatismyipaddress.comcurl ipecho.net/plain

查看私有IP:

ifconfig -aip addr (ip a)hostname -I | awk '{print $1}'ip route get 1.2.3.4 | awk '{print $7}'(Fedora) Wifi-Settings→ click the setting icon next to the Wifi name that you are connected to → Ipv4 and Ipv6 both can be seennmcli -p device show
最新回复(0)