linux系统设置网卡

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

猜你喜欢

转载自blog.csdn.net/modi000/article/details/125196332