sdk,固定IP地址

求大神告知,官方提供的sdk,在系统里修改哪个文件可以固定eth0的ip地址

你的是buildroot还是ubuntu?

neutionwei 发表于 2020-7-2 11:53
你的是buildroot还是ubuntu?

ubuntu

[ 本帖最后由 neutionwei 于 2020-7-2 16:13 编辑 ]\n\n1、/etc/netplan目录下$cat 01-network-manager-all.yaml

#Let NetworkManager manage all devices on this system
network:
  version: 2
  # renderer: NetworkManager
  ethernets:
          eth0:
                  addresses: [168.168.100.111/16]
                  gateway4:  168.168.0.1
                  dhcp4: no
                  dhcp6: no
                  nameservers:
                        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

#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.
#
# Entries in this file show the compile time defaults.
# You can change settings by editing this file.
# Defaults can be restored by simply deleting this file.
#
# See resolved.conf(5) for details

[Resolve]
DNS=127.0.0.53 114.114.114.114 114.114.115.115 8.8.8.8 8.8.4.4
#FallbackDNS=
#Domains=
#LLMNR=no
#MulticastDNS=no
#DNSSEC=no
#Cache=yes
#DNSStubListener=yes

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

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

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

cat /etc/issue

neutionwei 发表于 2020-7-2 18:06

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