Firefly开源社区

标题: sdk,固定IP地址 [打印本页]

作者: zhu19910626    时间: 2020-7-2 09:12
标题: sdk,固定IP地址
求大神告知,官方提供的sdk,在系统里修改哪个文件可以固定eth0的ip地址
作者: neutionwei    时间: 2020-7-2 11:53
你的是buildroot还是ubuntu?

作者: zhu19910626    时间: 2020-7-2 15:47
neutionwei 发表于 2020-7-2 11:53
你的是buildroot还是ubuntu?

ubuntu
作者: neutionwei    时间: 2020-7-2 16:11
[ 本帖最后由 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
复制代码



作者: zhu19910626    时间: 2020-7-2 16:35
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

作者: zhu19910626    时间: 2020-7-2 16:38
neutionwei 发表于 2020-7-2 16:11
[ 本帖最后由 neutionwei 于 2020-7-2 16:13 编辑 ]\n\n1、/etc/netplan目录下$cat 01-network-manager-all ...

还有大神! 怎么看是ubuntu或buildroot?
作者: neutionwei    时间: 2020-7-2 18:06
  1. cat /etc/issue
复制代码

作者: zhu19910626    时间: 2020-7-3 15:33
neutionwei 发表于 2020-7-2 18:06

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





欢迎光临 Firefly开源社区 (https://dev.t-firefly.com/) Powered by Discuz! X3.1