天天百科

linux怎么通过命令修改ipv4地址

2023-07-13 分类:百科

TIPS:本文共有 421 个字,阅读大概需要 1 分钟。

linux通过命令修改ipv4地址的方法很简单,跟着我的步骤做:

1、输入ifconfig命令查看网卡对应的IP地址

2、输入命令修改 ip

ifconfig  网卡   新的IP地址

例如:

ifconfig en0 192.168.1.1

3、同时修改IP和子网掩码

ifconfig eth0 192.168.1.4 netmask 255.255.255.0

通过命令设置好IP后,是保存在/etc/net.cfg文件中

4、启动和关闭网卡

ifconfig 网卡 up    --------启动指定网卡

ifconfig 网卡 down ------------关闭指定网卡

例如:

ifconfig eth0 up/down

5、修改mac地址

ifconfig  网卡  hw ether   mac地址

ifconfig eth0 hw ether 00:AA:BB:CC:DD:EE

如果觉得《linux怎么通过命令修改ipv4地址》对你有帮助,请点赞、收藏,并留下你的观点哦!

阅读剩余内容
网友评论
相关阅读
小编推荐