首页 > 其他 > 详细

树莓派4B-初始化网络-静态ip

时间:2021-05-02 16:21:28      阅读:34      评论:0      收藏:0      [点我收藏+]

连接有线网络启动

系统启动以后停到用户名密码画面,等待3分钟所有,或者连续数据多次用户名密码

用户名密码都是ubuntu

输入正确后,会提示修改用户密码,先输入旧密码,在连续输入2次新密码,进入系统

 

修改静态ip

ip addr 查看网络地址,可以看到网路地址已经存在:

但是每次启动有可能会变,改为固定ip

使用netplan修改

vi /etc/netplan/50-cloud-init.yaml

编辑内容如下:

# This file is generated from information provided by the datasource.  Changes
# to it will not persist across an instance reboot.  To disable cloud-inits
# network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
    ethernets:
        eth0:
            dhcp4: false
            optional: true
            addresses: [192.168.0.17/24]
            gateway4: 192.168.0.1
            nameservers:
                    addresses: [192.168.0.1]
    version: 2

高亮部分为修改或增加部分,注意要符合yaml规范,如果写对了会自动缩进。

保存退出【esc】 【:wq】

应用网络

netplan apply

 

树莓派4B-初始化网络-静态ip

原文:https://www.cnblogs.com/liubin0509/p/14725529.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!