本机外网ip

更新时间:2023-03-15 12:24:26 阅读: 评论:0

姜虎东白丁-老鼠吃草吗

本机外网ip
2023年3月15日发(作者:结婚气球布置图片)

Shell脚本获取本地⽹卡IP、mac地址、⼦⽹掩码、

dnsIP、外⽹IP

#/usr/bin/envbash

#Name:get_network_

#Author:Purple_Grape

#ThisisascripttogathernetworkinformationofyourLinuxsystem.

#TestunderUbuntu10.04only.

#----------------------------

NIC=eth0

MAC=`LANG=Cifconfig$NIC|awk'/HWaddr/{print$5}'`

IP=`LANG=Cifconfig$NIC|awk'/inetaddr:/{print$2}'|awk-F:'{print$2}'`

MASK=`LANG=Cifconfig$NIC|awk-F:'/Mask/{print$4}'`

ext_ip=``

if[-f/etc/];

then

dns=`awk'/^namerver/{print$2}'/etc/`

fi

#----------------------------

echo"Yournetworkinformationisasbelow:"

echo$MAC

echo$IP

echo$dns

echo$ext_ip

本文发布于:2023-03-15 12:24:24,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/zuowen/1678854266263842.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

本文word下载地址:本机外网ip.doc

本文 PDF 下载地址:本机外网ip.pdf

上一篇:德国的城市
下一篇:返回列表
标签:本机外网ip
相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图