1

I have an ethernet port in a room where I would like to improve the WiFi connection, and I have a Raspberry Pi Zero W lying around.

Is there a way I can connect the Pi to the ethernet port and have it serve as a WiFi access point, maybe via a Micro-USB to ethernet cable? And is the Pi Zero fast enough to serve as a good access point?

0

I have written you a tutorial below on how you can setup your pi as a router. although performance will likely be abysmal(sub 20mbps) because of the amount of encryption required to operate an accesss point and the pi's lack of hardware acceleration for this particular software.

id recommend you start by bringing your os up to date by running the following command:

sudo apt-get update && sudo apt-get upgrade

Then we will begin by installing a program called hostapd, which will be used to setup our wireless access point. We will also need a package called bridge-utils to manage bridge devices.

sudo apt-get install hostapd bridge-utils

We then want to turn off some of the new services that we just installed by running the following command:

sudo systemctl stop hostapd

Next, we will create a bridge br0 using the brctl command

sudo brctl addbr br0

Then we want to add eth0(the wired connection) as one of the ports for br0 (bridge 0)

sudo brctl addif br0 eth0

We then can open up your network interfaces file by running the following command:

sudo nano /etc/network/interfaces

and we can add in the following lines:

allow-hotplug wlan0
iface wlan0 inet manual #create a network interface without an ip

auto br0 #makes it start on boot up
iface br0 inet dhcp #automatically assign ip addresses to our clients with dhcp
bridge_ports eth0 wlan0 #bridges our wireless and wired interfaces together

Then, we will configure our wireless access point:

We will start by opening a file named hostapd.conf which can be located in /etc/hostapd. We will use the following command to open it:

sudo nano /etc/hostapd/hostapd.conf

We then want to paste the following lines into it:

interface=wlan0 #use the wifi
bridge=br0 # the bridge we set up
ssid=bandzar.com #the router name
hw_mode=g #g = IEEE 802.11g (2.4 GHz)
channel=8 # just a random channel i choose
wmm_enabled=0 #wifi multimedia disabled as your divice is probably too low power
macaddr_acl=0 #disable mac address based auth
auth_algs=1 # 1=wpa, 2=wep, 3=both
ignore_broadcast_ssid=0 #Send empty SSID in beacons and ignore probe request frames that do not
wpa=2 #requires authentication to access
wpa_passphrase=thanksMohammad # the password
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP

Finally, we can edit the hostapd file in the /etc/default directory using the following command:

sudo nano /etc/default/hostapd

and all we want to do is uncomment the following line and add the path to the file we previously edited, so it looks like the following:

DAEMON_CONF="/etc/hostapd/hostapd.conf"

you should now be able to restart and see a wifi access point when you have ethernet plugged in

0

You can use systemd-networkd to configure your access point as you like without installing and/or configuring additional helpers. Just configure the default Raspbian Stretch installation and you will get what you want. You can use an uplink with Network Address Translation (NAT) or a routed uplink. Very nice is a bridge that will direct expand your subnet from the wired ethernet without the need to have different subnets for the hotspot and the wired network. All devices will have ip addresses from the same subnet. How to setup one of this you can look at Setting up a Raspberry Pi as an access point - the easy way. Of course you will need an additional USB/Wifi dongle to your Raspberry Pi Zero W for the wired ethernet uplink.

0

Here is a cheap USB hub with Ethernet adapter that I have used with Pi zero W: https://www.ebay.com/p/White-Micro-USB-to-Network-LAN-Ethernet-RJ45-Hub-Adapter-with-3-Port-USB-2-0/2137368637

0

The pi zero is horribly slow. I am using one as an access point now(without internet) and it can barely run ssh besides it. if you really want to do this use a pi 3. in addition the pi 3 has an ethernet port and some models even have POE with add on and built in wifi. i cant imagine that the speeds will be any better than what you have now though i do not know what you have.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.