Modify the NIC name in CENTOS7/RHEL7

Source: Internet
Author: User

1. disabling predictable naming rules

# Vim/etc/default/grub

Add two sentences: net.ifnames=0 biosdevname=0


Grub_timeout=5

Grub_default=saved

Grub_disable_submenu=true

grub_terminal_output= "Console"

grub_cmdline_linux= "Rd.lvm.lv=centos/root rd.lvm.lv=centos/swap net.ifnames=0 biosdevname=0 rhgb quiet"

Grub_disable_recovery= "true"


# grub2-mkconfig-o/boot/grub2/grub.cfg

Generating GRUB configuration file ...

Found Linux Image:/boot/vmlinuz-3.10.0-229.el7.x86_64

Found initrd Image:/boot/initramfs-3.10.0-229.el7.x86_64.img

Found Linux Image:/boot/vmlinuz-0-rescue-a8ecfd39a4014521ae54ccef4ada1c67

Found initrd Image:/boot/initramfs-0-rescue-a8ecfd39a4014521ae54ccef4ada1c67.img

Done


2. Modify the NIC configuration file

# cd/etc/sysconfig/network-scripts/

# MV Ifcfg-enoxxxxxx Ifcfg-eth0


3. Modify the name of the device

# Vim/etc/udev/rules.d/70-persistent-ipoib.rules

subsystem== "NET", action== "Add", drivers== "? *", attr{address}== "00:0c:29:e0:17:54", attr{type}== "1", kernel== "eth*", name= "eth0"


4, restart the system can



Mv/etc/yum.repos.d/centos-base.repo/etc/yum.repos.d/centos-base.repo.backup

Wget-o/etc/yum.repos.d/centos-base.repo Http://mirrors.aliyun.com/repo/Centos-7.repo

Yum Clean All

Yum Makecache



Systemctl Action Service name.

Yum-y Install Net-tools



CentOS 7.0 defaults to using firewall as the firewall, where the iptables firewall is changed.

Firewall

Systemctl Start firewalld.service# Startup firewall

Systemctl Stop firewalld.service# stops firewall

Systemctl Disable firewalld.service# disable firewall boot boot






Modify the NIC name in CENTOS7/RHEL7

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.