1、使用ssh登陆,使用以下命令设置静态ip。
sudo vim /etc/dhcpcd.conf
2、在dhcpcd.conf后添加以下内容:
sudo reboot
sudo vim /etc/dhcpcd.conf
2、在dhcpcd.conf后添加以下内容:
interface eth0(4.9.59-v7+版本后的网卡名称可能会不同,具体使用ifconfig查看,然后修改网卡)
static ip_address=你需要修改的IP/24
static routers=“你路由器的IP”
static domain_name_servers=你的路由器的IP 114.114.114.114(114是本市的DNS)8.8.8.8(谷歌提供的DNS)
3、保存后重启树莓派。sudo reboot