0

Here's my "starting position": I have a Raspberry Pi 3b+, which is already configured, and I wanted to convert it into an Access Point. I followed this tutorial: https://pimylifeup.com/raspberry-pi-wireless-access-point/ and the access point is up and running. The ip-address-distribution also works, I set the range from 172.16.0.20 to 172.16.0.30 with 255.255.255.0 and a lease time of 12h.

My goal is to connect my smartphone to the access point of the raspberry and to be able to access a specific (internal?) website which can be resolved on Port 5000 (172.16.0.3:5000).

If the raspberry is connected to my laptop with a lan-cable (and the laptop has an ip-address in this range, it currently has 172.16.0.4 - I set it manually), I'm able to access the website with my laptop.

But when I'm connected with my smartphone, I do get an ip-address, but I can't connect to the website.

Why is that so? I'm getting the right ip-address, why am I not able to "call" this website?

In step 19, a command for creating an iptables-setting is described. I also added that iptables-command, although I don't even want a wifi connection. Is it possible, that this might be the mistake? How can I solve it?

This is the first time I'm working with a raspberry / iptables / access-points, so a (if possible) simple answer would be great!

If I have expressed myself inaccurately, notify me. I'll try to answer upcoming questions as good as possible.

1 Answers1

1

Sorry, but it is a bit confusing what you are doing. Even with answering my questions in comments I wasn't able to understand your setup.

  • The tutorial you have linked is from 2017 and uses Raspbian, which is deprecated and replaced by the Raspberry Pi OS. It is unclear what operating system you are current using. You may find it with cat /etc/os-release.
  • You are using nmcli, which is the Network Manager Commandline Interface. if you have installed Raspbian or the RaspiOS then the Network Manager isn't available/supported. These operating systems use dhcpcd by default for networking. If you do not installed and configured the Network Manager then you do not use Raspbian or RaspiOS. Maybe you are on Ubuntu?
  • You connected the Laptop to the ethernet port of the RasPi with an ethernet cable. This is not the way how the access point is intended to be used. The wired port is used as uplink to your internet router and expected that there is an internet connection to reach multiple different ip addresses. That's the reason why you need the iptables rule (NAT resp. masquerade). Connecting a Laptop instead of a router will confuse the routing on the RasPi.
  • In a comment you wrote:

I connected the raspberry itself with my router at home (sudo nmcli device wifi con "ssid" password "pw")

Because you have configured a wired uplink to the internet router it is not possible that the RasPi also connect by WiFi to the internet router. An access point cannot connect as client to a remote hotspot without special configuration with an additional virtual network interface. I don't believe that you have created and configured a virtual interface, e.g. ap0.

As you see there are still some things unclear. To have clear conditions and a defined starting point I suggest to start again with an up to date setup using Setting up a Raspberry Pi as an access point - the easy way.

Ingo
  • 42,961
  • 20
  • 87
  • 207