萬盛學電腦網

您现在的位置: 萬盛學電腦網 >> 程式設計 >  >> 伺服器教學

FreeBSD 查看 IP 地址與 MAC 指令教學

操作步驟

  1. SSH 或本地登入 FreeBSD 系統。
  2. 執行 ifconfig -a 顯示所有網路介面資訊。

輸出範例解析

$ ifconfig -a
em0: flags=8843
    options=9b
    ether 00:0c:29:e2:ce:a2
    inet 192.168.1.195 netmask 0xffffff00 broadcast 192.168.1.255
    inet6 fe80::20c:29ff:fee2:cea2%em0 prefixlen 64 scopeid 0x2
    nd6 options=29
    media: Ethernet autoselect (1000baseT )
    status: active
plip0: flags=8810
    nd6 options=29
lo0: flags=8049
    options=600003
    inet6 ::1 prefixlen 128
    inet6 fe80::1%lo0 prefixlen 64 scopeid 0x5
    inet 127.0.0.1 netmask 0xff000000
    nd6 options=21

關鍵資訊:

  • inet 192.168.1.195 → IPv4 位址
  • ether 00:0c:29:e2:ce:a2 → MAC 位址

其他介面(plip0、lo0)為平行埠與回環介面,一般不需關注。

copyright © 萬盛學電腦網 all rights reserved