The following describes the procedure for swapping a NIC after stopping the system on RHEL7. The MAC address is changed after the NIC is swapped, so you need to modify the operating system configuration file.
Shut down the system.
# shutdown -h now
Swap the NIC.
Boot the system in single user mode.
Modify the operating system network configuration file. Change the HWADDR item according to the MAC address of the swapped NIC. If interface names are switched before and after swapping NICs, change the file name and the DEVICE item in accordance with the swapped interface name.
[For Fast switching mode, NIC switching mode, and GS linkage mode]
# vi /etc/sysconfig/network-scripts/ifcfg-ethX DEVICE=ethX BOOTPROTO=static HWADDR=YY:YY:YY:YY:YY:YY HOTPLUG=no BROADCAST=XXX.XXX.XXX.XXX IPADDR=XXX.XXX.XXX.XXX NETMASK=XXX.XXX.XXX.XXX NETWORK=XXX.XXX.XXX.XXX ONBOOT=yes TYPE=Ethernet
[For Virtual NIC mode]
# vi /etc/sysconfig/network-scripts/ifcfg-ethX DEVICE=ethX BOOTPROTO=static HWADDR=YY:YY:YY:YY:YY:YY HOTPLUG=no ONBOOT=yes DEVICETYPE=hanet
Reboot the system.
# shutdown -r now