Cannot connect to local computers if firewall is on

Connection sharing, Firewall, Samba..etc
Forum rules
Before you post please read how to get help
Post Reply
Pat D
Level 4
Level 4
Posts: 360
Joined: Thu Jul 14, 2016 2:31 pm

Cannot connect to local computers if firewall is on

Post by Pat D »

Having a struggle here with the firewall. I'm just not getting how to manipulate it.
I have 2 boxes that can see each other and share over samba no problem, but if a firewall in either machine is on, the network is empty.
I've tried making rules as posted elsewhere, but none have worked, and I'm left more-than-usually confused.
I'm using samba because there is 1 Windows 10 laptop left in the house that I want to add to the network.
What info can I post to help resolve this?? :? :?
User avatar
AZgl1500
Level 13
Level 13
Posts: 4860
Joined: Thu Dec 31, 2015 3:20 am
Location: Oklahoma where the wind comes sweeping down the plains
Contact:

Re: Cannot connect to local computers if firewall is on

Post by AZgl1500 »

I had to turn Firewall OFF on this laptop in order to access the WiFi network to my other machines.
and also what was more important to me, to allow my cellphone to access this laptop to paste camera shots to this laptop.
Linux Mint 19.3 Cinnamon
User avatar
WharfRat
Level 21
Level 21
Posts: 13897
Joined: Thu Apr 07, 2011 8:15 pm

Re: Cannot connect to local computers if firewall is on

Post by WharfRat »

Check if your blocking tcp ports 139 and 445 and udp ports 137 and 138 if your input policy is accept otherwise if the chain policy is drop then you'll need to accept those ports.
ImageImage
asinoro
Level 5
Level 5
Posts: 886
Joined: Mon Feb 12, 2018 11:43 am

Re: Cannot connect to local computers if firewall is on

Post by asinoro »

It might help you.

Code: Select all

sudo ufw allow Samba

Code: Select all

sudo ufw deny Samba

Code: Select all

sudo ufw status
Pat D
Level 4
Level 4
Posts: 360
Joined: Thu Jul 14, 2016 2:31 pm

Re: Cannot connect to local computers if firewall is on

Post by Pat D »

Code: Select all

sudo ufw status verbose
[sudo] password for : 
Status: active
Logging: on (low)
Default: deny (incoming), allow (outgoing), disabled (routed)
New profiles: skip

To                         Action      From
--                         ------      ----
137,138/udp (Samba)        ALLOW IN    Anywhere                  
139,445/tcp (Samba)        ALLOW IN    Anywhere                  
137,138/udp (Samba (v6))   ALLOW IN    Anywhere (v6)             
139,445/tcp (Samba (v6))   ALLOW IN    Anywhere (v6) 
I haven't gotten as far as using static addresses because I'm not familiar with how to do it yet.
What am I missing?
Pat D
Level 4
Level 4
Posts: 360
Joined: Thu Jul 14, 2016 2:31 pm

Re: Cannot connect to local computers if firewall is on

Post by Pat D »

Bump?
Still don't know what I'm not seeing or not doing here, and other research is only serving to confuse me even more.

:cry: :cry:
User avatar
smurphos
Level 17
Level 17
Posts: 7126
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher
Contact:

Re: Cannot connect to local computers if firewall is on

Post by smurphos »

I just tend to set an ALLOW IN for my local network (not limited to any specific protocol). It's a bit lazy and does reduce the security provided by the firewall but I'm satisfied that the network itself is secure and I know what services the machines are running so laziness it is. I think it's better than your SAMBA rules to allow in from anywhere.

Looks like this

Code: Select all

Status: active
Logging: on (low)
Default: deny (incoming), allow (outgoing), disabled (routed)
New profiles: skip

To                         Action      From
--                         ------      ----         
Anywhere                   ALLOW IN    192.168.1.0/24            
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.
User avatar
WharfRat
Level 21
Level 21
Posts: 13897
Joined: Thu Apr 07, 2011 8:15 pm

Re: Cannot connect to local computers if firewall is on

Post by WharfRat »

Unless samba is using different ports, it's odd that it's being blocked.

Are those rules setup on both systems :?:
ImageImage
Pat D
Level 4
Level 4
Posts: 360
Joined: Thu Jul 14, 2016 2:31 pm

Re: Cannot connect to local computers if firewall is on

Post by Pat D »

Yes. Both systems are set up the same way.
User avatar
WharfRat
Level 21
Level 21
Posts: 13897
Joined: Thu Apr 07, 2011 8:15 pm

Re: Cannot connect to local computers if firewall is on

Post by WharfRat »

Can you return the url from sudo iptables -L -nv|pastebin

Can't promise anything, but I'll take a quick look.
ImageImage
Pat D
Level 4
Level 4
Posts: 360
Joined: Thu Jul 14, 2016 2:31 pm

Re: Cannot connect to local computers if firewall is on

Post by Pat D »

Code: Select all

sudo iptables -L -nv|pastebin
[sudo] password for : 
Error: Got Net::HTTPUnprocessableEntity from gist: {"message":"Validation Failed","errors":[{"resource":"Gist","code":"missing_field","field":"user"}],"documentation_url":"https://developer.github.com/v3/gists/#create-a-gist"}
Error ??
User avatar
WharfRat
Level 21
Level 21
Posts: 13897
Joined: Thu Apr 07, 2011 8:15 pm

Re: Cannot connect to local computers if firewall is on

Post by WharfRat »

I'm getting the same message when attempting to pastebin something - seems to be a github problem.

Give it a while to straighten out :wink:
ImageImage
cliffh
Level 1
Level 1
Posts: 4
Joined: Sun Apr 01, 2018 1:28 pm

Re: Cannot connect to local computers if firewall is on

Post by cliffh »

I had exactly the same problem on Linux Mint 18.3, also on a Raspberry Pi running Stretch.

The two line fix described here worked for me on both machines: https://askubuntu.com/questions/875845/ ... g-together
Post Reply

Return to “Other networking topics”