I have a windows and linux machines. I decided that I want to mount and view files on each others easily. That’s where samba kicks in.

Here is a very simple way of what I did to make automatic mounting on file shares in both windows and linux happen.

1. Install samba on linux machine by executing the following:

aptitude install samba samba-client smbfs

smbfs is required for recognizing the samba file system in mounting process.

2. Create a password for clients connecting linux shares from windows:

smbpasswd -U username

I have the same username in both windows and linux computers.

3. Now you can view Linux home drive from windows by accessing //ip_of_the_computer/username

That was not that difficult! Now, you can make the share to mount automatically by choosing “Map Network Drive” from Windows Explorers’ settings.

4. Then I edited sambas’ configuration located at /etc/samba/smb.conf. I changed the following option:

# By default, the home directories are exported read-only. Change next
# parameter to ‘yes’ if you want to be able to write to them.
writable = yes

This way I could write to my shares without extra hassle.

5. Finally I wanted to view windows shares on my linux computer.

For automatic mounting of windows shares, I need to create a credetials file, which allowed root to mount the windows share with the credentials of the username of windows user. You would create for example a /root/.smbcredentials and add the following lines on it:

username=username_of_windows_user
password=password_of_windows_user

The problem here is that the text is stored in clear text in the file. There is not an easy way to go around this to my knowledge. Anyway, make the file not readable by others:

chmod 700 /root/.smbcredentials

After this, specify the following in /etc/fstab:

//ip_of_computer/name_of_the_share /media/sambashare         smbfs   credentials=/root/.smbcredentials,dmask=777,fmask=777   0 0

The directory sambashare is a directory I created for the mount to be located at. It is a good idea to mount samba shares under /media directory because it behaves a bit differently, and allows automatic mounting after reboot of windows computer. Now when mounting this folder, you can see the windows shares instantly, and it will be automatically mounted after reboot!

6. Remember to configure firewalls

To view Linux shares on windows computer, you will need to open following ports in Linux firewall:

445:tcp
139:tcp
138:udp
137:udp

On the other hand, to view Windows shares on Linux, no ports are usually required to open since Windows will allow samba traffic trough automatically. At least I didn’t have to. :-)

The scheme:

-A router to receive broadband connection
-A local area network behind NAT
-One of the local computers has web server with domain name associated
-Port forward in router will forward requests to web server to the certain local IP

Okay, now when I connect from outside world to http://huokaus.org the routers port forward will check the rules, and as it says to forward port 80 (http) to a computer (ip) which has web service, and I will get the http page of huokaus.org.

But when I try to access huokaus.org from another computer from my local area network behind NAT, it will not work!

This happens because when I access from private network 192.168.0.0/16 to a domain which points to a public IP address, for some reason the NAT port forward just does not kick in. It has something to do with the source IP address coming from the target network, and router just does not handle it as an complete outside connection.

After searching information concerning this I found out that many are having this same issue. Then this term “NAT reflection” comes in. This is supposed to “fix” this issue and connecting a public domain would behave as connecting from outside local network. After more searching I found out that the same “NAT reflection” thing is called “NAT loopback”.

Somebody said that it’s difficult to find a router which supports this feature.

Then I searched for NAT loopback with Zyxel, as my router is Zyxel. After browsing some results I found out that there is a hidden console command “ip nat loopback on” on some of the Zyxel routers.

Well, my hopes went up and I launched telnet on Vista. Ehh.. what? No telnet? Okay… I guess they thought it would not be used any longer. Yes, I could have thought the same, but I proved myself wrong.

I had to telnet from Debian machine, and it sure had telnet as default! Okay, I gave the router command “ip nat loopback on” and pressed enter…. it did not complain. I tested huokaus.org… and it works!

I put up NAT to have file sharing between desktop, laptop and server machine working fast, without unecessary routing via ISP. Now as all the computers are in same local area network, this is easily possible, and I already tried it on Vista machines. Now I only need to configure SMB between server and desktop. That will be another story..

Slow computers

Heh, that’s a funny term: “slow computer”, the phenomenon we have struggled with almost everyone. I dug my “old” laptop, which I bought one and a half year ago and launched two regular windows updates, and it’s all just so slow and time consuming.

As I’ve a desktop computer with quite modern setup, I’ve just used to the fact that things don’t take “a while”.

For some reason after I updated E51 firmware to the second released one (from 100. to 200.) my Nokia web browser has started to crash more often. It’s a shame, since now I’m experiencing Opera Mini again. At least it seems I can blog with Opera. Lets see what happens when I press ‘publish’ button…

For the first time ever, today when I walked home and launched mIRGGI and was about to write something to the most exciting channel these days (#across of course!), I realized that writing sentences with numpad is extremely annoying. It’s slow, it takes a lot of effort, and most of all: it’s just so uninspiring.

My wife has Nokia E61, which to my knowledge, was the first Nokia phone which tried to look and feel like normal mobile phone (not communicator) and at the same time offer a full qwerty keypad. I liked this phone, but I found out it’s just too large. Plus it’s slow as hell on the OS.

E71 hit the market some months ago. It has everything my current E51 has: durable outlook, smooth looking, fast OS with good and also new features. But most of all, its qwerty.

I tested it the other day, and it left me a feeling that the keyboard was too small. But what can you do, full keyboard takes space. So after I’ve thought of it, I actually think that the keyboard is quite as optimal as it can be. I think I could have it - but this is not possible for a while. Ah well, time will tell.

« Older entries