Firefly开源社区

打印 上一主题 下一主题

[Linux] sdk,固定IP地址

75

积分

0

威望

0

贡献

技术小白

积分
75

sdk,固定IP地址

发表于 2020-7-2 09:12:59      浏览:4180 | 回复:7        打印      只看该作者   [复制链接] 楼主
求大神告知,官方提供的sdk,在系统里修改哪个文件可以固定eth0的ip地址
回复

使用道具 举报

415

积分

0

威望

0

贡献

技术达人

Rank: 2

积分
415
发表于 2020-7-2 11:53:18        只看该作者  沙发
你的是buildroot还是ubuntu?
回复

使用道具 举报

75

积分

0

威望

0

贡献

技术小白

积分
75
发表于 2020-7-2 15:47:53        只看该作者  板凳
neutionwei 发表于 2020-7-2 11:53
你的是buildroot还是ubuntu?

ubuntu
回复

使用道具 举报

415

积分

0

威望

0

贡献

技术达人

Rank: 2

积分
415
发表于 2020-7-2 16:11:41        只看该作者  地板
[ 本帖最后由 neutionwei 于 2020-7-2 16:13 编辑 ]\n\n1、/etc/netplan目录下$cat 01-network-manager-all.yaml
  1. #Let NetworkManager manage all devices on this system
  2. network:
  3.   version: 2
  4.   # renderer: NetworkManager
  5.   ethernets:
  6.           eth0:
  7.                   addresses: [168.168.100.111/16]
  8.                   gateway4:  168.168.0.1
  9.                   dhcp4: no
  10.                   dhcp6: no
  11.                   nameservers:
  12.                         addresses: [127.0.0.53, 114.114.114.114, 114.114.115.115, 8.8.8.8, 8.8.4.4]
复制代码

2、/etc/systemd目录下$cat resolved.conf
  1. #  This file is part of systemd.
  2. #
  3. #  systemd is free software; you can redistribute it and/or modify it
  4. #  under the terms of the GNU Lesser General Public License as published by
  5. #  the Free Software Foundation; either version 2.1 of the License, or
  6. #  (at your option) any later version.
  7. #
  8. # Entries in this file show the compile time defaults.
  9. # You can change settings by editing this file.
  10. # Defaults can be restored by simply deleting this file.
  11. #
  12. # See resolved.conf(5) for details

  13. [Resolve]
  14. DNS=127.0.0.53 114.114.114.114 114.114.115.115 8.8.8.8 8.8.4.4
  15. #FallbackDNS=
  16. #Domains=
  17. #LLMNR=no
  18. #MulticastDNS=no
  19. #DNSSEC=no
  20. #Cache=yes
  21. #DNSStubListener=yes
复制代码


回复

使用道具 举报

75

积分

0

威望

0

贡献

技术小白

积分
75
发表于 2020-7-2 16:35:57        只看该作者  5#
neutionwei 发表于 2020-7-2 16:11
[ 本帖最后由 neutionwei 于 2020-7-2 16:13 编辑 ]\n\n1、/etc/netplan目录下$cat 01-network-manager-all ...

etc下没有netplan目录

root@firefly:/etc# ls ne
network/  networks  newt/
root@firefly:/etc# uname -a
Linux firefly 4.4.179 #2 SMP Tue Jun 30 20:10:12 CST 2020 aarch64 aarch64 aarch64 GNU/Linux
回复

使用道具 举报

75

积分

0

威望

0

贡献

技术小白

积分
75
发表于 2020-7-2 16:38:07        只看该作者  6#
neutionwei 发表于 2020-7-2 16:11
[ 本帖最后由 neutionwei 于 2020-7-2 16:13 编辑 ]\n\n1、/etc/netplan目录下$cat 01-network-manager-all ...

还有大神! 怎么看是ubuntu或buildroot?
回复

使用道具 举报

415

积分

0

威望

0

贡献

技术达人

Rank: 2

积分
415
发表于 2020-7-2 18:06:15        只看该作者  7#
  1. cat /etc/issue
复制代码
回复

使用道具 举报

75

积分

0

威望

0

贡献

技术小白

积分
75
发表于 2020-7-3 15:33:06        只看该作者  8#

root@firefly:~# cat /etc/issue
Ubuntu 16.04.5 LTS \n \l
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

友情链接 : 爱板网 电子发烧友论坛 云汉电子社区 粤ICP备14022046号-2
快速回复 返回顶部 返回列表