Fedora 23 設定固定IP

使用指定nmcli設定IP

Step1)顯示目前的網路卡介面,參數d表示dev(設備)

#nmcli d

DEVICE TYPE STATE CONNECTION

enp0s3 ethernet 已連線 enp0s3

lo loopback 不受管理的 --

Step2)設定IP,參數c表示con(連線)

#nmcli c modify enp0s3 ipv4.addresses 10.0.x.x/16

Step3)設定Gateway

#nmcli c modify enp0s3 ipv4.gateway 10.0.254.254

Step4)設定DNS server

#nmcli c modify enp0s3 ipv4.dns 10.0.x.x

Step5)以固定IP設定網卡

#nmcli c modify enp0s3 ipv4.method manual

Step6)停用啟用網卡

#nmcli c down enp0s3

#nmcli c up enp0s3

Step7)顯示目前網卡的設定

#nmcli d show enp0s3