UFW/GUFW configuration for hotspot

No problem Zenzen :upside_down_face:

I applied these commands:

sudo ufw reset
sudo ufw allow in on wlo1
sudo ufw reload

Now the android device can connect to the laptop's hotspot but doesn't get internet. The android device says [not connected without internet].
I tested with browsing and I could not load anything. The browser also said no internet connection.

Since there is a connection established to the hotspot but not out to the internet, I'm thinking that UFW is blocking the connection between the wireless and ethernet network cards. We can add this rule to explicitly allow it:

sudo ufw route allow in on wlo1 out on eno1 from any to any

Note that I'm using the actual name of the interface and not the alias, as it seems that using interface aliases is not supported by UFW:

[...] where DIRECTION is one of in or out (interface aliases are not supported).


It's getting a bit tedious to scroll up and down, so I'm leaving here a summary of what should work based on what we've seen thus far (:crossed_fingers:). This assumes a fresh configuration:

sudo ufw allow in on wlo1 to any proto udp port 53,67,68
sudo ufw allow in on wlo1 to any proto tcp port 53
sudo ufw route allow in on wlo1 out on eno1 from any to any
1 Like

Hey @zenzen , good news. The hotspot works now. After I ran the command you mentioned:

sudo ufw route allow in on wlo1 out on eno1 from any to any

Thanks @zenzen and @swarfendor437 , now with all the troubleshooting and support done by both of you it seems that two methods work.

I have written the methods for new configs(fresh config as @zenzen said). So I included sudo ufw reset and sudo ufw enable. The two methods are:

Method 1:

sudo ufw reset
sudo ufw enable
sudo ufw allow in on wlo1
sudo ufw reload
sudo ufw route allow in on wlo1 out on eno1 from any to any

Method 2:

sudo ufw reset
sudo ufw enable
sudo ufw allow in on wlo1 to any proto udp port 53,67,68
sudo ufw allow in on wlo1 to any proto tcp port 53
sudo ufw route allow in on wlo1 out on eno1 from any to any

2 Likes

@zenzen , can you pls check and confirm if I have written the methods correctly? if not pls give corrections.
Maybe you should write the methods as clearly as possible in your own reply since I made the reply a bit too long and newcomers would be confused about the solution.
Then I will be marking the solution and closing the topic as solved. Thanks in advance, @zenzen .

2 Likes

That is a great idea. I thought this would be even more useful to have as a dedicated post, just so that it's more easy to find and with more details:

I almost forgot, make sure you turn off the logging activity!

sudo ufw logging off

Or at least lower it to low. Logging everything can be useful for debugging and troubleshooting, but can eat your drive before you know it!

1 Like

Hey @zenzen, Great job on writing such a useful post :+1:

It would have been lovely if you put this as a summary/shortcut in your tutorial and guides post. @zenzen

Thank you! I did learn a few things myself going over this so I wanted to write it down while it's fresh in my mind.

Do you mean to link this thread in the tutorial? I wanted to keep it concise and to the point, so that it can be easier to digest to anyone running into this. The troubleshooting process is quite a learning experience, but not always so much fun to read through from the outside.

In any case, by simply mentioning here, Discourse (the software that powers this forum) already adds a small footnote for reference on the linked thread. Is not as explicit but it can be found at the very end of the post. If you have an idea of how you'd like this phrased so that it's easier to understand, please let me know as it can always be updated.

Hey, @zenzen, I understand what you mean. You want people to not go through a whole lot of process, like I had to do, to solve this issue. And I really liked the idea of you giving it as a tutorial. :slightly_smiling_face: . Keep up the good work :+1: .

I didn't notice the reference in the tutorial at 1st, but now I did thanks to you mentioning the place. I didn't understand at 1st, so my bad. :sweat_smile:

And I actually forgot. You told me to turn off ufw logging. I reset my UFW, so won't logging be off anyways?

Oh, that's right. In that case I think it should be fine, nothing to do :slight_smile:

Ok, thanks @zenzen