![[구동확인] RPI-AP Setting / DHCP Setting](/nhc-explorer-cover.webp)
[구동확인] RPI-AP Setting / DHCP Setting
RPI-AP Setting / DHCP Setting
패키지 설치
sudo apt-get update
sudo apt-get install bridge-utils hostapd hostap-utils dnsmasq iw
sudo apt-get install udhcpd
===========================
기존의 hostapd를 교체 - 랜카드 드라이버로 인하여 (호환되는 랜카드 드라이버찾아야함 - 첨부된것은 iptime U100N Mini)
===========================
자료첨부 : 20150514182731_hostapd.zip
wget http://www.daveconroy.com/wp3/wp-content/uploads/2013/07/hostapd.zip
unzip hostapd.zip
혹시라도 작동중일지도 모르는, hostapd를 정지시키고 교체합니다.
sudo service hostapd stop
sudo cp hostapd /usr/sbin/hostapd
====================================
네트웍 설정
====================================
/etc/network
아래는 랜선1, 무선랜1, 무선랜2 이며 무선랜2번에 AP를 부여하는 경우이다
auto lo
iface lo inet loopback
auto eth0
allow-hotplug eth0
iface eth0 inet manual
Internet Access
auto wlan0
allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
Access point
iface wlan1 inet static
#bridge_ports eth0 wlan1
address 192.168.50.1
broadcast 192.168.50.255
netmask 255.255.255.0
up iptables-restore < /etc/iptables.ipv4.nat
====================================
/etc/default/udhcpd
====================================
DHCPD_ENABLED="yes"
====================================
/etc/udhcpd.conf
====================================
start 192.168.50.2 #default: 192.168.0.20
end 192.168.50.254 #default: 192.168.0.254
interface wlan1 #default: eth0
max_leases 254 #default: 254
remaining yes #default: yes
auto_time 7200 #default: 7200 (2 hours)
lease_file /var/lib/misc/udhcpd.leases #defualt: /var/lib/misc/udhcpd.leases
pidfile /var/run/udhcpd.pid #default: /var/run/udhcpd.pid
opt dns 192.168.50.2 192.168.50.255
option subnet 255.255.255.0
opt router 192.168.50.1
#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
====================================
Host AP 설정
====================================
/etc/default/hostapd
DAEMON_CONF="/etc/hostapd/hostapd.conf"
====================================
Host AP 환경설정
====================================
/etc/hostapd/hostapd.conf
interface=wlan1
driver=rtl871xdrv
bridge=wlan1
#parametes so that the daemon runs
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0
#the wifi configuration
ssid=ICARUSX-RPI-AP
channel=6
hw_mode=g
#Security of the Wifi conection
wpa=1
wpa_passphrase=ajdcjddl
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP CCMP
#Other setting
rsn_pairwise=CCMP
auth_algs=3
macaddr_acl=0
beacon_int=100
wmm_enabled=1
wme_enabled=1
====================================
/etc/resolv.conf
====================================
nameserver 61.41.153.2
nameserver 1.214.68.2
====================================
/etc/sysctl.conf
====================================
net.ipv4.ip_forward=1
====================================
/etc/rc.local
====================================
#AP
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
sudo iptables -A FORWARD -i eth0 -o wlan1 -m state --state RELATED,ESTABLISHED -j ACCEPT
sudo iptables -A FORWARD -i wlan1 -o eth0 -j ACCEPT
====================================
/etc/dnsmasq.conf
====================================
#no-resolv
domain-needed
interface=wlan1
dhcp-range=192.168.50.2,192.168.50.254,255.255.255.0,12h
Override the default route supplied by dnsmasq, which assumes the
router is the same machine as the one running dnsmasq.
#dhcp-option=3,1.2.3.4
dhcp-option=3,192.168.50.1
====================================
필수아님
====================================
Python-nmap 설치
====================================
sudo apt-get install python-nmap
//NMap 을 이용한 스캔
import nmap
nm = nmap.PortScanner()
nm.scan( arguments = "-v -sP 192.168.50.*" )
for addr in nm.all_hosts() :
item = nm[ addr ]
v = [ addr, item.hostname(), item.state() ]
print v,
===========================
Apache 추가설정
===========================
apache : /etc/httpd.conf
apache2 : /etc/apache2/conf.d/localized-error-pages
ErrorDocument 404 /missing.html
주석 제거 , 원하는 파일 생성 처리
===========================
서비스재시작
===========================
/etc/init.d/networking restart
sudo service networking restart
sudo service hostapd restart
sudo service dnsmasq restart
sudo service udhcpd restart
Leave [구동확인] RPI-AP Setting / DHCP Setting to:
Read more #rasberrypi posts
Best Posts From skysparrow
We have not curated any of skysparrow's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From skysparrow
- linux iptables 설명
- python kalman filter install / 파이썬 칼만필터 설치 / 라즈베리파이
- [구동확인] RPI-AP Setting / DHCP Setting
- 라즈베리파이 - gpio 설치 / rasberry pi GPIO
- python TG9e 서버모터 구동
- Apache2 서버에 CGI 셋팅
- 파이썬 소켓통신 <=> L3G4200D 자이로센서 값 받기
- [검증완료] GPS-Module GY-GPS6MV2 셋팅 / NEO-6M / GPS 데이터 뽑아쓰기
- 라즈베리파이 해상도 옵션 / rasberry pi resolution option
- 라즈베리파이를 AP 로 / Rasberry Pi for AP (wifi AP)