ip

  • ip neigh 查看 arp table

  • ip route get <ip>: ask the kernel to report the route it would use to send a packet to the specified address (也是 gateway)

  • ip link: MAC address

    • 网桥 ip link add/delete mynet0 type bridge

    • 混杂模式 ip link set <interface> promisc on/off

  • ip address

    • ip address add/change/delete dev <interface> <addr>

  • ip route list: display all the IP addresses with their device names that are currently available

  • ip maddr show ens33 主机网卡上 MAC 地址,使用 macvlan 主机网卡会有多个 MAC 地址

  • ip netns 操作网络命名空间

    • ip netns add <ns-name>

    • ip netns exec <ns-name> <command>

    • ip netns help

Last updated

Was this helpful?