Trouble making my Raspberry Pi 2 B+ a Wifi Access Point


#1

Hi all, I can’t quite get my Pi to work as a wifi access point. I’ve followed this tutorial (https://learn.adafruit.com/downloads/pdf/setting-up-a-raspberry-pi-as-a-wifi-access-point.pdf) and a few others, but none of them work. I get to the end, and my network shows up and I can connect to it, but I don’t have any internet capabilities – pages take forever to load and then don’t show, emails never send, etc. I do the troubleshooting tests, and they all work except for when I try to ping 8.8.8.8 and www.mit.edu. Hoping someone can give me some advice and point me in the right direction.

/etc/network/interfaces
> auto lo
> iface lo inet loopback

> auto eth0
> allow-hotplug eth0
> iface eth0 inet manual

> allow-hotplug wlan0

> iface wlan0 inet static
>  address 192.168.42.1
>  netmask 255.255.255.0

> #auto wlan0
> i#face wlan0 inet manual
> #wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

> #auto wlan1
> #allow-hotplug wlan1
> #iface wlan1 inet manual
> #wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

> up iptables-restore < /etc/iptables.ipv4.nat

/etc/default/isc-dhcp-server

#
# Sample configuration file for ISC dhcpd for Debian
#
#
# 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;
...
subnet 192.168.42.0 netmask 255.255.255.0 {
 range 192.168.42.10 192.168.42.50;
 option broadcast-address 192.168.42.255;
 option routers 192.168.42.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;
}

/etc/hostapd/hostapd.conf

    interface=wlan0
    driver=rtl871xdrv
    ssid=communityclouds
    hw_mode=g
    channel=6
    macaddr_acl=0
    auth_algs=1
    ignore_broadcast_ssid=0
    wpa=2
    wpa_passphrase=communityclouds
    wpa_key_mgmt=WPA-PSK
    wpa_pairwise=TKIP
    rsn_pairwise=CCMP

ifconfig -a

lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
options=3<RXCSUM,TXCSUM>
inet6 ::1 prefixlen 128
inet 127.0.0.1 netmask 0xff000000
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
nd6 options=1
gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280
stf0: flags=0<> mtu 1280
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=10b<RXCSUM,TXCSUM,VLAN_HWTAGGING,AV>
ether 10:dd:b1:d8:9c:0d
nd6 options=1
media: autoselect (none)
status: inactive
en1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether 88:1f:a1:22:34:34
inet6 fe80::8a1f:a1ff:fe22:3434%en1 prefixlen 64 scopeid 0x5
inet 192.168.42.12 netmask 0xffffff00 broadcast 192.168.42.255
nd6 options=1
media: autoselect
status: active
en2: flags=963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX> mtu 1500
options=60<TSO4,TSO6>
ether d2:00:16:67:67:80
media: autoselect
status: inactive
fw0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 4078
lladdr 44:fb:42:ff:fe:66:76:78
nd6 options=1
media: autoselect
status: inactive
p2p0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 2304
ether 0a:1f:a1:22:34:34
media: autoselect
status: inactive
awdl0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1484
ether 86:69:1d:94:9c:d8
inet6 fe80::8469:1dff:fe94:9cd8%awdl0 prefixlen 64 scopeid 0xa
nd6 options=1
media: autoselect
status: active
bridge0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=63<RXCSUM,TXCSUM,TSO4,TSO6>
ether 12:dd:b1:8d:c4:00
Configuration:
id 0:0:0:0:0:0 priority 0 hellotime 0 fwddelay 0
maxage 0 holdcnt 0 proto stp maxaddr 100 timeout 1200
root id 0:0:0:0:0:0 priority 0 ifcost 0 port 0
ipfilter disabled flags 0x2
member: en2 flags=3<LEARNING,DISCOVER>
ifmaxaddr 0 port 6 priority 0 path cost 0
nd6 options=1
media:
status: inactive
utun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1500
inet6 fe80::6ba2:1096:242a:6b1%utun0 prefixlen 64 scopeid 0xc
nd6 options=1

Thanks.


#2

I configured my Pi wifi router based on this tutorial (http://raspberrypihq.com/how-to-turn-a-raspberry-pi-into-a-wifi-router/), and it works well after a painful trouble shooting process. You might need to check your driver of wifi dongle (using nl80211 or rtl871xdrv) and comment out allow-hotplug wlan0 (someone says this one may cause a lot of trouble). If it still doesn’t work, I can send you my configuration.

Good luck!


#3

Thanks! I actually figured out what my problem was, and it came from an unfamiliarity with the hardware I was working with. Mine wasn’t working because I wasn’t leaving my ethernet cable plugged into my Pi – I was just assuming that it would get internet. But I remembered that routers themselves are only responsible for activities like handing out IP addresses and managing traffic, and that without being hooked up to the internet cable I wouldn’t have access to the outside internet.

So I made sure my ethernet cable was plugged in and it ended up working fine, although since I might not have access to an ethernet port I think I might have to use a second wifi adapter to connect to the local wifi network. I’m not sure; this part is unfamiliar and I’ll probably end up doing some googling.