CentOS manually configure DHCP network

hosomikai
1 min readSep 23, 2020
Photo by Robynne Hu on Unsplash

STEP1. 編輯網卡的設定檔

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

靜態IP設定

DEVICE=eth0
BOOTPROTO=static
HWADDR=4c:32:75:8a:1a:23
IPADDR=10.88.201.9
NETMASK=255.255.255.0
ONBOOT=yes

使用DHCP動態分配IP

DEVICE=eth0
BOOTPROTO=dhcp
HWADDR=4c:32:75:8a:1a:23
ONBOOT=yes

STEP2. 儲存設定後,重新啟動網卡

$ /etc/init.d/network restart

or

$ service network restart

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

No responses yet

Write a response