gooutlook

https://www.cnblogs.com/10e-6/p/5778355.html

 

树莓派设置静态IP地址

 

首先终端输入:

 

ifconfig

 

查看树莓派默认分配的动态IP地址。

 image.png

图 1-4 配置静态IP地址

 

如图所示,作者的eth0 地址为192.168.1.108,wlan0地址为192.168.1.197。请注意:有些小伙伴的地址可能为192.168.0.xxx 、192.168.2.xxx甚至不以192.168开头,这都没有没有关系,请事先对你的地址做记录。

 

 

2.更新软件:

sudo apt-get update

 

3.安装vim:系统自带的vi非常不好用,使用vim会比较方便:

sudo apt-get install vim

 

4.设置有线网卡静态IP:

sudo vim /etc/dhcpcd.conf

 

首先 按 insert 按键开始编辑

复制内容

interface eth0
static ip_address=192.168.1.177/24
static router=192.168.1.1

 光标移动最下面 ,按 chrl+alt+v粘贴

chrl+c保存

之后 按 :wq 回车确认保存退出

5:重启树莓派:

sudo reboot

分类:

技术点:

相关文章:

  • 2021-11-01
  • 2021-10-16
  • 2021-11-20
  • 2021-11-30
  • 2021-10-16
  • 2021-11-30
猜你喜欢
  • 2021-10-16
  • 2021-09-02
  • 2021-05-21
  • 2021-11-30
  • 2021-10-16
相关资源
相似解决方案