前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >hostapd和dhcpd

hostapd和dhcpd

作者头像
全栈程序员站长
发布2022-08-31 14:47:45
5220
发布2022-08-31 14:47:45
举报

大家好,又见面了,我是你们的朋友全栈君。

hostapd.conf

代码语言:javascript
复制
##### hostapd configuration file ##############################################

interface=wlan0
ctrl_interface=/var/run/hostapd
ssid=rtwap
channel=6
wpa=2
wpa_passphrase=87654321
#bridge=br0



##### Wi-Fi Protected Setup (WPS) #############################################

eap_server=1

# WPS state
# 0 = WPS disabled (default)
# 1 = WPS enabled, not configured
# 2 = WPS enabled, configured
wps_state=2

uuid=12345678-9abc-def0-1234-56789abcdef0

# Device Name
# User-friendly description of device; up to 32 octets encoded in UTF-8
device_name=RTL8192CU

# Manufacturer
# The manufacturer of the device (up to 64 ASCII characters)
manufacturer=Realtek

# Model Name
# Model of the device (up to 32 ASCII characters)
model_name=RTW_SOFTAP

# Model Number
# Additional device description (up to 32 ASCII characters)
model_number=WLAN_CU

# Serial Number
# Serial number of the device (up to 32 characters)
serial_number=12345

# Primary Device Type
# Used format: <categ>-<OUI>-<subcateg>
# categ = Category as an integer value
# OUI = OUI and type octet as a 4-octet hex-encoded value; 0050F204 for
# default WPS OUI
# subcateg = OUI-specific Sub Category as an integer value
# Examples:
# 1-0050F204-1 (Computer / PC)
# 1-0050F204-2 (Computer / Server)
# 5-0050F204-1 (Storage / NAS)
# 6-0050F204-1 (Network Infrastructure / AP)
device_type=6-0050F204-1

# OS Version
# 4-octet operating system version number (hex string)
os_version=01020300

# Config Methods
# List of the supported configuration methods
config_methods=label display push_button keypad


##### default configuration #######################################

driver=rtl871xdrv
beacon_int=100
hw_mode=g
ieee80211n=1
wme_enabled=1
ht_capab=[SHORT-GI-20][SHORT-GI-40][HT40+]
wpa_key_mgmt=WPA-PSK
wpa_pairwise=CCMP
max_num_sta=8
wpa_group_rekey=86400

初次编译的官方下载的文件编译缺文件,采用利尔达发送过来的程序 存在网盘(20171128 3018-AP.rar)

dhcpd.conf

代码语言:javascript
复制
#
# Sample configuration file for ISC dhcpd for Debian
#
# $Id: dhcpd.conf,v 1.1.1.1 2002/05/21 00:07:44 peloy Exp $
#

# The ddns-updates-style parameter controls whether or not the server will
# attempt to do a DNS update when a lease is confirmed. We default to the
# behavior of the version 2 packages ('none', since DHCP v2 didn't
# have support for DDNS.)
ddns-update-style none;

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

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

# 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.

option subnet-mask 255.255.254.0;
option broadcast-address 192.168.1.255;
option routers 192.168.1.254;
option domain-name-servers 192.168.1.1, 192.168.1.2;
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.10 192.168.1.100;
range 192.168.1.150 192.168.1.200;
}

# This is a very basic subnet declaration.

#subnet 10.254.239.0 netmask 255.255.255.224 { 
   
# range 10.254.239.10 10.254.239.20;
# option routers rtr-239-0-1.example.org, rtr-239-0-2.example.org;
#}

# This declaration allows BOOTP clients to get dynamic addresses,
# which we don't really recommend.

#subnet 10.254.239.32 netmask 255.255.255.224 { 
   
# range dynamic-bootp 10.254.239.40 10.254.239.60;
# option broadcast-address 10.254.239.31;
# option routers rtr-239-32-1.example.org;
#}

# A slightly different configuration for an internal subnet.
#subnet 10.5.5.0 netmask 255.255.255.224 { 
   
# range 10.5.5.26 10.5.5.30;
# option domain-name-servers ns1.internal.example.org;
# option domain-name "internal.example.org";
# option routers 10.5.5.1;
# option broadcast-address 10.5.5.31;
# default-lease-time 600;
# max-lease-time 7200;
#}

# Hosts which require special configuration options can be listed in
# host statements. If no address is specified, the address will be
# allocated dynamically (if possible), but the host-specific information
# will still come from the host declaration.

#host passacaglia { 
   
# hardware ethernet 0:0:c0:5d:bd:95;
# filename "vmunix.passacaglia";
# server-name "toccata.fugue.com";
#}

# Fixed IP addresses can also be specified for hosts. These addresses
# should not also be listed as being available for dynamic assignment.
# Hosts for which fixed IP addresses have been specified can boot using
# BOOTP or DHCP. Hosts for which no fixed address is specified can only
# be booted with DHCP, unless there is an address range on the subnet
# to which a BOOTP client is connected which has the dynamic-bootp flag
# set.
#host fantasia { 
   
# hardware ethernet 08:00:07:26:c0:a5;
# fixed-address fantasia.fugue.com;
#}

# You can declare a class of clients and then do address allocation
# based on that. The example below shows a case where all clients
# in a certain class get addresses on the 10.17.224/24 subnet, and all
# other clients get addresses on the 10.0.29/24 subnet.

#class "foo" { 
   
# match if substring (option vendor-class-identifier, 0, 4) = "SUNW";
#}

#shared-network 224-29 { 
   
# subnet 10.17.224.0 netmask 255.255.255.0 { 
   
# option routers rtr-224.example.org;
# }
# subnet 10.0.29.0 netmask 255.255.255.0 { 
   
# option routers rtr-29.example.org;
# }
# pool { 
   
# allow members of "foo";
# range 10.17.224.10 10.17.224.250;
# }
# pool { 
   
# deny members of "foo";
# range 10.0.29.10 10.0.29.230;
# }
#}
# 

编译完成之后一开始无法使用 需要将wlan0的netmask设置一下和配置文件中的netmask同步参数才能生效。

发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/143287.html原文链接:https://javaforall.cn

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2022年5月2,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档