If you look closely you can see eth0 is down and is not part of the bridge. Compare the lines for eth0 and wlan0 in "ip a show" and "ip link show".
where "above" refers to the first part of the instructions and it is easy to overlook the following:The access point setup is almost the same as that shown in the previous section. Follow the instructions above to set up the hostapd.conf file, but ...
We now need to tell the system where to find this configuration file.
Find the line with #DAEMON_CONF, and replace it with this:Code: Select all
sudo nano /etc/default/hostapd
Code: Select all
DAEMON_CONF="/etc/hostapd/hostapd.conf"
Yes, it appears the guide now mandates a static IP address for the AP without any rationale.
Based on my previous experiences I have just now successfully installed an access point under buster using the instructions.
I agree on those point, in addition the second part needs a cleanup because it starts right in the middle, refers back to the first section, and does not mention unmasking hostapd.epoch1970 wrote: ↑Wed Jul 31, 2019 2:17 pmEDIT. An since I am more of less specialized into doing the exegesis of that document to newcomers, here are the things that should be improved according to my experience:
1) Make 2 documents. The configs are not compatible. People get confused and mix both parts of the document.
2) Open with a picture or ASCII art showing the target setup, esp. the location of the DHCP server(s)
I agree two separate documents with graphics. Maybe with a landing page showing the graphics and better explaining the differences and applications of the two solutions.epoch1970 wrote: ↑Wed Jul 31, 2019 2:17 pmEDIT. An since I am more of less specialized into doing the exegesis of that document to newcomers, here are the things that should be improved according to my experience:
1) Make 2 documents. The configs are not compatible. People get confused and mix both parts of the document.
2) Open with a picture or ASCII art showing the target setup, esp. the location of the DHCP server(s)
Code: Select all
sudo apt update
sudo apt upgrade
Code: Select all
sudo reboot
Code: Select all
sudo apt install hostapd bridge-utils
Code: Select all
sudo nano /etc/dhcpcd.conf
Code: Select all
denyinterfaces wlan0 eth0
Code: Select all
sudo brctl addbr br0
Code: Select all
sudo brctl addif br0 eth0
Code: Select all
# Bridge setup
auto br0
iface br0 inet manual
bridge_ports eth0 wlan0
Code: Select all
interface=wlan0
bridge=br0
#driver=nl80211
ssid=NameOfNetwork
hw_mode=g
channel=7
wmm_enabled=0
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=AardvarkBadgerHedgehog
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
Code: Select all
sudo nano /etc/default/hostapd
Code: Select all
DAEMON_CONF="/etc/hostapd/hostapd.conf"
Code: Select all
sudo systemctl unmask hostapd
sudo reboot
Code: Select all
sudo hostapd -B /etc/hostapd/hostapd.conf
That last part is undeniable. But I am no so sure about the first: routed works all the time, bridging does not (e.g. wifi client uplink)
"Consider rebooting"??? => "If an updated kernel was installed, reboot before continuing with the setup"
Yes, I think the guide says to "denyinterfaces wlan0" and "denyinterfaces eth0", which IIRC is incorrect (only the last interface gets ignored)denyinterfaces wlan0 eth0
Does systemd requires the device to be alive at config time? If not, this runtime dance with brctl is completely superfluous.Add a new bridge, which in this case is called "br0". ... Connect the network ports. In this case, connect "eth0" to the bridge "br0".
The "original" guide (after the "last" update) has a seemly confused section concerning the bridge. First it gives the instructions to install hostapd and bridge-utils, a little bit later how to add the new bridge with brctl and how to add the interface eth0 to the bridge.epoch1970 wrote: ↑Wed Jul 31, 2019 3:53 pmDoes systemd requires the device to be alive at config time? If not, this runtime dance with brctl is completely superfluous.Add a new bridge, which in this case is called "br0". ... Connect the network ports. In this case, connect "eth0" to the bridge "br0".
And I don't think systemd-networking requires brctl since that tool is deprecated; perhaps it is possible to save bandwidth and remove "apt-get install bridge-utils"
The guide as posted won't work with the pi as a wifi client anyway. I've never seen any situation where the Pi as a wired access point fails. Double NAT and separate networks break a lot of things and does not "work all the time" for many applications.
A pseudo bridge is not a bridge, it's usually that last 1% that causes problems... IP-in-IP does work, but it is a little bit involved. I believe a working setup can be achieved with xvlan, which is reasonably standard.jerrm wrote: ↑Wed Jul 31, 2019 8:02 pm... OpenWRT style pseudobridge with relayd - 99% transparent and easy to implement with a simple short dhcpcd.exit-hook script. No config changes needed for the average setup.
I've never tried the Pi as both wifi host and client - maybe a weekend project if I get bored.
The fate of hostapd is relatively unimportant for now. What you should concentrate on is seeing a bridge br0 with a DHCP address (meaning eth0 is attached to the bridge, up and running.) Once that is done hostapd should not be a problem.
Code: Select all
[Match]
Name=br0
[Network]
DHCP=ipv4
I think this is normal behaviour, that is if hostapd is running in the background.joep72 wrote: ↑Wed Jul 31, 2019 8:24 pmI tried extracting instruction from your discuss.
results:
$ sudo hostapd -B /etc/hostapd/hostapd.conf
Configuration file: /etc/hostapd/hostapd.conf
Could not set channel for kernel driver
Interface initialization failed
wlan0: interface state UNINITIALIZED->DISABLED
wlan0: AP-DISABLED
wlan0: Unable to setup interface.
wlan0: interface state DISABLED->DISABLED
wlan0: AP-DISABLED
wlan0: CTRL-EVENT-TERMINATING
hostapd_free_hapd_data: Interface wlan0 wasn't started
nl80211: deinit ifname=wlan0 disabled_11b_rates=0
/etc/hostapd/hostapd.conf
interface=wlan0
bridge=br0
#driver=nl80211
ssid=RPi4access
hw_mode=g
channel=7
wmm_enabled=0
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=RPi4access
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
Code: Select all
sudo service hostapd stop
ifconfig
I have problem with your config files to see what you are trying to do. In the corrupt documentation there are two sections, the first is an access point with network address translation (NAT) using a local dhcp server so that only one IP address in the ethernet network. The second section is a bridged access point where every wifi client can request an IP address from a dhcp server in the ethernet network. For a home network the last configuration is the easiest. But there is a problem in the documentation causing the configuration to fail.
This is a "normal" message while hostapd is "masked" because the configuration file needs to be updated, later in the procedure hostapd is "unmasked" so that it can start.
This is normal because hostapd is already running in the background. You should only use this command if hostapd fails to start because it gives more information on the reason, like typing errors in the configuration file.
Many thanks Ernst for providing these instructions! I've got my RP4B working as an access point now. Is it also possible to direct all internet traffic through a VPN tunnel?
I do not know. What I did is to provide a correction to the second part of this instruction: https://www.raspberrypi.org/documentati ... s-point.md
You could try the first part of the instructions here: https://www.raspberrypi.org/documentati ... s-point.mdspiro wrote: ↑Sat Aug 03, 2019 11:48 amThe tutorials I can find for this (e.g. https://pimylifeup.com/raspberry-pi-wir ... ess-point/ and https://thepi.io/how-to-use-your-raspbe ... pn-router/) which I tried before discovering this thread, require a different access point setup involving fixed IP addresses and dnsmasq, and were written before Buster was released - I so far haven't been able to make them work.
Ah thanks. I was eventually able to get it working using those instructions (although it's very unstable and far to slow to be usable as a VPN router unfortunately. I agree with the earlier points that having those two sets of instructions on one page is quite confusing!Ernst wrote: ↑Sat Aug 03, 2019 11:58 amYou could try the first part of the instructions here: https://www.raspberrypi.org/documentati ... s-point.md