ifconfig
是一個用于配置和顯示網絡接口的命令行工具。在 Debian 系統中,ifconfig
命令的常用參數包括:
ifconfig
:不帶任何參數運行 ifconfig
命令將顯示所有活動網絡接口的詳細信息。
ifconfig interface
:指定要查看的網絡接口,例如 ifconfig eth0
將顯示名為 eth0 的網絡接口的信息。
ifconfig interface up
:啟用指定的網絡接口,例如 ifconfig eth0 up
。
ifconfig interface down
:禁用指定的網絡接口,例如 ifconfig eth0 down
。
ifconfig interface hw ether address
:更改指定網絡接口的 MAC 地址,例如 ifconfig eth0 hw ether 00:11:22:33:44:55
。
ifconfig interface inet address netmask mask
:為指定網絡接口分配 IP 地址和子網掩碼,例如 ifconfig eth0 inet 192.168.1.100 netmask 255.255.255.0
。
ifconfig interface broadcast address
:為指定網絡接口設置廣播地址,例如 ifconfig eth0 broadcast 192.168.1.255
。
ifconfig interface mtu size
:設置指定網絡接口的最大傳輸單元(MTU),例如 ifconfig eth0 mtu 1500
。
ifconfig -a
:顯示系統中所有網絡接口的信息,包括未激活的接口。
ifconfig -s
:以簡潔格式顯示所有網絡接口的統計信息。
請注意,ifconfig
命令在某些 Debian 版本中可能已被棄用,建議使用 ip
命令替代。