mac
# 显示网络设备信息,但是在mac中会显示非常多的信息,让人不知所措ifconfig en0# man networksetup# networksetup – 是系统首选项中网络设置的配置工具。# 列出所有的硬件报告networksetup -listallhardwareports# ipconfig getpacket en0# getpacket interface-name# Prints to standard output the DHCP/BOOTP packet that the client accepted from the DHCP/BOOTP server. This command is useful to check what the server provided, and# whether the values are sensible. This command outputs nothing if DHCP/BOOTP is not active on the interface, or the attempt to acquire an IP address was unsuccessful.# arp -a 此命令返回arp表信息# arp表记录了,同一子网中主机ip地址与mac地址的对应关系arp -a# 查看路由表 http://www.edulinks.cn/2020/05/19/20200519-macos-route/# 路由信息中Flags的一些具体含义如下:# U = Up# G = Gateway# S = Static, e.g., default route added at boot time# H = Host-specific# C = Generate new (host-specific) routes on use# L = Valid link-layer (MAC) address# c = Cloned route# R = Reject route, known but unreachable routenetstat# 查看到达目标端点所经过的路由器 traceroute www.baidu.com



window
# 此命令查看ip地址信息ipconfig /all
linux