0
点赞
收藏
分享

微信扫一扫

树莓派设置静态IP

没有显示器的树莓派,要是使用dhcp获取IP,IP地址每次都不一样。要查看IP实在太麻烦了。百度了设置静态IP的方法,亲测有效。

  1. 登录终端
  2. 编辑/etc/dhcpcd.conf
$ sudo vi /etc/dhcpcd.conf
  1. 查找到# Example static IP configuration,该注释下面的就是静态IP的样例,照抄就是。
interface eth0  #网络接口
static ip_address=xxx.xxx.x.xx/xx  #静态ip地址
static ip6_address=xxxx:xxxx:xxxx:xxxx::xx/xx  #静态ip6_地址
static routers=xxx.xxx.x.xx  #静态路由器
static domain_name_servers=xxx.xxx.x.x 8.8.8.8 xxxx:xxxx:xxxx:xxxx::x  #静态域名服务器
  1. 重启系统
$ sudo reboot
举报

相关推荐

0 条评论