程式教學

CentOS 7 設定固定IP

設定網卡

ifcfg-eth160,不一定,請依實際情況修改。

vi /etc/sysconfig/network-scripts/ifcfg-eth160

修改以下參數,即可。

BOOTPROTO="static"
IPADDR=192.168.0.108
NETMASK=255.255.255.0
GATEWAY=192.168.0.1

重啟

reboot

設定DNS

vi /etc/resolv.conf
nameserver 8.8.8.8
nameserver 8.8.4.4

完成~

Leave a Reply

Your email address will not be published. Required fields are marked *