openwrt 获取 wan 口 IP(公网IP)

ifconfig -a | grep inet | grep -v inet6 | grep -v 127.0.0.1 | grep -v 192.168.100.1 | grep -v 192.168.223.1 | grep -v 172.17.0.1 | awk '{print $2}' | tr -d "addr:"

 

posted @ 2022-07-22 10:24  Nihaorz  阅读(1305)  评论(0编辑  收藏  举报