欢迎访问我的网站,希望内容对您有用,感兴趣的可以加入免费知识星球。

Linux常用命令-28:ifconfig

常用命令 迷途小书童 2年前 (2022-06-07) 860次浏览 0个评论

ifconfig 命令用于查看和配置网络参数。使用 ifconfig 命令配置的信息,在网卡重启或机器重启后,配置就不存在。要想永远保存,就需要修改网卡的配置文件了。

语法格式:ifconfig [参数]

常用参数:

linux ifconfig

示例

# 显示全部网络信息
ifconfig

linux ifconfig

# 查看指定网卡
ifconfig enp0s25

linux ifconfig

# 关闭网卡eth0
ifconfig eth0 down

# 启动网卡eth0
ifconfig eth0 up 

# 设置ip地址
ifconfig eth0 192.168.1.100

# 设置ip和子网掩码
ifconfig eth0 192.168.1.100 netmask 255.255.255.0
喜欢 (0)

您必须 登录 才能发表评论!