Linux common commands-28: ifconfig

ifconfig command is used to view and configure network parameters. The information configured using the ifconfig command does not exist after the network card is restarted or the machine is restarted. If you want to save it forever, you need to modify the configuration file of the network card.

Syntax format: ifconfig [parameter]

Common parameters:

Example

 # 显示全部网络信息ifconfig

 # 查看指定网卡ifconfig enp0s25

 # 关闭网卡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

This article is reprinted from https://xugaoxiang.com/2022/06/07/linux-cmds-28-ifconfig/
This site is for inclusion only, and the copyright belongs to the original author.

Leave a Comment