busybox filesystem udhcpc 原理

/********************************************************************
 *               busybox filesystem udhcpc 原理
 * 声明:
 *     本文主要是记录busybox中的如何运用udhcpc获取IP,参考文章里写的
 * 很详细,不再累赘。
 *
 *                                 2016-1-23 深圳 南山平山村 曾剑锋
 *******************************************************************/

一、参考文章:
    BusyBox 應用 – udhcpc
        http://felix-lin.com/linux/busybox-%E6%87%89%E7%94%A8-udhcpc/

二、应用:
    1. 拷贝udhcpc脚本:
        cp busybox-1.24.1/examples/udhcp/simple.script <filesystem root>/usr/share/udhcpc/default.script
    2. 运行:
        udhcpc -b -S -p /var/run/udhcpc.pid

三、效果如下:
    udevd version 126 started
    zengjf login: root
    login[1423]: root login on 'ttymxc0'
    udhcpc (v1.24.1) started
    Setting IP address 0.0.0.0 on eth0
    eth0: Freescale FEC PHY driver [Generic PHY] (mii_bus:phy_addr=1:01, irq=-1)
    Sending discover...
    Unable to load library icui18n "Cannot load library icui18n: (icui18n: cannot open shared object file: No such file or directory)" 
    zengjf check QWSDisplay::requestRegion directServerConnection position.
    
    PHY: 1:01 - Link is Up - 100/Full
    Sending discover...
    Sending select for 10.0.1.52...
    Lease of 10.0.1.52 obtained, lease time 7200
    Setting IP address 10.0.1.52 on eth0
    Deleting routers
    route: SIOCDELRT: No such process
    Adding router 10.0.1.254
    Recreating /etc/resolv.conf
     Adding DNS server 8.8.8.8
     Adding DNS server 202.96.128.166
    [zengjf@root ~]# 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值