標題:
Raspberry Pi —— 怎样从network interface 从DHCP client 变为 static IP
[打印本頁]
作者:
角色
時間:
2019-2-7 22:08
標題:
Raspberry Pi —— 怎样从network interface 从DHCP client 变为 static IP
本帖最後由 角色 於 2019-2-7 22:20 編輯
怎样把interface从DHCP client改为static IP,以前有【1,2】,现在我们主要改动/etc/dhcpcd.conf
原来的conf:
...
# Example static IP configuration:
#interface eth0
#static ip_address=192.168.0.10/24
#static ip6_address=fd51:42f8:caae:d92e::ff/64
#static routers=192.168.0.1
#static domain_name_servers=192.168.0.1 8.8.8.8 fd51:42f8:caae:d92e::1
...
複製代碼
, 我们可以改为:
# For Raspberry Pi 3b server
interface eth0
static ip_address=192.168.55.20/24
static routers=192.168.55.1
static domain_name_servers=192.168.55.1 8.8.8.8
複製代碼
.
我们不用reboot device,reload上面信息:
systemctl restart dhcpcd
複製代碼
,
还有别的指令,如:
systemctl stop dhcpcd
systemctl start dhcpcd
複製代碼
.
References:
【1】
http://www.telecom-cafe.com/foru ... =Raspberry%2Bstatic
【2】
http://www.telecom-cafe.com/foru ... =Raspberry%2Bstatic
歡迎光臨 電訊茶室 (http://telecom-cafe.com/forum/)
Powered by Discuz! 7.2