精华内容
参与话题
问答
  • udhcpd配置及使用

    千次阅读 2018-07-04 19:11:16
    udhcpd配置及使用 1. 修改/etc/udhcpd.conf 修改 interface ra0 #default: eth0 为对应网卡 解决error, Unable to open /var/lib/misc/udhcpd.leases for reading, 在板子上执行以下命令: # mkdir -p /var...

    udhcpd配置及使用

    1.

    修改/etc/udhcpd.conf

    修改 interface ra0 #default: eth0 为对应网卡

    解决error, Unable to open /var/lib/misc/udhcpd.leases for reading,

    在板子上执行以下命令:

    # mkdir -p /var/lib/misc/
    # touch /var/lib/misc/udhcpd.leases

    2.再次启动udhcpd进程

    # udhcpd /etc/udhcpd.conf &

    然后手机重连板子的wifi,手机获取到ip地址后,wifi无线连接成功。

    展开全文
  • Busybox内置的tftpd, ftpd, telnetd, udhcpd, udhcpc配置 Tftpd,ftpd可以由inetd来管理,telnetd理论上也可以由inetd来管理,但是目前开发板上我还调通,只能telnetd独立运行。 1. Tftpd 配置步骤: #mkdir...
     Busybox内置的tftpd, ftpd, telnetd, udhcpd, udhcpc配置

    Tftpd,ftpd可以由inetd来管理,telnetd理论上也可以由inetd来管理,但是目前开发板上我还没调通,只能telnetd独立运行。
    1.    Tftpd
    配置步骤:
    #mkdir /tftp_ftp_dir  //创建tftp server的根目录
    #vi /etc/inetd.conf  //配置inetd.conf文件,用inetd来管理tftpd,加入如下一行:
    69 dgram udp nowait root tftpd tftpd -c /tftp_ftp_dir
    #inetd  //启动inetd
    这样tftpd就作为daemon运行起来了。
    注:这种方式运行的tftpd在ps中看不到tftpd进程的运行。

    检查下配置结果:
    # netstat -alp
    Active Internet connections (servers and established)
    Proto  Recv-Q  Send-Q  Local Address      Foreign Address     State  PID/Program name   
    udp    0        0      0.0.0.0:69            0.0.0.0:*                789/inetd
    Active UNIX domain sockets (servers and established)
    Proto RefCnt Flags       Type       State         I-Node PID/Program name    Path

    接下来就是在客户端测试了。
    我尝试了以下三种测试方式:
    a)    在linux pc机上,直接运行tftp命令,连接到开发板上。可以连接上,但是get file会提示Error Code 0: malformed packet。网上有人说是ubuntu 8.10上默认的tftp因为封包协议问题不能工作,但是我用的是fedora 9的系统,我抓包看了下,tftp server回复的数据包有个tftp code的字段,确实有问题。目前还未想到解决的方法。
    b)    将开发板tftpd根目录下的文件test(如果没有test文件,可以自己手动创建一个)拷贝到pc上,在开发板上输入如下命令:
    #busybox tftp –l test –r test –p 192.168.0.22
    测试pc上可以成功接收文件,文件内容正确。
    c)    在windows pc上,采用3com tftp软件作为tftp client,测试从开发板下载文件成功。

    2.    Ftpd
    配置步骤:
    #mkdir /tftp_ftp_dir  //创建ftp server的根目录
    #vi /etc/inetd.conf  //配置inetd.conf文件,用inetd来管理tftpd,加入如下一行:
    21 stream tcp nowait root ftpd ftpd -w /tftp_ftp_dir
    #inetd  //启动inetd
    这样ftpd就作为daemon运行起来了。
    注:这种方式运行的ftpd在ps中看不到ftpd进程的运行。

    检查下配置结果:
    # netstat -alp
    Active Internet connections (servers and established)
    Proto  Recv-Q  Send-Q  Local Address      Foreign Address     State  PID/Program name   
    tcp       0      0      0.0.0.0:21         0.0.0.0:*         LISTEN    789/inetd
    Active UNIX domain sockets (servers and established)
    Proto RefCnt Flags       Type       State         I-Node PID/Program name    Path

    接下来就是在客户端测试了。
    在linux pc机上直接ftp数据:
    [root@fedora9 ~]# ftp 192.168.0.1
    可通过匿名用户anonymous登录
    ftp>lcd
    ftp>put test //将test文件上传到开发板的ftpd根目录下
    ftp>get test
    测试下载文件成功。

    3.    Telnetd
    Telnetd配置其实很简单,内核选项:
    Device Drivers --->
    Character devices
    [*] Unix98 PTY support                                                                                     
    [*] Legacy (BSD) PTY support
    (256) Maximum number of
    Busybox选项:
    # BusyBox -> Networking Utilities -> telnetd
    # BusyBox -> Networking Utilities -> Support standalone telnetd (not inetd only)
    应该就可以了。但是我这样配置完毕,在开发板上启动telnetd:
    telnetd -l /bin/login
    然后ps查看进程telnetd存在,netstat –alp查看23端口已被监听。
    在客户端telnet开发板,老是出现“Connection closed by foreign host”的提示信息,而且客户端一telnet连接,开发板上的telnetd进程就自动退出了。抓包发现tcp三次握手连接已经建立,就这个问题调试了一天,最后才知道没有挂在devpts文件系统。
    需要在开发板上mount一下就ok了。在开发板上输入如下命令:
    #mount –t devpts devpts /dev/pts

    但是目前如果采用inetd来管理telnetd,还是会出现“Connection closed by foreign host”的提示信息,原因现在还不清楚。

    4.    Udhcpd
    参考busybox中的examples,配置好udhcpd.conf,主要配置地址池(start, end, option subnet)、默认网关(opt router), dns(option dns)即可。然后执行:
    #udhcpd –fS /etc/udhcpd.conf
    就可以启动dhcp服务器了。Udhcpd在执行的时候可能会提示没有一个叫做udhcpd.release的文件,这个只要在相应的文件夹下创建即可。执行下面两条命令:
    #mkdir -p /var/lib/misc/
    #touch /var/lib/misc/udhcpd.leases

    注:要启dhcp服务,还必须保证对应的网口处于up的状态,并且已配置IP地址,否则执行udhcpd –fS /etc/udhcpd.conf会报错。

    5.    Udhcpc
    参看busybox的example/udhcp/下的simple.script脚本,将其改名为default.script(不改也无所谓),主要是因为busybox里面默认的目录文件是/usr/share/udhcpc/default.script
    注:一定要保证这个default.script的可执行权限。我之前就是因为这个问题调试了很久。
    可查看下default.script的内容:
    1. #!/bin/sh  
    2. # udhcpc script edited by Tim Riker <Tim@Rikers.org>   
    3. RESOLV_CONF="/etc/resolv.conf"  
    4. [ -n "$1" ] || { echo "Error: should be called from udhcpc"; exit 1; }  
    5. NETMASK=""  
    6. [ -n "$subnet" ] && NETMASK="netmask $subnet"  
    7. BROADCAST="broadcast +"  
    8. [ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"  
    9. case "$1" in  
    10.         deconfig)  
    11.                 echo "Setting IP address 0.0.0.0 on $interface"  
    12.                 ifconfig $interface 0.0.0.0  
    13.                 ;;  
    14.         renew|bound)  
    15.                 echo "Setting IP address $ip on $interface"  
    16.                 ifconfig $interface $ip $NETMASK $BROADCAST  
    17.                 if [ -n "$router" ] ; then  
    18.                         echo "Deleting routers"  
    19.                         while route del default gw 0.0.0.0 dev $interface ; do  
    20.                                 :  
    21.                         done  
    22.                         metric=0  
    23.                         for i in $router ; do  
    24.                                 echo "Adding router $i"  
    25.                                 route add default gw $i dev $interface metric $((metric++))  
    26.                         done  
    27.                 fi  
    28.                 echo "Recreating $RESOLV_CONF"  
    29.                 echo -n > $RESOLV_CONF-$$  
    30.                 [ -n "$domain" ] && echo "search $domain" >> $RESOLV_CONF-$$  
    31.                 for i in $dns ; do  
    32.                         echo " Adding DNS server $i"  
    33.                         echo "nameserver $i" >> $RESOLV_CONF-$$  
    34.                 done  
    35.                 mv $RESOLV_CONF-$$ $RESOLV_CONF  
    36.                 ;;  
    37. esac  
    38. exit 0  


    udhcpc的操作都在这个脚本里面。

    测试的时候,可以自己准备一台dhcp server,然后在开发板上运行如下命令:
    #udhcpc –i eth0 –s /usr/share/udhcpc/default.script
    展开全文
  • udhcpd配置文件

    千次阅读 2019-05-10 16:21:58
    转自:https://git.busybox.net/busybox/tree/examples/udhcp/udhcpd.conf?h=1_3_stable # Sample udhcpd configuration file (/etc/udhcpd.conf) # The start and end of the IP lease block start 192.168....
    转自:https://git.busybox.net/busybox/tree/examples/udhcp/udhcpd.conf?h=1_3_stable
    # Sample udhcpd configuration file (/etc/udhcpd.conf)
    
    # The start and end of the IP lease block
    
    start 		192.168.0.20	#default: 192.168.0.20
    end		192.168.0.254	#default: 192.168.0.254
    
    
    # The interface that udhcpd will use
    
    interface	eth0		#default: eth0
    
    
    # The maximim number of leases (includes addressesd reserved
    # by OFFER's, DECLINE's, and ARP conficts
    
    #max_leases	254		#default: 254
    
    
    # If remaining is true (default), udhcpd will store the time
    # remaining for each lease in the udhcpd leases file. This is
    # for embedded systems that cannot keep time between reboots.
    # If you set remaining to no, the absolute time that the lease
    # expires at will be stored in the dhcpd.leases file.
    
    #remaining	yes		#default: yes
    
    
    # The time period at which udhcpd will write out a dhcpd.leases
    # file. If this is 0, udhcpd will never automatically write a
    # lease file. (specified in seconds)
    
    #auto_time	7200		#default: 7200 (2 hours)
    
    
    # The amount of time that an IP will be reserved (leased) for if a
    # DHCP decline message is received (seconds).
    
    #decline_time	3600		#default: 3600 (1 hour)
    
    
    # The amount of time that an IP will be reserved (leased) for if an
    # ARP conflct occurs. (seconds
    
    #conflict_time	3600		#default: 3600 (1 hour)
    
    
    # How long an offered address is reserved (leased) in seconds
    
    #offer_time	60		#default: 60 (1 minute)
    
    # If a lease to be given is below this value, the full lease time is
    # instead used (seconds).
    
    #min_lease	60		#defult: 60
    
    
    # The location of the leases file
    
    #lease_file	/var/lib/misc/udhcpd.leases	#defualt: /var/lib/misc/udhcpd.leases
    
    # The location of the pid file
    #pidfile	/var/run/udhcpd.pid	#default: /var/run/udhcpd.pid
    
    # Everytime udhcpd writes a leases file, the below script will be called.
    # Useful for writing the lease file to flash every few hours.
    
    #notify_file				#default: (no script)
    
    #notify_file	dumpleases 	# <--- usefull for debugging
    
    # The following are bootp specific options, setable by udhcpd.
    
    #siaddr		192.168.0.22		#default: 0.0.0.0
    
    #sname		zorak			#default: (none)
    
    #boot_file	/var/nfs_root		#default: (none)
    
    # The remainer of options are DHCP options and can be specifed with the
    # keyword 'opt' or 'option'. If an option can take multiple items, such
    # as the dns option, they can be listed on the same line, or multiple
    # lines. The only option with a default is 'lease'.
    
    #Examles
    opt	dns	192.168.10.2 192.168.10.10
    option	subnet	255.255.255.0
    opt	router	192.168.10.2
    opt	wins	192.168.10.10
    option	dns	129.219.13.81	# appened to above DNS servers for a total of 3
    option	domain	local
    option	lease	864000		# 10 days of seconds
    
    
    # Currently supported options, for more info, see options.c
    #opt subnet
    #opt timezone
    #opt router
    #opt timesvr
    #opt namesvr
    #opt dns
    #opt logsvr
    #opt cookiesvr
    #opt lprsvr
    #opt bootsize
    #opt domain
    #opt swapsvr
    #opt rootpath
    #opt ipttl
    #opt mtu
    #opt broadcast
    #opt wins
    #opt lease
    #opt ntpsrv
    #opt tftp
    #opt bootfile
    
    
    # Static leases map
    #static_lease 00:60:08:11:CE:4E 192.168.0.54
    #static_lease 00:60:08:11:CE:3E 192.168.0.44
    
    展开全文
  • 下载最新版本: wget ...tar -jxvf busybox-1.25.1.tar.bz2 一、 交叉编译生成busybox 万能小宝贝工具: 修改 编译配置: Additon Crossfile: make menuconfig --&...

     

    下载最新版本:

    wget https://busybox.net/downloads/busybox-1.25.1.tar.bz2


    tar -jxvf busybox-1.25.1.tar.bz2

     

     

     一、 交叉编译生成busybox 万能小宝贝工具:

     

     

    修改 编译配置:

     

     

    Additon Crossfile:

    make menuconfig -->> Busybox Settings -->> Build Option -->> Corss Compile  prefix

     

    这里写上你 交叉编译工具链的路径:

    /home/hongzhunzhun/work/OpenWrt-SDK-sunxi-for-linux-x86_64-gcc-4.8-linaro_uClibc-0.9.33.2/staging_dir/toolchain-arm_cortex-a7+neon_gcc-4.8-linaro_uClibc-0.9.33.2_eabi/bin/arm-openwrt-linux-uclibcgnueabi-

     

     

     

     


    nsenter.c:(.text.nsenter_main+0x1b0): undefined reference to `setns'

    make menuconfig

    Linux System Utilities--->nsenter,去掉该选项,重新编译make,又出现如下错误:

     

     


    sync.c:(.text.sync_main+0x7c): undefined reference to `syncfs'

     

    make menuconfig

    Coreutils--->sync选项去掉,重新make编译通过,生成了busybox可执行文件。

     

     

     make && make install

     

     

     

     

    这一幕 好激动有木有:

     

     大功告成 !!!

     

     

     默认安装路径 在 主目录下面的  _install   目录 .

     

     

     UDHCPC:/sbin 目录

     UDHCPD:/usr/sbin 目录

     

     

     

     

    DHCPD 使用:

     


    3.配置udhcpd.conf
    vi udhcpd.conf


    4.创建 leases
    mkdir -p /var/lib/misc/
    touch /var/lib/misc/udhcpd.leases

     

    5.启动热点
    sh /opt/ipnc/program/wifi/wifi_ap.sh

    ./root/usr/sbin/udhcpd -f /etc/udhcpd.conf &

     

     

    附件 udhcpd.conf:

    # Sample udhcpd configuration file (/etc/udhcpd.conf)
    # Values shown are defaults
    
    # The start and end of the IP lease block
    start           192.168.43.20
    end             192.168.43.254
    
    # The interface that udhcpd will use
    interface        wlan0
    # The maximim number of leases (includes addresses reserved
    # by OFFER's, DECLINE's, and ARP conficts). Will be corrected
    # if it's bigger than IP lease block, but it ok to make it
    # smaller than lease block.
    #max_leases     254
    
    # The time period at which udhcpd will write out a dhcpd.leases
    # file. If this is 0, udhcpd will never automatically write a
    # lease file. Specified in seconds.
    #auto_time      7200
    
    # The amount of time that an IP will be reserved (leased to nobody)
    # if a DHCP decline message is received (seconds).
    #decline_time   3600
    
    # The amount of time that an IP will be reserved
    # if an ARP conflct occurs (seconds).
    #conflict_time  3600
    
    # How long an offered address is reserved (seconds).
    #offer_time     60
    
    # If client asks for lease below this value, it will be rounded up
    # to this value (seconds).
    #min_lease      60
    
    # The location of the leases file
    #lease_file     /var/lib/misc/udhcpd.leases
    
    # The location of the pid file
    #pidfile        /var/run/udhcpd.pid
    
    # Everytime udhcpd writes a leases file, the below script will be called.
    #notify_file                    # default: no script
    #notify_file    dumpleases      # useful for debugging
    
    # The following are bootp specific options, settable by udhcpd.
    #siaddr         192.168.0.22            #default: 0.0.0.0
    #sname          zorak                   #default: none
    #boot_file      /var/nfs_root           #default: none
    
    # The remainer of options are DHCP options and can be specifed with the
    # keyword 'opt' or 'option'. If an option can take multiple items, such
    # as the dns option, they can be listed on the same line, or multiple
    # lines. The only option with a default is 'lease'.
    # Examples:
    opt     dns     192.168.10.2 192.168.10.10
    option  subnet  255.255.255.0
    opt     router  192.168.10.2
    opt     wins    192.168.10.10
    option  dns     129.219.13.81   # appened to above DNS servers for a total of 3
    option  domain  local
    option  lease   864000          # 10 days of seconds
    
    # Currently supported options (for more info, see options.c):
    #opt subnet
    #opt timezone
    #opt router
    #opt timesrv
    #opt namesrv
    #opt dns
    #opt logsrv
    #opt cookiesrv
    #opt lprsrv
    #opt bootsize
    #opt domain
    #opt swapsrv
    #opt rootpath
    #opt ipttl
    #opt mtu
    #opt broadcast
    #opt wins
    #opt lease
    #opt ntpsrv
    #opt tftp
    #opt bootfile
    
    # Static leases map
    #static_lease 00:60:08:11:CE:4E 192.168.0.54
    #static_lease 00:60:08:11:CE:3E 192.168.0.44
    

      

     

    拿走不谢 !!!

     

    转载于:https://www.cnblogs.com/hongzhunzhun/p/6097277.html

    展开全文
  • udhcpc 和 udhcpd

    千次阅读 2017-02-28 10:38:08
    转载: ... 由于要使用网络通讯,所以不可避免的要用到dhcp。理想的网络通讯方式是下面3种都要支持:  1,接入已有网络。这便要求可以作为dhcp客户端。... 第3种情况没有什么好说的,简单说下前2
  • 其它关于 hostapd udhcpd 的热点配置,网上有很多资料,基本上一搜都能搜到,但是还是记录一下自己操作的过程,有时候有些问题可能不是网上讲到的吧。 准备 也就是确定一下,你的硬件是支持的,有 wifi 芯片的。 ...
  • 基于s3c2440平台rt3070工作在AP模式

    千次阅读 2016-02-25 17:39:24
    基于s3c2440平台rt3070工作在AP模式
  • BusyBox v1.20.0命令介绍(一)

    千次阅读 2018-03-08 15:07:29
    近日闲暇,花了点时间逐个查看了BusyBox v1.20.0的所有子命令,记录一下方便日后查阅。 命令合集 root@android:/ # busybox-smp BusyBox v1.20.0 (2012-08-22 21:36:24 CDT) multi-call binary. Copyright (C) ...
  • 嵌入式linux中的dhcp服务器

    千次阅读 2013-03-12 15:37:42
    2.busybox是否带有dhcp的应用,如无,则需要重新编译busybox,或者直接下一个独立的也可。 3.dhcp服务器在etc目录下的配置文件,udhcpd.conf 需要配置这个文件,包括分配的ip,dns等。 我的文件系统中直接具有dhcp...
  • Busybox命令详解

    千次阅读 2019-04-17 14:31:16
    转载地址:不详 ...BusyBox - The Swiss Army Knife of Embedded Linux SYNTAX busybox <applet> [arguments...] # or <applet> [arguments...] # if symlinked DESCRIPTION BusyBox comb...
  • Busybox 裁剪[Z]

    千次阅读 2011-03-30 11:24:00
    http://blogold.chinaunix.net/u2/75705/showart_1286345.html
  • 参考的博客: http://blog.csdn.net/skdev/article/details/45094637 ... 到官网下载 busybox 源码: https://busybox.net/downloads/ 下载写此博客时的最新源码: https://busybox.n...
  • BusyBox 支持的命令

    千次阅读 2018-08-03 14:58:04
    / # busybox BusyBox v1.22.1 (2015-05-08 13:56:24 CST) multi-call binary. BusyBox is copyrighted by many authors between 1998-2012. Licensed under GPLv2. See source distribution for detailed copyright....
  • busybox交叉编译+移植

    千次阅读 2015-12-17 10:54:43
    更新历史 ...我的工作SDK是Allwinner的A20裁剪code,没有android,取代的时camlinux——对busybox来说,区别。 一,环境准备 1.源码获取 推荐的办法是: $ CD A20 / camlinux / &&...
  • busybox中udhcpc的默认script脚本地址为#define DEFAULT_SCRIPT CONFIG_UDHCPC_DEFAULT_SCRIPT#define CONFIG_UDHCPC_DEFAULT_SCRIPT "/usr/share/udhcpc/default.script"我想之所以以它作为默认地址,...
  • Download Busybox image from http://www.busybox.net/downloads/binaries/1.21.1/ 2)  Because the /system partition is read-only by default. #remounts the /system and /vendor (if present
  • Busybox

    2019-09-25 14:25:51
    BusyBox - The Swiss Army Knife of Embedded Linux SYNTAX busybox <applet> [arguments...] # or <applet> [arguments...] # if symlinked DESCRIPTION BusyBox combi...
  • 转载地址:... 1 开发环境  宿主机:Ubuntu14.04(32bit)  开发板:Mini2440  BusyBox:1.24.2 ... 到BusyBox官网下源码并解压。... 进入BusyBox源码顶级目录执行下...
  • 2019独角兽企业重金招聘Python工程师标准>>> ...
  • linux busybox 1.25.x

    2016-11-19 23:22:27
    config BR2_PACKAGE_BUSYBOX  bool "BusyBox"  default y  help  The Swiss Army Knife of embedded Linux. It slices, it dices, it  makes Julian Fries.  http://busybox.net/
  • 查看本机硬件设备信息:常见的几个命令1、cat /proc/cpuinfo 查看cpu核心的信息2、lsusb 查看USB设备信息3、lspci 查看pci设备信息4、hal-device 查看所有硬件设备的详细信息Linux系统裁剪笔记之四busybox1....
  • Linux 2.6.36.2 + Busybox-1.17.4移植

    千次阅读 2011-11-17 22:55:02
    ***********************资源下载*********************** / Q) u4 G9 \0 O* F湖盟防御帮助中心1. Toolchain , z0 a: f7 `# v$ z+ d' L湖盟防御帮助中心wget -c ... " P% ?0

空空如也

1 2 3 4 5 ... 7
收藏数 140
精华内容 56
关键字:

udhcpd 没反应