Skip to content

Instantly share code, notes, and snippets.

@twelvejie
Last active November 3, 2025 01:44
Show Gist options
  • Select an option

  • Save twelvejie/cac8524acb467217367ee369723177c2 to your computer and use it in GitHub Desktop.

Select an option

Save twelvejie/cac8524acb467217367ee369723177c2 to your computer and use it in GitHub Desktop.

网络常用命令

查看局域网冲突ip,以及mac地址

sudo arp-scan --localnet -g \
| awk 'NR>2 && $1~/^[0-9]+\./ { ip=$1; mac=$2; cnt[ip]++; macs[ip]=(ip in macs)?macs[ip]","mac:mac } END { for(i in cnt) if(cnt[i]>1) printf "%s %d %s\n", i, cnt[i], macs[i] }' \
| sort -k2,2nr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment