hi3520DV300 移植 dhcpd

交叉编译工具:arm-hisiv300-linux -gcc

1.解压    配置   编译

   tar zxvf dhcp-4.2.5-P1.tar.gz

./configure CC=arm-hisiv300-linux-gcc --host=arm-hisiv300-linux  --prefix=/root/newdisk/Hi3521A_SDK_V1.0.3.0/wstapp/dhcp-4.2.5/install/  ac_cv_file__dev_random=yes     

2:   cd bind

             修改Makefile

             注释掉 gunzip -c bind.tar.gz | tar xf -;

             在cd ${bindsrcdir} && ./configure 后边加上   BUILD_CC=gcc ac_cv_file_dev_random=yes --host=arm-hisiv300-linux 即可

             tar zxvf  bind.tar.gz

              进入bind.tar.gz解压后的文件  ,修改vi lib/export/dns/Makefile.in 

                                                                      gen: ${srcdir}/gen.c
                                                                                      ${CC} ${ALL_CFLAGS} ${LDFLAGS} -o $@ ${srcdir}/gen.c ${LIBS}
                                                                       改为
                                                                      gen: ${srcdir}/gen.c
                                                                      ${BUILD_CC} ${ALL_CFLAGS} ${LDFLAGS} -o $@ ${srcdir}/gen.c ${LIBS} 

 

3. 完成,然后退回dhcp , make DESTDIR=$PWD/tmp install 

4

           把文件复制到NFS
            sudo cp bin/*   开发板的bin/
            sudo cp sbin/* 开发板sbin/
            sudo cp etc/dhclient.conf.example 开发板etc/dhclient.conf
            sudo cp etc/dhcpd.conf.example 开发板etc/dhcpd.conf


            sudo cp client/scripts/linux 开发板etc/dhclient-script
            chmod +x 开发板上的etc/dhclient-script
          

            并修改
                #!/bin/bash
                   改为
                #!/bin/sh

查看状态:netstat -nutap | grep dhcpd

执行: dhcpd wlan0 & 

wlan 是MT7601

 

dhcpd.conf  内容:

# dhcpd.conf
#
# Sample configuration file for ISC dhcpd
#

# option definitions common to all supported networks...
option domain-name "example.org";
option domain-name-servers ns1.example.org, 114.114.114.114;

default-lease-time 600;
max-lease-time 7200;

# Use this to enble / disable dynamic dns updates globally.
#ddns-update-style none;

# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.
#authoritative;

# Use this to send dhcp log messages to a different log file (you also
# have to hack syslog.conf to complete the redirection).
log-facility local7;

# No service will be given on this subnet, but declaring it helps the 
# DHCP server to understand the network topology.

# This is a very basic subnet declaration.

subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.40 192.168.0.50;
option broadcast-address 192.168.0.255;
option routers 192.168.0.1;
default-lease-time 600;
max-lease-time 7200;
option domain-name "local";
option domain-name-servers 8.8.8.8, 8.8.4.4;
}

此时需要将 wlan0 设置192.168.0.1  netmask 255.255.255.0

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值