centos修改mac地址(centos更改ip地址的命令)

老铁们,大家好,相信还有很多朋友对于centos修改mac地址和centos更改ip地址的命令的相关问题不太懂,没关系,今天就由我来为大家分享分享centos修改mac地址以及centos更改ip地址的命令的问题,文章篇幅可能偏长,希望可以帮助到大家,下面一起来看看吧!

linux修改Mac地址

1、临时性的修改:

依次输入以下命令:

/sbin/ifconfig eth0 down

/sbin/ifconfig eth0 hw ether 00:0C:29:36:97:20

/sbin/ifconfig eth0 up

service network restart

2、永久性的修改:

vi/etc/sysconfig/network-scripts/ifcfg-eth0

添加MACADDR=00:0C:29:36:97:20

注释掉原来的HWADDR

:wq保存退出。

有危害,如果永久激活步骤错误则会造成无法联网的问题。

扩展资料:

误区

#ifconfig eth0 down/*禁掉eth0网卡,这里以eth0网卡为例*/

#ifconfig eth0 hw ether 00:AA:BB:CC:DD:EE/*修改eth0网卡的MAC地址*/

#ifconfig eth0 up/*重新启动eth0网卡*/

然后重新启动主机。

结论:按照这种方法修改MAC地址,重新启动主机系统后,MAC地址会自动还原。

Centos系统下查看和修改网卡Mac地址附ifconfig命令格式

本文将为大家详细的介绍centos系统修改网卡Mac地址的方法,具体内容如下:

在文件/etc/sysconfig/network-scripts/ifcfg-eth0中增加一行类似如下

MACADDR=00:04:AC:33:1C:3B

答:MAC地址是网卡的物理地址,其实在Linux下也可更改MAC地址:

1)闭网卡设备

/sbin/ifconfig eth0 down

2)修改MAC地址

/sbin/ifconfig eth0 hw ether MAC地址

3)重启网卡

/sbin/ifconfig eth0 up

Red Hat Linux下如何修改网卡MAC地址

OS版本:Red Hat Enterprise Linux AS4

核心:Kernel 2.6.9-42

网上有很多关于linux下修改MAC地址的方法,大多依葫芦画瓢,似乎都没验证过,达不到修改的目的。

经过我的详细测试,最终成功解决了这个问题。

误区一:

#ifconfig eth0 down/*禁掉eth0网卡,这里以eth0网卡为例*/

#ifconfig eth0 hw ether 00:AA:BB:CC:DD:EE/*修改eth0网卡的MAC地址*/

#ifconfig eth0 up/*重新启动eth0网卡*/

然后重新启动主机。

结论:按照这种方法修改MAC地址,重新启动主机系统后,MAC地址会自动还原。

误区二:

#ifconfig eth0 down

#cd/etc/sysconfig/network-scripts

#vi ifcfg-eth0

修改其中的"HWADDR=xx:xx:xx:xx:xx:xx"

#ifconfig eth0 up

#service network start

结论:按照这种方法修改MAC地址后将无法启用网络,会出现如下提示:

“Bringing up interface eth0: Device eth0 has different MAC address than expected,ignoring.”

那么,在linux环境下如何保证修改后的MAC地址永久保存呢?正确的步骤如下:

#ifconfig eth0 down

#cd/etc/sysconfig/network-scripts

#vi ifcfg-eth0

修改其中的"HWADDR=xx:xx:xx:xx:xx:xx"为"MACADDR=xx:xx:xx:xx:xx:xx"

#ifconfig eth0 up

#service network start

关键词:HWADDR和MACADDR是有区别的。

最后附ifconfig命令格式:

ifconfig--help Usage: ifconfig [-a] [-v] [-s] [[] ] [add [/

]] [del [/

]] [[-]broadcast []] [[-]pointopoint []] [netmask ] [dstaddr ] [tunnel ] [outfill ] [keepalive ] [hw ] [metric ] [mtu ] [[-]trailers] [[-]arp] [[-]allmulti] [multicast] [[-]promisc] [mem_start ] [io_addr ] [irq ] [media ] [txqueuelen ] [[-]dynamic] [up|down]...=Hardware Type. List of possible hardware types: loop(Local Loopback) slip(Serial Line IP) cslip(VJ Serial Line IP) slip6(6-bit Serial Line IP) cslip6(VJ 6-bit Serial Line IP) adaptive(Adaptive Serial Line IP) strip(Metricom Starmode IP) ash(Ash) ether(Ethernet) tr(16/4 Mbps Token Ring) tr(16/4 Mbps Token Ring(New)) ax25(AMPR AX.25) netrom(AMPR NET/ROM) rose(AMPR ROSE) tunnel(IPIP Tunnel) ppp(Point-to-Point Protocol) hdlc((Cisco)-HDLC) lapb(LAPB) arcnet(ARCnet) dlci(Frame Relay DLCI) frad(Frame Relay Access Device) sit(IPv6-in-IPv4) fddi(Fiber Distributed Data Interface) hippi(HIPPI) irda(IrLAP) ec(Econet) x25(generic X.25) infiniband(InfiniBand)=Address family. Default: inet List of possible address families: unix(UNIX Domain) inet(DARPA Internet) inet6(IPv6) ax25(AMPR AX.25) netrom(AMPR NET/ROM) rose(AMPR ROSE) ipx(Novell IPX) ddp(Appletalk DDP) ec(Econet) ash(Ash) x25(CCITT X.25)希望上文可以帮助到大家,需要的用户快来看看吧,想了解更多精彩教程请继续关注!

linux修改mac地址

linux修改mac地址需要分四步进行,下面是具体介绍:

1、查看网卡的MAC地址,ifconfig,可以看到HWaddr即是网卡物理地址;

2、修改前,将ifdown或者ifconfig网卡down,关闭网卡;

3、ifconfig网卡选项网卡类型值;

比如:把这个网卡改成00:0C:0C:0C:0C:0C,那么就是ifconfigeth0hwether00:0C:0C:0C:0C:0C。

4、打开网卡,ifup网卡,或者ifconfig网卡up即可。

以上就是小编今天的分享了,希望可以帮助到大家。

本文章基于thinkpadE15品牌、centos7系统撰写的。

阅读剩余
THE END