RaspAP / raspap-tools

Scripts to prepare the raspberry pi for RaspAP
31 stars 9 forks source link

Not a bug but help needed with setup #1

Closed feh123 closed 3 years ago

feh123 commented 3 years ago

Hi @zbchristian @billz pointed me towards your work on driver tools. I have long used a +3B (running OS 32bit) with a Linksys dongle (RTL8812au) in wlan0/wlan1 mode. However that was on v2.5 so I thought I would update and also try the insiders version. I have downloaded your create_wlan_drivers sh file and installed 8812au on a +3B (fully updated and ready to run the curl command to install RaspAP). It worked well and my dongle appears fully integrated and ready. Maybe I should test this to be sure? But after I run the curl and install RaspAP I hit a problem - the hotspot has no internet access. Wlan1 has become my wifi client and wlan0 the AP but they do not seemed linked and I see two IP addresses. If I try to swop them around I lose the Linksys wifi so still have no internet access. Any thoughts much appreciated. Thanks.

zbchristian commented 3 years ago

@feh123 You will find two different versions for the wlan drivers In my raspap-tool repository:

I mainly tested the latter and the first only briefly.

Concerning your problems with the connectivity: First check if its just a DNS resolution problem. If you observe under the Networking tab, that the client can connect to 1.1.1.1, but not to one.one.one.one. You can do the same test from the commandline using ping. In this case you can try to remove the default DNS servers under DHCP server and restart. After this change the local DNS server from the client side will be used.

If this is not solving the problem, check the output of ifconfig -a and ip route list. You should see something like the following

pi@geierpi:~ $ ifconfig -a
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.0.0.1  netmask 255.255.255.0  broadcast 10.0.0.255
...
wlan1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.178.63  netmask 255.255.255.0  broadcast 192.168.178.255
...

pi@geierpi:~ $ ip route list
default via 192.168.178.1 dev wlan1 proto dhcp src 192.168.178.63 metric 303
10.0.0.0/24 dev wlan0 proto dhcp scope link src 10.0.0.1 metric 302
192.168.178.0/24 dev wlan1 proto dhcp scope link src 192.168.178.63 metric 303

The AP should have a fixed address. Here wlan0 is the access point and I changed the IP to 10.0.0.1 (from 10.3.141.1). wlan1 is the client.

Your connectivity might have a problem, when you observe an additional line in the output of the second command (e.g default via 10.3.141.1 ... or similar). In this case the routing goes back to the AP interface. To solve this, open the RaspAP GUI and remove the Default Gateway under the DHCP Server Tab. I even remove the default DNS Servers, because otherwise I have a problem with the DNS resolution in private networks. After the changes save the settings and restart the hotspot.

Hope that solves your problem.

zbchristian commented 3 years ago

@feh123 To test my install script of drivers and RaspAP, I just ran a clean install of the insiders version. And it pretty much worked out of the box with two WLAN interfaces. I had only to remove the Default Gateway to get rid of the incorrect routing. Fixing the devices to its respective name requires a udev rule, or you install my feature branch feature/zbchristian-clients, which allows to fix the names fron the GUI.

feh123 commented 3 years ago

Hi @zbchristian thanks a lot for all this help and for checking the script - I did use install_wlan_drivers_8812au_88x2bu.sh so that's good! I will try out your ideas and get back to you. It certainly seems that somehow I have made a mistake with the routing. Incidentally I found the UI would not let me change the settings under the DHCP tab. But I will go back and look at this more closely - I was just fishing then not really knowing what I was doing. Thanks again.

feh123 commented 3 years ago

Hi @zbchristian not much success I'm afraid. Here is the output from the commands: @Hotspot2:~ $ ifconfig -a
eth0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether b8:27:eb:16:0c:3c txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10
loop txqueuelen 1000 (Local Loopback)
RX packets 204 bytes 18853 (18.4 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 204 bytes 18853 (18.4 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 2312
inet 169.254.5.64 netmask 255.255.0.0 broadcast 169.254.255.255
inet6 fe80::f3ad:c631:16ef:c823 prefixlen 64 scopeid 0x20
ether c8:d7:19:c7:ca:28 txqueuelen 1000 (Ethernet)
RX packets 692 bytes 31813 (31.0 KiB)
RX errors 0 dropped 1 overruns 0 frame 0
TX packets 20 bytes 3967 (3.8 KiB)
TX errors 0 dropped 64 overruns 0 carrier 0 collisions 0

wlan1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.7 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::9cb8:39c9:f204:43a9 prefixlen 64 scopeid 0x20
ether b8:27:eb:43:59:69 txqueuelen 1000 (Ethernet)
RX packets 17299 bytes 4839766 (4.6 MiB)
RX errors 0 dropped 1 overruns 0 frame 0
TX packets 1533 bytes 1090186 (1.0 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

pi@Hotspot2:~ $ ip route list
default via 192.168.1.1 dev wlan1 proto dhcp src 192.168.1.7 metric 304
169.254.0.0/16 dev wlan0 scope link src 169.254.5.64 metric 303
192.168.1.0/24 dev wlan1 proto dhcp scope link src 192.168.1.7 metric 304
pi@Hotspot2:~ $

The problem seems to be that in the DHCP tab wlan0 gets a static IP and in the static ip options there is /INF. If I try to enable DHCP I get error invalid static IP. I cannot seem to add a static ip address. I tried to remove the default gateway but you can see I was not successful. All I managed to do was to get it to change from default dev wlan1 to default dev wlan0. When it was default wlan1 under network 1.1.1.1 and one.one.one.one were both ticked. Now it says no route to internet. I feel I do not understand these issues well enough and maybe I am doing these edits incorrectly. Wlan0 in DHCP has static ip enabled and it will not let me change this. Is that right? Apologies for a long message.

feh123 commented 3 years ago

H @zbchristian Success! As I thought - my error! I was not thinking clearly and kept believing that I needed to set wlan1 to hotpsot. Once I realised this mistake I followed your advice - removed the default gateway that appears on wlan0 for some reason and then everything worked. I even updated to insiders. Just a follow up question - I have a TP-Link Archer T9UH - do you have a driver for that? Is that better than the rtl8812au? Thanks a lot for all your help. Very much appreciated.

zbchristian commented 3 years ago

@feh123 great that is works! Concerning the TP-Link Archer T9UH : I have no clue what driver is required, but you can try to run the install_wlan_driver_modules.sh script. This will check, if there is a precompiled module available.

feh123 commented 3 years ago

Thanks @zbchristian its rtl8814au - I will give the driver modules script a run. Really pleased to have my RPi running wifi only! Thanks for all your help.

feh123 commented 3 years ago

Hi @zbchristian install_wlan_drivers_modules.sh worked really well. Thanks.

zbchristian commented 3 years ago

The script is just a wrapper. The work has been done by MrEngman - http://downloads.fars-robotics.net

billz commented 3 years ago

@zbchristian not to hijack this issue, but would you consider adding this repo to the RaspAP org? Would create more visibility and I think users would benefit from it.

zbchristian commented 3 years ago

@billz Yes sure. Was considering this already, but was still busy debugging the scripts.