博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
树莓派静态配置IP地址
阅读量:3934 次
发布时间:2019-05-23

本文共 1003 字,大约阅读时间需要 3 分钟。

本人惨痛经历:由于当初只添加了无线配置,而没有添加有线配置。而且DHCP给树莓派分配的是动态IP地址。最后用树莓派制作路由器修改hostapd程序的配置文件的时候,SecureCRT远程登录断开,再去找IP链接的时候发现已经找不到了,无奈只好重新开始做。所以今天我要给树莓派配置静态IP地址。

将 /etc/network/interfaces 配置置空,如果没有配置则本来就是空的。

pi@raspberrypi:/etc/wpa_supplicant $ sudo vim /etc/network/interfaces

#interfaces(5) file used by ifup(8) and ifdown(8)#Please note that this file is written to be used with dhcpcd#For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'#Include files from /etc/network/interfaces.d:source-directory /etc/network/interfaces.d

修改有线/无线的配置:

#以太网有线配置interface eth0static ip_address=192.168.x.xstatic routers=192.168.x.1static domain_name_servers=114.114.114.114#无线接口配置interface wlan0static ip_address=192.168.x.ystatic routers=192.168.x.1static domain_name_servers=114.114.114.114

执行下面命令:

禁用树莓派网络服务

pi@raspberrypi:/etc/wpa_supplicant $ sudo systemctl disable networking
使用dhcpcd管理树莓派网络服务程序
pi@raspberrypi:/etc/wpa_supplicant $ sudo systemctl enable dhcpcd
重启生效
pi@raspberrypi:/etc/wpa_supplicant $ sudo reboot

转载地址:http://lyhgn.baihongyu.com/

你可能感兴趣的文章
set up BU Printer on ubuntu
查看>>
如何写CmakeList.txt文件使在qtcreator里面显示源文件
查看>>
Generative adversarial nets
查看>>
new函数的底层实现
查看>>
找不到FLANNConfig.cmake文件
查看>>
flann中关于数据的stride
查看>>
cv::Mat ptr 和 at 注意事项
查看>>
cuda更新过后, findcuda找不到怎么办?
查看>>
cast shared_ptr to shared_ptr
查看>>
CHECK opengl version
查看>>
scatter and gather in thrust
查看>>
block compressed sparse row (BSR) matrix format
查看>>
第一章 在VS2008下如何配置好CG环境
查看>>
disable the touchpad by shortcut on the ubuntu
查看>>
build openni with gcc 7
查看>>
install git-lfs on ubuntu and use it
查看>>
git submodule的工作原理
查看>>
709 SLIM
查看>>
specify gcc for MATLAB on ubuntu
查看>>
add matlab to launch bar on ubuntu
查看>>