Thursday, June 22, 2006

Firestarter and Samba

In my previous post, I have described how I set up Firestarter. However, there were a few issues with Samba. I was able to browse my shares by entering the IP address. But, today when I tried to "browse" my network, I couldn't see anyone. Konqueror gave me an error saying. "Unable to browse local network. This may be caused by a firewall" (something like that).

Then I stumbled across this thread on ubuntuforums. It gave a very good picture of what was going on, and also a solution to the problem. Now, as you know, I'm a total n00b when it comes to networking, and I didn't actually understand everything, but I managed to set things right.

First of all, in the "Policy" tab of firestarter, I had opened Samba ports (137-139 445) and I had set "10.10.19." as my allowed source for samba. I figured that the correct format should be IP-address/subnet-mask. So I set it as 10.10.19.152/255.255.255.128 . Again, I'm not entirely sure of this. See this page for more details.

Next, I installed "winbind." I don't know what exactly winbind is, but it seems that it plays a role in resolving hostnames. Do a web search for more details.

After that, I edited the file /etc/firestarter/inbound/setup .There I added the line:

# Allow response to netbios name broadcasts from the local network.
$IPT -A INBOUND -s $NET -p udp -m state --state NEW -j ACCEPT


Then just restarted firestarter (sudo /etc/init.d/firestarter restart), and I was able to browse my local network in konqueror.

Since I installed winbind, I also added "wins" to the "hosts" line in /etc/nsswitch.conf:
hosts:     files dns mdns wins

This will allow ordinary TCP/IP programs to resolve hostnames with netbios. (Don't know what it means :-P )

No comments: