margins
This commit is contained in:
parent
b63a63cf98
commit
407f888765
1 changed files with 23 additions and 44 deletions
|
|
@ -1,8 +1,8 @@
|
|||
# Raspberry Pi Access Point
|
||||
|
||||
for the Raspberry Pi 3, I used [this page](https://frillip.com/using-your-raspberry-pi-3-as-a-wifi-access-point-with-hostapd/) except for the /etc/network/interface which I did as below.
|
||||
For the Raspberry Pi 3, I used [this page](https://frillip.com/using-your-raspberry-pi-3-as-a-wifi-access-point-with-hostapd/) except for the /etc/network/interface which I did as below.
|
||||
|
||||
Of course, first I had to do [Basic Raspberry Pi Set-up](https://wiki.rg.net/wiki/RaspberryPi).
|
||||
Of course, first I had to do [Basic Raspberry Pi Set-up](https://wiki.rg.net/wiki/RaspberryPi).
|
||||
|
||||
So I wanted to see the state of the USB card and driver
|
||||
|
||||
|
|
@ -16,15 +16,15 @@ Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
|
|||
Bus 001 Device 004: ID 0bda:8176 Realtek Semiconductor Corp. RTL8188CUS 802.11n WLAN Adapter
|
||||
```
|
||||
|
||||
Next was installing hostapd and some utilities
|
||||
Next was installing hostapd and some utilities
|
||||
|
||||
```
|
||||
sudo apt-get install hostapd bridge-utils iw iptables-persistent
|
||||
```
|
||||
|
||||
I wanted to run a wireless router, so followed, well adapted, the instructions at [http://qcktech.blogspot.com/2012/08/raspberry-pi-as-router.html](http://qcktech.blogspot.com/2012/08/raspberry-pi-as-router.html) and [http://learn.adafruit.com/setting-up-a-raspberry-pi-as-a-wifi-access-point/overview](http://learn.adafruit.com/setting-up-a-raspberry-pi-as-a-wifi-access-point/overview) and [http://secsup.net/index.php/shaded_grey/comments/comcast_consumer_ipv6_configuration_raspberry_pi_as_bridge_base_station/](http://secsup.net/index.php/shaded_grey/comments/comcast_consumer_ipv6_configuration_raspberry_pi_as_bridge_base_station/)
|
||||
I wanted to run a wireless router, so followed, well adapted, the instructions at [http://qcktech.blogspot.com/2012/08/raspberry-pi-as-router.html](http://qcktech.blogspot.com/2012/08/raspberry-pi-as-router.html) and [http://learn.adafruit.com/setting-up-a-raspberry-pi-as-a-wifi-access-point/overview](http://learn.adafruit.com/setting-up-a-raspberry-pi-as-a-wifi-access-point/overview) and [http://secsup.net/index.php/shaded_grey/comments/comcast_consumer_ipv6_configuration_raspberry_pi_as_bridge_base_station/](http://secsup.net/index.php/shaded_grey/comments/comcast_consumer_ipv6_configuration_raspberry_pi_as_bridge_base_station/)
|
||||
|
||||
Edit/create /etc/hostapd/hostapd.conf as follows:
|
||||
Edit/create /etc/hostapd/hostapd.conf as follows:
|
||||
|
||||
```
|
||||
interface=wlan0
|
||||
|
|
@ -42,13 +42,13 @@ wpa_pairwise=TKIP
|
|||
rsn_pairwise=CCMP
|
||||
```
|
||||
|
||||
And hack /etc/default/hostapd to the following (and be sure to remove the #ash)
|
||||
And hack /etc/default/hostapd to the following (and be sure to remove the #ash)
|
||||
|
||||
```
|
||||
DAEMON_CONF="/etc/hostapd/hostapd.conf"
|
||||
```
|
||||
|
||||
Then configure /etc/network/interfaces
|
||||
Then configure /etc/network/interfaces
|
||||
|
||||
```
|
||||
auto lo
|
||||
|
|
@ -62,19 +62,19 @@ auto wlan0
|
|||
address 100.64.64.1/24
|
||||
```
|
||||
|
||||
Running an access point requires a dhcp server
|
||||
Running an access point requires a dhcp server
|
||||
|
||||
```
|
||||
sudo apt-get install isc-dhcp-server
|
||||
```
|
||||
|
||||
In /etc/dhcp/dhcpd.conf, make it authoritative by uncommenting
|
||||
In /etc/dhcp/dhcpd.conf, make it authoritative by uncommenting
|
||||
|
||||
```
|
||||
#authoritative;
|
||||
```
|
||||
|
||||
and then hack
|
||||
and then hack
|
||||
|
||||
```
|
||||
default-lease-time 3600;
|
||||
|
|
@ -96,15 +96,15 @@ subnet 100.64.64.0 netmask 255.255.255.0 {
|
|||
}
|
||||
```
|
||||
|
||||
Network 192.168.2.0 is the ether over which I am working doing the install.
|
||||
Network 192.168.2.0 is the ether over which I am working doing the install.
|
||||
|
||||
And then start the dhcpd to test it
|
||||
And then start the dhcpd to test it
|
||||
|
||||
```
|
||||
sudo service isc-dhcp-server start
|
||||
```
|
||||
|
||||
Get autostart scripts
|
||||
Get autostart scripts
|
||||
|
||||
```
|
||||
sudo ln -s /etc/init.d/networking /etc/rc2.d/S00networking
|
||||
|
|
@ -112,15 +112,15 @@ sudo ln -s /etc/init.d/hostapd /etc/rc2.d/S02hostapd
|
|||
sudo ln -s /etc/init.d/isc-dhcp-server /etc/rc2.d/S02isc-dhcp-server
|
||||
```
|
||||
|
||||
That last may already exist from the apt-get install.
|
||||
That last may already exist from the apt-get install.
|
||||
|
||||
To allow forwarding, in /etc/sysctl.conf, uncomment
|
||||
To allow forwarding, in /etc/sysctl.conf, uncomment
|
||||
|
||||
```
|
||||
net.ipv4.ip_forward=1
|
||||
```
|
||||
|
||||
Set up the NAT in iptables
|
||||
Set up the NAT in iptables
|
||||
|
||||
```
|
||||
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
|
||||
|
|
@ -128,15 +128,15 @@ sudo iptables -A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -
|
|||
sudo iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT
|
||||
```
|
||||
|
||||
And the IPTABLE entry for the NAT
|
||||
And the IPTABLE entry for the NAT
|
||||
|
||||
```
|
||||
sudo iptables-save | tee /etc/iptables/rules.v4
|
||||
```
|
||||
|
||||
The `iptables-persistent` will see this id loaded on boot.
|
||||
The `iptables-persistent` will see this id loaded on boot.
|
||||
|
||||
It would be wise to test with
|
||||
It would be wise to test with
|
||||
|
||||
```
|
||||
# sudo iptables -t nat -S
|
||||
|
|
@ -153,7 +153,7 @@ sudo iptables-save | tee /etc/iptables/rules.v4
|
|||
-A FORWARD -i wlan0 -o eth0 -j ACCEPT
|
||||
```
|
||||
|
||||
Sad news
|
||||
Sad news
|
||||
|
||||
```
|
||||
# sudo /usr/sbin/hostapd -B -P /var/run/hostapd.pid /etc/hostapd/hostapd.conf
|
||||
|
|
@ -170,6 +170,8 @@ hostapd_free_hapd_data: Interface wlan0 wasn't started
|
|||
nl80211: deinit ifname=wlan0 disabled_11b_rates=0
|
||||
```
|
||||
|
||||
This hack helped
|
||||
|
||||
```
|
||||
cat > /etc/dnsmasq.conf << EOF
|
||||
interface=wlan0 # Use interface wlan0
|
||||
|
|
@ -182,30 +184,7 @@ dhcp-range=100.64.64.10,100.64.64.99,12h # Assign IP addresses between 100.64.64
|
|||
EOF
|
||||
```
|
||||
|
||||
strangely enough, this worked
|
||||
|
||||
```
|
||||
sudo apt remove hostapd
|
||||
sudo apt install hostapd
|
||||
[ 3.189542] usb 1-1.2: new high-speed USB device number 4 using dwc_otg
|
||||
[ 3.321819] usb 1-1.2: New USB device found, idVendor=0bda, idProduct=8176
|
||||
[ 3.330893] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
|
||||
[ 3.339977] usb 1-1.2: Product: 802.11n WLAN Adapter
|
||||
[ 3.346536] usb 1-1.2: Manufacturer: Realtek
|
||||
[ 3.352383] usb 1-1.2: SerialNumber: 00e04c000001
|
||||
[ 4.800101] udevd[157]: starting version 175
|
||||
[ 7.230707] bcm2708-i2s bcm2708-i2s.0: Failed to create debugfs directory
|
||||
[ 7.499568] usbcore: registered new interface driver rtl8192cu
|
||||
pi-3:/root# /usr/sbin/hostapd -B -P /var/run/hostapd.pid /etc/hostapd/hostapd.conf
|
||||
Configuration file: /etc/hostapd/hostapd.conf
|
||||
Failed to create interface mon.wlan0: -95 (Operation not supported)
|
||||
wlan0: Could not connect to kernel driver
|
||||
Using interface wlan0 with hwaddr b8:27:eb:b1:68:9f and ssid "rgnet"
|
||||
wlan0: interface state UNINITIALIZED->ENABLED
|
||||
wlan0: AP-ENABLED
|
||||
```
|
||||
|
||||
Set hostapd to auto-start, though I am not sure that this is needed
|
||||
Set hostapd to auto-start, though I am not sure that this is needed
|
||||
|
||||
```
|
||||
sudo update-rc.d hostapd enable
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue