mac

  1. # 显示网络设备信息,但是在mac中会显示非常多的信息,让人不知所措
  2. ifconfig en0
  3. # man networksetup
  4. # networksetup – 是系统首选项中网络设置的配置工具。
  5. # 列出所有的硬件报告
  6. networksetup -listallhardwareports
  7. # ipconfig getpacket en0
  8. # getpacket interface-name
  9. # 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
  10. # 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.
  11. # arp -a 此命令返回arp表信息
  12. # arp表记录了,同一子网中主机ip地址与mac地址的对应关系
  13. arp -a
  14. # 查看路由表 http://www.edulinks.cn/2020/05/19/20200519-macos-route/
  15. # 路由信息中Flags的一些具体含义如下:
  16. # U = Up
  17. # G = Gateway
  18. # S = Static, e.g., default route added at boot time
  19. # H = Host-specific
  20. # C = Generate new (host-specific) routes on use
  21. # L = Valid link-layer (MAC) address
  22. # c = Cloned route
  23. # R = Reject route, known but unreachable route
  24. netstat
  25. # 查看到达目标端点所经过的路由器
  26. traceroute www.baidu.com

image.png
image.png
image.png

window

  1. # 此命令查看ip地址信息
  2. ipconfig /all

linux