I have followed the official Raspberry Pi documentation's guide to setting up my Raspberry Pi as a wireless access point, with a shared internet connection using the bridge functionality discussed at the end of the guide. This is working perfectly, and I can utilise the access point to connect other devices to the internet.
Further I have also installed Apache2 on my Pi in the hope of setting up a web server with a simple MySQL database. When I navigate to the Pi's IP address whilst connected to the Pi's wireless access point I get the default Apache 'It Works' page, which is as intended.
However, I am also presented with the 'It Works' page when I navigate to the Pi's IP address whilst connected to the router which the pi is connected to, which is not as intended. I'm sorry if I haven't explained this adequately, I have attempted to simplify what I'm saying below.
(intended behaviour) Primary modem / router > Pi WAP > device > Pi's IP address > 'It works'
(unintended behaviour) Primary modem / router > device > Pi's IP address > 'It works'
To simplify what I'm asking for, Is it possible for the apache server to only be accessible when directly connected to the Pi's access point. Thanks in advance for any help!
Edit as per Ingo's request: When I run the 'ip addr' command I get the following output:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master br0 state UP group default qlen 1000
link/ether b8:27:eb:99:e2:6a brd ff:ff:ff:ff:ff:ff
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master br0 state UP group default qlen 1000
link/ether b8:27:eb:cc:b7:3f brd ff:ff:ff:ff:ff:ff
4: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether b8:27:eb:99:e2:6a brd ff:ff:ff:ff:ff:ff
inet 192.168.1.90/24 brd 192.168.1.255 scope global br0
valid_lft forever preferred_lft forever
inet6 2a00:23c7:1286:2600:7048:c293:cc42:9f27/64 scope global mngtmpaddr noprefixroute dynamic
valid_lft 21474793sec preferred_lft 21474793sec
inet6 fdaa:bbcc:ddee:0:7b0:74f1:5c8b:2182/64 scope global mngtmpaddr noprefixroute
valid_lft forever preferred_lft forever
inet6 fe80::e9b0:5aa5:4f2b:5b3/64 scope link
valid_lft forever preferred_lft forever
ip addr
.'ip r show wlan0'
(assume interface is wlan0), listen on this addr output. restart apache2 service and'netstat -laputen'
and show if apache2 is listening only on your specified IP addr only. Also check that your another configuration of your dns server does not return to the ip address of the server. Use separate DHCP range also can be a solution...