嵌入式开发者社区

标题: 文件系统中的dns无法存储 [打印本页]

作者: jinyi7016    时间: 2017-9-29 11:26
标题: 文件系统中的dns无法存储
硬件上:LAN8720,50M有源晶振,晶振上的时钟输出到CVIDEO_DIN1/RMII_MHZ_50_CLK引脚。
( b: U) {$ ^# f
2 `0 o* t& d' B6 q3 O* v5 D9 S2 f: L要设置为静态的IP。
6 S* `" P9 a! s" f4 ?! P- I2 |! F7 ~/etc/network/ interfaces 中的内容:- w( V' [' O, \1 X9 Q6 A( o
) Z# O. X- H. i1 P
# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)$ |8 _. e8 i/ j" [, l' ^

; U# o4 b6 {3 R/ _9 b# The loopback interface4 H" L% q& Z! b
auto lo
) H1 q7 M. w1 J! H% K/ S( ]iface lo inet loopback
- u! T) C( h2 C: \7 m8 e0 e
* m# v1 m$ A: Q" u# Wireless interfaces
% C* `: {' P' B6 Y( C% E! \$ eiface wlan0 inet dhcp
# z/ }' l1 G8 e4 N! Q        wireless_mode managed
8 a) K8 ]( F" r" v, V* N$ @' B        wireless_essid any9 z% h$ i7 V% o0 g- g& [$ x* g9 T
        wpa-driver wext
' {; ?, g( _$ \' E- n% L        wpa-conf /etc/wpa_supplicant.conf3 A  M" |% w, j% o

5 m$ u. k$ q% riface tiwlan0 inet dhcp4 c' Q4 I* l; x7 O$ P4 O- k' e$ Y% P& O2 n
        wireless_mode managed2 v$ O9 K$ _  g) _
        wireless_essid any
  |, W2 v0 K% a$ g% g- J9 C: o. W9 [2 \
iface atml0 inet dhcp* s. c6 v8 ~1 b. u8 u6 B
4 E7 q$ {6 ~" [# Z. H8 Z: y% h5 H. A# a
# Wired or wireless interfaces
8 ^' @6 b( ^& qauto eth0& ]* U1 B7 h$ L' G: i
#iface eth0 inet dhcp
4 ^5 Y* s5 O+ Yiface eth0 inet static
0 U9 F6 `3 ?; zaddress 192.168.11.170
0 i' v+ A/ j/ W" Lnetmask 255.255.255.0
; c, G$ `# E' D& m* q, o0 Ggateway 192.168.11.13 l0 p; d2 |2 B5 G6 j- J
, J3 U; }) r2 Q2 U5 N. N0 A

: N: T0 D- ?0 R" m #       pre-up /bin/grep -v -e "ip=[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+" /proc/cmdline > /dev/null% s  q/ K' q+ d3 E* O8 p  G
' E4 J) g; ^; A' D; M2 x
#iface eth1 inet dhcp5 `' ~' L& f. @" a
0 F  G6 b7 F6 J# h1 Z% u
# Ethernet/RNDIS gadget (g_ether)6 ^; e" m% g: n/ B3 M
# ... or on host side, usbnet and random hwaddr6 f7 X) P  @! }" F
iface usb0 inet dhcp
  F( T9 t- ^& s# ?
* C; B- L: y& P1 f9 G# Bluetooth networking" K$ u) s4 r5 U9 R2 |% ]  }
iface bnep0 inet dhcp2 n' H5 [% d, E) B7 R& M7 Y' w

# w* S( i2 _, A! y/ p7 \) a8 v- A  E1 s2 H* Z* A5 a
/etc/resolv.conf 配置了DNS,但是重启后,文件就又是空的了。( W. {8 K' H4 I% _/ l1 q( Q

6 S3 @3 }! @3 m# ]#ifconfig后的结果
' \& |% \/ ?/ F8 ceth0      Link encap:Ethernet  HWaddr 12:00:a0:35:3b:89  
+ ]# m5 x" _: S3 g' a          inet addr:192.168.11.170  Bcast:192.168.11.255  Mask:255.255.255.0. K# D" K3 Z& Q5 d3 D; H
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
  u/ u4 \' t. ?          RX packets:0 errors:0 dropped:0 overruns:0 frame:04 e  U9 B6 x! f) u) M* {
          TX packets:3 errors:0 dropped:0 overruns:0 carrier:0
  P- \- J  H, p8 }          collisions:0 txqueuelen:1000 ( R6 ~2 H& J6 {& [" c& [
          RX bytes:0 (0.0 B)  TX bytes:180 (180.0 B)
4 x; h" C1 r# [, U8 |& \. F/ y" P          Interrupt:33
  b" H: s7 S6 S6 H
7 T, \! f, {; v; U/ O  M6 g" Klo        Link encapocal Loopback  
1 j% j- g. R+ T$ i. w2 y, q          inet addr:127.0.0.1  Mask:255.0.0.0
4 j, h2 B# A8 ?          UP LOOPBACK RUNNING  MTU:16436  Metric:1% [- A( z  g5 L" J
          RX packets:165 errors:0 dropped:0 overruns:0 frame:0
1 h  V: A* d9 B) q1 \+ b7 r          TX packets:165 errors:0 dropped:0 overruns:0 carrier:02 A. Y3 `7 b3 @( R2 s/ v4 z4 [
          collisions:0 txqueuelen:0
& D5 B' V8 W: ^$ o' ^" V          RX bytes:246293 (240.5 KiB)  TX bytes:246293 (240.5 KiB)% B1 p! k+ G9 @7 `" t$ y

$ C9 F5 ^9 [% l" I  }( O& T+ r6 b9 J6 {/ W

, X' N0 R% R0 L6 l+ U2 v8 t1 M /etc/init.d/networking restart后会死机
, e2 D$ X; i& _" u4 \. c3 x
: N( [! O+ G0 q4 j* [
作者: jinyi7016    时间: 2017-9-29 12:04
目前网络可以通了,但是DNS存储问题没有解决
作者: 伊撒斯    时间: 2017-9-30 10:14
您好,设置静态ip可以ping通,但是DNS无法存储的话,请问您那边,是否有参照我们提供的哪个例程呢?如果您是需要使用网络文件系统,也可以参考我们的nfs开发环境搭建的参考文档。
作者: 伊撒斯    时间: 2017-9-30 10:15
[attach]2830[/attach]
作者: jinyi7016    时间: 2017-9-30 10:35
伊撒斯 发表于 2017-9-30 10:14
5 V2 l  A+ d: v; j% s, n您好,设置静态ip可以ping通,但是DNS无法存储的话,请问您那边,是否有参照我们提供的哪个例程呢?如果您 ...
3 u6 w) b6 W% y% s  _& O: {0 Q6 P
并不是NFS,只是网络的测试。
# l$ ^' a3 L( B8 i2 B就是 /etc/resolv.conf 中的内容添加了dns后,重启就会清空。而其他的文件并不会清空
作者: 伊撒斯    时间: 2017-9-30 19:03
您好:" I! {. u2 F* i# T. B& T

3 F+ y: s5 s$ K; L9 f1 y: ~     请问您指的是网络层面的dns存储吗?请问您那边,试过动态映射吗?现在研发工程师已下班,我下周再帮您跟进这个问题吧。
! f, n$ r3 A% j* N6 L( p- |) ~8 Z; J! V9 x" v. e" B3 k
     祝您中秋快乐,阖家团圆,身体健康,工作顺利!
作者: jinyi7016    时间: 2017-10-3 22:09
伊撒斯 发表于 2017-9-30 19:03
6 w: j! V8 c( M& n' U& s+ t+ J您好:
# Q  t' p) u1 V9 h% [: ?( V" Y/ V7 K$ Z
     请问您指的是网络层面的dns存储吗?请问您那边,试过动态映射吗?现在研发工程师已下班,我下 ...

+ t( S: L% ~( z7 X可能没有明白我的问题。我现在问的不是网络问题,是文件系统中的一个文件 /etc/resolv.conf,在启动后,其中的内容就没有了。每次重启后,这个文件就成了空的了。




欢迎光临 嵌入式开发者社区 (https://www.51ele.net/) Powered by Discuz! X3.4