In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "how to view and modify the Mac address of the network card under the Centos system". The explanation in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to view and modify the Mac address of the network card under the Centos system".
This article will introduce in detail the method of modifying the Mac address of the network card in centos system, the specific contents are as follows:
Add a line to the file / etc/sysconfig/network-scripts/ifcfg-eth0 similar to the following
MACADDR=00:04:AC:33:1C:3B
A: the MAC address is the physical address of the Nic. In fact, the MAC address can also be changed under Linux:
1) closed network card equipment
/ sbin/ifconfig eth0 down
2) modify MAC address
/ sbin/ifconfig eth0 hw ether MAC address
3) restart the network card
/ sbin/ifconfig eth0 up
How to modify the MAC address of network card under Red Hat Linux
OS version: Red Hat Enterprise Linux AS4
Core: Kernel 2.6.9-42
On the Internet, there are many ways to modify MAC addresses under linux, most of which seem to have not been verified and cannot achieve the purpose of modification.
After my detailed tests, I finally solved the problem successfully.
Misunderstanding one:
# ifconfig eth0 down / * disable eth0 Nic. Here, take eth0 Nic as an example * /
# ifconfig eth0 hw ether 00:AA:BB:CC:DD:EE / * modify the MAC address of the eth0 Nic * /
# ifconfig eth0 up / * restart the eth0 network card * /
Then restart the host.
Conclusion: the MAC address is modified according to this method, and the MAC address will be restored automatically after restarting the host system.
Misunderstanding 2:
# ifconfig eth0 down
# cd / etc/sysconfig/network-scripts
# vi ifcfg-eth0
Modify the "HWADDR=xx:xx:xx:xx:xx:xx" in it
# ifconfig eth0 up
# service network start
Conclusion: the network cannot be enabled after the MAC address is modified in this way, and the following prompt appears:
"Bringing up interface eth0: Device eth0 has different MAC address than expected,ignoring."
So, how to ensure the permanent preservation of the modified MAC address in the linux environment? The correct steps are as follows:
# ifconfig eth0 down
# cd / etc/sysconfig/network-scripts
# vi ifcfg-eth0
Change "HWADDR=xx:xx:xx:xx:xx:xx" to "MACADDR=xx:xx:xx:xx:xx:xx"
# ifconfig eth0 up
# service network start
Keywords: there is a difference between HWADDR and MACADDR.
Finally, the ifconfig command format is attached:
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 pm 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 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) Thank you for reading, this is the content of "how to View and modify the Mac address of Network Card under Centos system", after the study of this article I believe you have a deeper understanding of how to view and modify the Mac address of the network card under the Centos system, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.