info, udhcpc (v0.9.9-pre) started
error, m
debug, Sending discover...
debug, Sending select for 192.168.1.2...
info, Lease of 192.168.1.2 obtained, lease time 86400
error, m
请教下各位这个错误怎么来的?如何排错?从打印来看貌似也获得了ip,为什么ifconfig命令查看依然未成功?(另外用busy box自带的udhcpc也是一样结果)。重新编译内核该选的感觉都选中了。
还有udhcpc运行是不是还要编写个脚本?
3 个解决方案
#1
重新编译了udhcpc,打开了调试模式,以下是输出信息:
info, udhcpc (v0.9.9-pre) started
info, adapter index 2
info, adapter hardware address 42:91:ee:ff:30:79
info, vforking and execle'ing /usr/share/udhcpc/default.script
error, m
info, entering raw listen mode
info, Opening raw socket on ifindex 2
info, adding option 0x35
info, adding option 0x3d
info, adding option 0x3c
debug, Sending discover...
info, Waiting on select...
info, unrelated/bogus packet
info, Waiting on select...
info, oooooh!!! got some!
info, adding option 0x35
info, adding option 0x3d
info, adding option 0x3c
info, adding option 0x32
info, adding option 0x36
debug, Sending select for 192.168.1.3...
info, Waiting on select...
info, oooooh!!! got some!
info, Lease of 192.168.1.3 obtained, lease time 86400
info, vforking and execle'ing /usr/share/udhcpc/default.script
error, m
info, entering none listen mode
Child exited with retcode = 0
Child exited with status 0
/usr/share/udhcpc/default.script这个东西必须要有吗?如何做?什么作用?
info, udhcpc (v0.9.9-pre) started
info, adapter index 2
info, adapter hardware address 42:91:ee:ff:30:79
info, vforking and execle'ing /usr/share/udhcpc/default.script
error, m
info, entering raw listen mode
info, Opening raw socket on ifindex 2
info, adding option 0x35
info, adding option 0x3d
info, adding option 0x3c
debug, Sending discover...
info, Waiting on select...
info, unrelated/bogus packet
info, Waiting on select...
info, oooooh!!! got some!
info, adding option 0x35
info, adding option 0x3d
info, adding option 0x3c
info, adding option 0x32
info, adding option 0x36
debug, Sending select for 192.168.1.3...
info, Waiting on select...
info, oooooh!!! got some!
info, Lease of 192.168.1.3 obtained, lease time 86400
info, vforking and execle'ing /usr/share/udhcpc/default.script
error, m
info, entering none listen mode
Child exited with retcode = 0
Child exited with status 0
/usr/share/udhcpc/default.script这个东西必须要有吗?如何做?什么作用?
#2
我把sample里的simple.script拷贝到上诉目录,问题依旧,simple.script:::
#!/bin/sh
# udhcpc script edited by Tim Riker <Tim@Rikers.org>
[ -z "$1" ] && echo "Error: should be called from udhcpc" && exit 1
RESOLV_CONF="/etc/resolv.conf"
[ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"
[ -n "$subnet" ] && NETMASK="netmask $subnet"
case "$1" in
deconfig)
/sbin/ifconfig $interface 0.0.0.0
;;
renew|bound)
/sbin/ifconfig $interface $ip $BROADCAST $NETMASK
if [ -n "$router" ] ; then
echo "deleting routers"
while route del default gw 0.0.0.0 dev $interface ; do
:
done
for i in $router ; do
route add default gw $i dev $interface
done
fi
echo -n > $RESOLV_CONF
[ -n "$domain" ] && echo search $domain >> $RESOLV_CONF
for i in $dns ; do
echo adding dns $i
echo nameserver $i >> $RESOLV_CONF
done
;;
esac
exit 0
#!/bin/sh
# udhcpc script edited by Tim Riker <Tim@Rikers.org>
[ -z "$1" ] && echo "Error: should be called from udhcpc" && exit 1
RESOLV_CONF="/etc/resolv.conf"
[ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"
[ -n "$subnet" ] && NETMASK="netmask $subnet"
case "$1" in
deconfig)
/sbin/ifconfig $interface 0.0.0.0
;;
renew|bound)
/sbin/ifconfig $interface $ip $BROADCAST $NETMASK
if [ -n "$router" ] ; then
echo "deleting routers"
while route del default gw 0.0.0.0 dev $interface ; do
:
done
for i in $router ; do
route add default gw $i dev $interface
done
fi
echo -n > $RESOLV_CONF
[ -n "$domain" ] && echo search $domain >> $RESOLV_CONF
for i in $dns ; do
echo adding dns $i
echo nameserver $i >> $RESOLV_CONF
done
;;
esac
exit 0
#3
问题解决,script的执行权限问题,这个问题载过不少跟头了
#1
重新编译了udhcpc,打开了调试模式,以下是输出信息:
info, udhcpc (v0.9.9-pre) started
info, adapter index 2
info, adapter hardware address 42:91:ee:ff:30:79
info, vforking and execle'ing /usr/share/udhcpc/default.script
error, m
info, entering raw listen mode
info, Opening raw socket on ifindex 2
info, adding option 0x35
info, adding option 0x3d
info, adding option 0x3c
debug, Sending discover...
info, Waiting on select...
info, unrelated/bogus packet
info, Waiting on select...
info, oooooh!!! got some!
info, adding option 0x35
info, adding option 0x3d
info, adding option 0x3c
info, adding option 0x32
info, adding option 0x36
debug, Sending select for 192.168.1.3...
info, Waiting on select...
info, oooooh!!! got some!
info, Lease of 192.168.1.3 obtained, lease time 86400
info, vforking and execle'ing /usr/share/udhcpc/default.script
error, m
info, entering none listen mode
Child exited with retcode = 0
Child exited with status 0
/usr/share/udhcpc/default.script这个东西必须要有吗?如何做?什么作用?
info, udhcpc (v0.9.9-pre) started
info, adapter index 2
info, adapter hardware address 42:91:ee:ff:30:79
info, vforking and execle'ing /usr/share/udhcpc/default.script
error, m
info, entering raw listen mode
info, Opening raw socket on ifindex 2
info, adding option 0x35
info, adding option 0x3d
info, adding option 0x3c
debug, Sending discover...
info, Waiting on select...
info, unrelated/bogus packet
info, Waiting on select...
info, oooooh!!! got some!
info, adding option 0x35
info, adding option 0x3d
info, adding option 0x3c
info, adding option 0x32
info, adding option 0x36
debug, Sending select for 192.168.1.3...
info, Waiting on select...
info, oooooh!!! got some!
info, Lease of 192.168.1.3 obtained, lease time 86400
info, vforking and execle'ing /usr/share/udhcpc/default.script
error, m
info, entering none listen mode
Child exited with retcode = 0
Child exited with status 0
/usr/share/udhcpc/default.script这个东西必须要有吗?如何做?什么作用?
#2
我把sample里的simple.script拷贝到上诉目录,问题依旧,simple.script:::
#!/bin/sh
# udhcpc script edited by Tim Riker <Tim@Rikers.org>
[ -z "$1" ] && echo "Error: should be called from udhcpc" && exit 1
RESOLV_CONF="/etc/resolv.conf"
[ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"
[ -n "$subnet" ] && NETMASK="netmask $subnet"
case "$1" in
deconfig)
/sbin/ifconfig $interface 0.0.0.0
;;
renew|bound)
/sbin/ifconfig $interface $ip $BROADCAST $NETMASK
if [ -n "$router" ] ; then
echo "deleting routers"
while route del default gw 0.0.0.0 dev $interface ; do
:
done
for i in $router ; do
route add default gw $i dev $interface
done
fi
echo -n > $RESOLV_CONF
[ -n "$domain" ] && echo search $domain >> $RESOLV_CONF
for i in $dns ; do
echo adding dns $i
echo nameserver $i >> $RESOLV_CONF
done
;;
esac
exit 0
#!/bin/sh
# udhcpc script edited by Tim Riker <Tim@Rikers.org>
[ -z "$1" ] && echo "Error: should be called from udhcpc" && exit 1
RESOLV_CONF="/etc/resolv.conf"
[ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"
[ -n "$subnet" ] && NETMASK="netmask $subnet"
case "$1" in
deconfig)
/sbin/ifconfig $interface 0.0.0.0
;;
renew|bound)
/sbin/ifconfig $interface $ip $BROADCAST $NETMASK
if [ -n "$router" ] ; then
echo "deleting routers"
while route del default gw 0.0.0.0 dev $interface ; do
:
done
for i in $router ; do
route add default gw $i dev $interface
done
fi
echo -n > $RESOLV_CONF
[ -n "$domain" ] && echo search $domain >> $RESOLV_CONF
for i in $dns ; do
echo adding dns $i
echo nameserver $i >> $RESOLV_CONF
done
;;
esac
exit 0
#3
问题解决,script的执行权限问题,这个问题载过不少跟头了