Extreme Thinking
CentOS 7 設定 eth0

2017-08-31


停用 NetworkManager 改用原本的 network ….不改也行 …習慣舊的

systemctl disable NetworkManager.service
systemctl stop NetworkManager.service
chkconfig network on

改 eth0 先改開機的 grub …./etc/sysconfig/grub

vi /etc/sysconfig/grub

GRUB_CMDLINE_LINUX, 在這行結尾的雙引號前加上這句:

net.ifnames=0 biosdevname=0

變成 :

GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="crashkernel=auto rhgb quiet net.ifnames=0 biosdevname=0"
GRUB_DISABLE_RECOVERY="true"

套用 grub

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

改 /etc/sysconfig/network-scripts/ifcfg-eth0 …

要將舊的拿掉

TYPE=Ethernet
BOOTPROTO=none
DEFROUTE=yes
PEERDNS=yes
IPV4_FAILURE_FATAL=no
PEERROUTES=yes
NAME=eth0
DEVICE=eth0
ONBOOT=yes
IPADDR=192.168.0.100
NETMASK=255.255.255.0
NM_CONTROLLED=no
HWADDR=00:0C:29:FF:FF:FF
GATEWAY=192.168.0.5