ifconfig
是一个用于配置和显示 Linux 内核中网络接口的命令行实用程序。它可以用来查看、配置、激活和停用网络接口,以及显示网络接口的统计信息。以下是 ifconfig
命令的一些常用选项和用法:
ifconfig
ifconfig eth0
ifconfig -s
ifconfig eth0 up
ifconfig eth0 down
ifconfig eth0 192.168.1.100 netmask 255.255.255.0
ifconfig eth0 release
ifconfig eth0 broadcast 192.168.1.255
ifconfig eth0 mtu 1500
ifconfig eth0 hw ether 00:11:22:33:44:55
请注意,ifconfig
命令在一些 Linux 发行版中可能已被弃用,取而代之的是 ip
命令。尽管如此,ifconfig
仍然在许多系统中广泛使用。要使用 ip
命令执行上述操作,请参考 ip
命令的手册页(通过运行 man ip
查看)。