AG广东会,山东十一选五,大发

?
  • AG广东会400电话
  • 微网小程序
  • AI电话山东十一选五
  • 电商代运营
  • AG广东会,山东十一选五,大发:全 部 栏 目

    AG广东会400电话 网络优化推广 AI电话山东十一选五 呼叫中心 网站建设 商标?知产 微网小程序 电商运营 彩铃?短信 增值拓展业务
    Shell脚本获取本地网卡IP、mac地址、子网掩码、dns IP、外网IP

    #/usr/bin/env bash
    
    # Name: get_network_info.sh
    # Author: Purple_Grape
    # This is a script to gather network information of your Linux system.
    # Test under Ubuntu 10.04 only.
    
    #----------------------------
    NIC=eth0
    MAC=`LANG=C ifconfig $NIC | awk '/HWaddr/{ print $5 }' `
    IP=`LANG=C ifconfig $NIC | awk '/inet addr:/{ print $2 }' | awk -F: '{print $2 }'`
    MASK=`LANG=C ifconfig $NIC | awk -F: '/Mask/{print $4}'`
    ext_ip=`curl ifconfig.me`
    
    if [ -f /etc/resolv.conf ];
    then
       dns=`awk '/^nameserver/{print $2}' /etc/resolv.conf `
    fi
    #----------------------------
    echo "Your network information is as below:"
    echo $MAC
    echo $IP
    echo $dns
    echo $ext_ip
    
    

    您可能感兴趣的文章:
    • 获取同一网段下所有机器MAC地址的shell脚本
    上一篇:Shell脚本中获取本机ip地址的3个方法
    下一篇:Shell脚本实现自动修改IP地址
  • 相关文章
  • ?

    ? 2016-2020 巨人网络通讯 版权所有

    《增值电信业务经营许可证》 苏ICP备15040257号-8

    Shell脚本获取本地网卡IP、mac地址、子网掩码、dns IP、外网IP Shell,脚本,获取,本地,网卡,

    AG广东会官网入口(中国)官方网站-IOS/Android通用版(2026已更新)