ANALYSIS
Linux 每日一篇 - 41 - ifconfig
Linux 网络接口配置神器!掌握 ifconfig 命令,轻松管理网络接口,配置 IP 地址!
ifconfig 命令是什么?
ifconfig 是”Interface Configuration”的缩写,用于配置和显示网络接口参数的命令行工具,就像网络接口的”遥控器”。
基本用法
PRTCL // PLAINTEXT
# 显示所有网络接口信息ifconfig
# 显示指定网络接口信息ifconfig eth0
# 启用网络接口ifconfig eth0 up
# 禁用网络接口ifconfig eth0 down
# 为网络接口分配 IP 地址ifconfig eth0 192.168.1.100
# 设置网络接口的子网掩码ifconfig eth0 netmask 255.255.255.0
# 设置网络接口的广播地址ifconfig eth0 broadcast 192.168.1.255实用技巧
PRTCL // PLAINTEXT
# 显示所有接口(包括未激活的)ifconfig -a
# 设置网络接口的 MTU 值ifconfig eth0 mtu 1500
# 设置网络接口的 MAC 地址ifconfig eth0 hw ether 00:11:22:33:44:55
# 临时修改 IP 地址ifconfig eth0 10.0.0.10 netmask 255.255.255.0
# 查看接口统计信息ifconfig eth0
# 为接口添加别名ifconfig eth0:1 192.168.1.101常用场景
PRTCL // PLAINTEXT
# 查看网络接口状态ifconfig
# 启用网卡ifconfig eth0 up
# 禁用网卡ifconfig eth0 down
# 临时修改 IP 地址ifconfig eth0 192.168.1.100 netmask 255.255.255.0
# 重启网络服务ifconfig eth0 down && ifconfig eth0 up
# 查看特定接口信息ifconfig wlan0
# 临时设置网关(需配合 route 命令)ifconfig eth0 192.168.1.100route add default gw 192.168.1.1抖音文案
🎯 Linuxifconfig 命令!
✅ 基本用法:ifconfig ✅ 常用参数:ifconfig -option ✅ 实用技巧:ifconfig —help
每天一个 Linux 命令,30 天变身 Linux 高手!
#Linux 入门 #网络命令 #程序员必备 #技术分享
关于我
全平台同名”汪多多是只猫”,专注分享实用技术教程,让你的 IT 学习之路更轻松!
关注我,每天一个 Linux 命令,轻松入门 Linux 系统!
R P
Rhine Lab Pioneer Division
Auth_Verified: 2026.04.08
Auth_Verified: 2026.04.08
