海思HOSTAP,DHCPC

1.libnl-3.2.25.tar.gz

./configure --prefix=/home/anyone/wifi/libnl --host=arm-linux
#make
#make install

2.HOSTAP

git clone git://w1.fi/srv/git/hostap.git

tar xzvf hostapd-x.y.z.tar.gz
复制一份默认的配置文件

cp defconfig .config
此时在libnl的文件夹下就可以看见include的头文件以及lib目录下的库文件。libnl编译完成。

接下来编译hostapd工具

进入hostapd的.config文件进行配置

CONFIG_DRIVER_NL80211=y
#driver_nl80211.c requires a rather new libnl (version 1.1) which may not be
#shipped with your distribution yet. If that is the case, you need to build
#newer libnl version and point the hostapd build to use it.
LIBNL=/your libnl path
CFLAGS += -I ( L I B N L ) / i n c l u d e L I B S + = − L (LIBNL)/include LIBS += -L (LIBNL)/includeLIBS+=L(LIBNL)/lib

最后编译:
sudo make

3.DHCPC

tar zxvf dhcp-4.2.5-P1.tar.gz

./configure CC=aarch64-himix100-linux-gcc --host=aarch64-himix100-linux --prefix=/home/ema/Desktop/hisi/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=aarch64-himix100-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} 
  1. 完成,然后退回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
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值