[ 路由 ] 不同操作系统下获取网管地址
网络作为重要的通讯协议是很复杂的,下面是在不同的操作系统中获取路由器的网管地址的命令
Mac
第一种
cat /etc/resolv.conf
liguanglei@liGuangleideMBP ~ % cat /etc/resolv.conf
#
# macOS Notice
#
# This file is not consulted for DNS hostname resolution, address
# resolution, or the DNS query routing mechanism used by most
# processes on this system.
#
# To view the DNS configuration used by this system, use:
# scutil --dns
#
# SEE ALSO
# dns-sd(1), scutil(8)
#
# This file is automatically generated.
#
nameserver 192.168.199.100
liguanglei@liGuangleideMBP ~ %
第二种
route -n get default
liguanglei@liGuangleideMBP ~ % route -n get default
route to: default
destination: default
mask: default
gateway: 192.168.199.100
interface: en7
flags: <UP,GATEWAY,DONE,STATIC,PRCLONING,GLOBAL>
recvpipe sendpipe ssthresh rtt,msec rttvar hopcount mtu expire
0 0 0 0 0 0 1500 0
Windows
ipconfig/all