Jump to content

samba and router


coverup
 Share

Recommended Posts

It may be a simple thing, but I can't get it working...

 

My laptop runs Linux MDK 6.1. I used to connect it to Win98 PC via crossover cable. Printing and file sharing was done via samba running on the laptop. The printer is connected to the Win98 PC and was accessible through the LAN.

 

The laptop's eth0 IP address was 192.168.0.1, and Win98's IP was 192.168.0.2. All IPs were static.

 

I now wish to connect to the internet through DSL and a router. The router comes preset with IP address 192.168.0.1, it dynamically assigns IPs to the laptop and to the Win98 box, so I now have to reconfigure samba server. One problem is that I need to tell my network that the server is now on 192.168.0.2, and I have to make the laptop to broadcast itself so it is visible to the Win98 box. Another problem is that the router may change this address to something else, Obviously, there should be a way to configure samba once and forever...

 

Does anybody have a similar LAN? Any advice?

Link to comment
Share on other sites

Okay, I think I got a little lost in there somewhere but here goes...

 

First. Most routers have the ability to set a range of IP's for dhcp and a range of IP's that are static. Check the documentation of the router to see if it supports this. If it does, then changing SAMBA and the IP addresses of your desktop computer and your notebook should be fairly straight forward.

 

Second, if the router only supports dhcp then you have a little more work, but just a little. Most dhcp servers do not just change IP addresses on a wim. Once an IP addresses has been assigned, you generally keep that addresses. There is only one usual reason that an IP will change, and that is if you turn off both computers and start them up in a different order.

 

This means that if you turn on your desktop computer and it gets 192.168.0.2 as its IP, it should keep it until the computer is turned off. This at least gives a little stability in the system.

 

As for Samba, I am not really sure what you are asking.

Link to comment
Share on other sites

Thanks, fuzzylizard.

 

The problem with samba was that somewhere in smb.conf I originally had 192.168.0.1. Now this has become the router's IP address, and the server's IP address has become 192.168.0.2. (Well, that was true before I turned the laptop off and went to work :) ). As an interim solution, I changed that setting to 191.168.0.2, restarted samba, and I was able to share files and print again :D .

 

As for keeping assigned addresses, the server runs on the laptop, so it's turned on and off every night. I expect that the IP address will change quite frequently.

 

Is it possible to use name.domain rather then xxx.yyy.zzz.qqq in samba settings? There must be a way to resolve names on the samba networks, even though IPs are dynamically assigned.

Link to comment
Share on other sites

Thanks, fuzzylizard.

 

The problem with samba was that somewhere in smb.conf I originally had 192.168.0.1. Now this has become the router's IP address, and the server's IP address has become 192.168.0.2. (Well, that was true before I turned the laptop off and went to work :) ). As an interim solution, I changed that setting to 191.168.0.2, restarted samba, and I was able to share files and print again :D .

 

 

Where have you got the IP address??? The only places you need an IP address in samba are for the WINS server (if you use one) and hosts allow/deny etc. Everything else can use names.

 

As for keeping assigned addresses, the server runs on the laptop, so it's turned on and off every night. I expect that the IP address will change quite frequently.  

 

Is it possible to use name.domain rather then xxx.yyy.zzz.qqq in samba settings? There must be a way to resolve names on the samba networks, even though IPs are dynamically assigned.

 

Yes, broadcast and WINS. broadcast will be used if you haven't configured the clients for WINS (can be done by dhcp for windows clients, but probably not by these route appliances), and should work without problems.

 

Have you tried seeing what you get from

 

$ nmblookup '*'

Link to comment
Share on other sites

ranger:

Where have you got the IP address??? The only places you need an IP address in samba are for the WINS server (if you use one) and hosts allow/deny etc. Everything else can use names.

In my smb.conf, I have these lines

[global]

       interfaces = 192.168.161.1/255.255.255.0 192.168.0.2/255.255.255.0

       name resolve order = lmhosts bcast wins

       dns proxy = No

       wins support = Yes

       remote announce = 192.168.161.255/WORKGROUP 192.168.0.255/WORKGROUP

I don't know anything about WINS, swat set yes for me, so I accepted it. I undertand, names are resolved using lmhosts file in my case. Anyway, do you suggest that in interfaces, I can replace 192.168.0.2 with name.domain? What about remote announce? Also, is WINS server a part of samba?

 

I'll check output of the nmblookup as soon as I connect the laptop to LAN at home...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...