日期:2014-05-16  浏览次数:20901 次

udhcpc无法自动设置IP的问题
各位大侠,我之前在TQ2410上可以通过udhcpc命令自动获取并设置网卡IP和系统DNS,但现在在TQ6410上,能获取到IP却不能自动设置网卡的IP了,谁知道哪里的问题啊?

[root@EmbedSky /]# ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 10:23:45:67:89:AB  
          inet addr:192.168.2.114  Bcast:192.168.2.255  Mask:255.255.255.0
          inet6 addr: fe80::1223:45ff:fe67:89ab/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:20313 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6489 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:4699394 (4.4 MiB)  TX bytes:299924 (292.8 KiB)
          Interrupt:108 Base address:0x8000 

[root@EmbedSky /]# udhcpc -i eth0
udhcpc (v1.16.0) started
Sending discover...
Sending select for 192.168.2.119...
Lease of 192.168.2.119 obtained, lease time 7200


[root@EmbedSky /]# ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 10:23:45:67:89:AB  
          inet addr:192.168.2.114  Bcast:192.168.2.255  Mask:255.255.255.0
          inet6 addr: fe80::1223:45ff:fe67:89ab/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:20358 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6491 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:4703778 (4.4 MiB)  TX bytes:301104 (294.0 KiB)
          Interrupt:108 Base address:0x8000
------解决方案--------------------
设置网卡的DHCP模式自动获得IP
netconfig -d eth0 --bootproto=dhcp