jerrylipeng

jerrylipeng

1个粉丝

11

问答

0

专栏

0

资料

jerrylipeng  发布于  2016-04-08 11:08:49
采纳率 0%
11个问答
3999

dhcp显示获得ip,但网络不通

 
我尝试在3531板上用DHCP自动获得ip

/etc/network/interfaces的内容如下

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp


# ifup -af
MACADDR in set is de:0:91:33:a:f1
udhcpc (v1.16.1) started
Sending discover...
PHY: 1:01 - Link is Up - 1000/Full
Sending discover...
Sending select for 192.168.1.104...
Lease of 192.168.1.104 obtained, lease time 7200

# ifconfig
eth0      Link encap:Ethernet  HWaddr DE:00:91:33:0A:F1
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:270 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:56743 (55.4 KiB)  TX bytes:4720 (4.6 KiB)
          Interrupt:119

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)


看命令行输出应该是得到IP了吧,但是ifconfig看不到,ping192.168.1.1或者191.168.1.104也不通

这是什么回事啊?
我来回答
回答7个
时间排序
认可量排序

ngswfx

1个粉丝

55

问答

1

专栏

40

资料

ngswfx 2016-04-10 17:29:19
认可0
一看就没得到IP

eth0

qwh

0个粉丝

9

问答

0

专栏

0

资料

qwh 2016-04-10 22:10:40
认可0
[quote][url=forum.php?mod=redirect&goto=findpost&pid=28210&ptid=10903]ngswfx 发表于 2016-4-10 17:29[/url]
一看就没得到IP

eth0[/quote]

大神,帮我看下这个啊[url]http://www.ebaina.com/bbs/forum.php?mod=viewthread&tid=10929[/url]

qwh

0个粉丝

9

问答

0

专栏

0

资料

qwh 2016-04-10 22:11:22
认可0
楼主可以参考我这个。, 已经可以上网,只是用的是固定IP
[url]http://www.ebaina.com/bbs/forum.php?mod=viewthread&tid=10892[/url]

DarkQin

1个粉丝

8

问答

0

专栏

2

资料

DarkQin 2016-04-11 11:19:25
认可0
获取到ip,但是没有设置到网卡...需要检查一下指向的dhcp的配置文件是否正确,或者你根本就没有指向dhcp的配置文件

jerrylipeng

1个粉丝

11

问答

0

专栏

0

资料

jerrylipeng 2016-04-12 14:26:57
认可0
[quote][url=forum.php?mod=redirect&goto=findpost&pid=28220&ptid=10903]qwh 发表于 2016-4-10 22:11[/url]
楼主可以参考我这个。, 已经可以上网,只是用的是固定IP
http://www.ebaina.com/bbs/forum.php?mod=viewt ...[/quote]

我固定ip是可以的,就是dhcp不行

jerrylipeng

1个粉丝

11

问答

0

专栏

0

资料

jerrylipeng 2016-04-12 14:35:43
认可0
[quote][url=forum.php?mod=redirect&goto=findpost&pid=28228&ptid=10903]DarkQin 发表于 2016-4-11 11:19[/url]
获取到ip,但是没有设置到网卡...需要检查一下指向的dhcp的配置文件是否正确,或者你根本就没有指向dhcp的 ...[/quote]

非常感谢,请问这个文件一般是在哪里?

jerrylipeng

1个粉丝

11

问答

0

专栏

0

资料

jerrylipeng 2016-04-12 15:12:29
认可0
[quote][url=forum.php?mod=redirect&goto=findpost&pid=28228&ptid=10903]DarkQin 发表于 2016-4-11 11:19[/url]
获取到ip,但是没有设置到网卡...需要检查一下指向的dhcp的配置文件是否正确,或者你根本就没有指向dhcp的 ...[/quote]

非常感谢你的提示,问题已经解决。
需要将busybox/examples/udhcp/simple.script复制到板上/usr/share/udhcpc/default.script,并保证可执行(chmod +x)

正确的情况下输出为
udhcpc (v1.16.1) started
Setting IP address 0.0.0.0 on eth0
Sending discover...
PHY: 1:01 - Link is Up - 1000/Full
Sending discover...
Sending discover...
Sending select for 192.168.1.103...
Sending select for 192.168.1.103...
Lease of 192.168.1.103 obtained, lease time 216000
Setting IP address 192.168.1.103 on eth0
Deleting routers
route: SIOCDELRT: No such process
Adding router 192.168.1.1
Recreating /etc/resolv.conf
Adding DNS server 8.8.8.8
或将文件直接拖到这里
悬赏:
E币
网盘
* 网盘链接:
* 提取码:
悬赏:
E币

Markdown 语法

  • 加粗**内容**
  • 斜体*内容*
  • 删除线~~内容~~
  • 引用> 引用内容
  • 代码`代码`
  • 代码块```编程语言↵代码```
  • 链接[链接标题](url)
  • 无序列表- 内容
  • 有序列表1. 内容
  • 缩进内容
  • 图片![alt](url)
+ 添加网盘链接/附件

Markdown 语法

  • 加粗**内容**
  • 斜体*内容*
  • 删除线~~内容~~
  • 引用> 引用内容
  • 代码`代码`
  • 代码块```编程语言↵代码```
  • 链接[链接标题](url)
  • 无序列表- 内容
  • 有序列表1. 内容
  • 缩进内容
  • 图片![alt](url)
举报反馈

举报类型

  • 内容涉黄/赌/毒
  • 内容侵权/抄袭
  • 政治相关
  • 涉嫌广告
  • 侮辱谩骂
  • 其他

详细说明

易百纳技术社区