#!/bin/bash
ifconfig|grep -E 'eth|inet'|grep -Ev '(inet6|127.0.0.1)'|sed 's/ /\n/g'|awk NF|grep -Ev '(inet|encap|Link|HWaddr)'|sed 's/00:/MAC:/g';route|grep default|awk '{print "\nGATEWAY:"$2}'
cat /etc/resolv.conf|grep nameserver|awk '{print "DNS:"$2}'
shell脚本查看网络配置
最新推荐文章于 2024-02-07 17:10:50 发布