debian

Debian下ifconfig命令格式

小樊
39
2025-07-09 01:18:07
栏目: 智能运维

在Debian系统中,ifconfig命令用于配置和显示网络接口的参数。其基本格式如下:

ifconfig [interface] [options]

以下是一些使用ifconfig命令的示例:

  1. 显示所有网络接口的信息:
ifconfig -a
  1. 启用名为eth0的网络接口:
ifconfig eth0 up
  1. 禁用名为eth0的网络接口:
ifconfig eth0 down
  1. 为名为eth0的网络接口添加IP地址192.168.1.100
ifconfig eth0 192.168.1.100 netmask 255.255.255.0 up
  1. 从名为eth0的网络接口删除IP地址192.168.1.100
ifconfig eth0 192.168.1.100 netmask 255.255.255.0 down
  1. 设置名为eth0的网络接口的MAC地址为00:11:22:33:44:55
ifconfig eth0 hw ether 00:11:22:33:44:55

请注意,ifconfig命令在较新的Debian版本中可能已被弃用,建议使用ip命令替代。

0
看了该问题的人还看了