View Full Version : Networking Linux Os to W*ndoes Os, HELP!
kastro68
23rd March 2003, 10:23
Hi,
I just spent 2 days reading documents and playing around with linux
I'm having a little trouble sharing files between Linux Mandrake and W*nXP. Actually, I'm having a lot of trouble.
I'm using Samba, but I don't know what I am doing wrong. How to I check the IP of the Linux system?
In Samba I put security = share
I set the same workgroup for Samba and W*ndows.
and I also made the folder /home/kasz a public share
I edited smb.conf using kwrite from the console. After typing su -, then typing the password.
I even tried Swat, but I can't manage to change the values.
Is there something I missed?
The problem is that I can't get Wind*ws to find the linux machine. I don't even know what IP to search for using the W*ndows search for a computer.
Is the IP 127.0.0.1 default for the local host?
I also can't get the internet to work on the Linux machine, which was set up as a gateway.
I'm at the stage of pulling my hair in frustration,
Any help would be appreciated.
Blueseb
23rd March 2003, 12:46
read the howtos!!!
i haven't been usibng linux for too much time, but wasn't so much difficult taking up samba working using howtos
Rrrough
23rd March 2003, 16:47
some n00bish answers:
I don't even know what IP to search for using the W*ndows search for a computer.
try that : http://zeus.fh-brandenburg.de/~schwanz/php/komba.php3
Is there something I missed?
maybe try an easier approach first (learn to crawl before you fly): http://www.webmin.com/
I'm at the stage of pulling my hair in frustration
make sure you'll have some left - you'll need them
at least it helped me as having been used to lazy point and click. when u get the idea of what you're doing, you'll love command lines and config files, I promise.
hope that helps.
cheers
jggimi
23rd March 2003, 17:51
I'm running Samba 2.2.5 under SuSE Linux 8.1. I also installed LinNeighborhood, which lets me find and mount windows folders on my linux box.
Here's my smb.conf file:[global]
workgroup = home
encrypt passwords = yes
[C]
comment = Windows partition
path=/windows/C
read only = no
guest ok = yes
[lexmark]
printable = yes
print command = /usr/bin/lpr -r %s
printer = lexmarkz52
read only = yes
guest ok = yesencrypt passwords is reqd for win98/NT 4 and above.
You asked how to determine your Linux's IP address? From within Linux, you can always use ifconfig. On my system, it's in the /sbin directory.
BradChandler
23rd March 2003, 17:52
From a command line, you can type "ifconfig" without the quotes and it will list information about your network interfaces. If you have one NIC, you should see two sets of info, one for your loopback interface (lo) which should be 127.0.0.1 and one for your NIC. If you only have one NIC, it will be eth0. The ip address of each interface is listed after "inet addr:".
What kind of internet connection do you have? I'll assume a cable modem for now. If you're using the Linux box for your gateway, that means you have two NICs in it. The first NIC, eth0, should be connected to your cable modem. The second NIC, eth1, should be connected to your local network (the NIC in your Windows computer). If your internet provider uses DHCP, you'll set eth0 to start at boot and get it's ip by DHCP. You would manually set the ip of eth1 to something like 10.0.0.1. You can do all this through the Mandrake Control Center. You'll need to set up some iptables rules to allow NAT. You'll then configure the Windows computer to use 10.0.0.1 as it's gateway. I can show you how to set all this up if you want. However, the easiest thing to do is to buy a SOHO router with a built in hub. Then all you have to do is set your computers to get their ip through DHCP, plug them into the router and you're done.
jggimi
23rd March 2003, 17:54
Brad's right -- I use a Linksys router, and all the PCs on this side of the cable modem are 192.168.x.x. The Linux box is just one of several PCs in the house.
mtc
23rd March 2003, 22:31
I had to do an assignment on this last year, and still have my documentation lying around so maybe it can be of some help to you....
OK here goes:
I'll start with getting your internet sharing working (There should be a little program that'll do this for you in Mandrake 9.0, but just in case....)
Give your internal network card (in my case eth0) on your Linux machine the ip 192.168.0.1 and your Windows box something like 192.168.0.2. this can be done at the command line in linux by using:
>ifconfig eth0 192.168.0.1
You should hopefully be able to find out the ip of your external card (ie the one the cable modem is connected to) by just typing ifconfig.
You now need to set up the correct routes so the two machines can talk to each other on the network, the following lines should do this for you:
>route add -net 192.168.0.0 netmask 255.255.255.0 eth0:1
>route add default gw 192.168.0.1
You should also set the default gateway on your windows box to be 192.168.0.1
At this point, hopefully your windows box should be able to access the net.
Now for samba:
Open up your /etc/smb.conf file, make sure that:
WORKGROUP is set to the same as the workgroup your windows machine belongs to
SERVER is the name you want you linux machine known as on the windows box
allow domain logons, and set master domain to yes.
Now all you should have to do is set up your shares, Here's an example of what a share could look like...probably more in this than you'll need:
[engineering]
comment = Engineering Dept Common Folder
path = /home/common/Engineering
browseable = no
public = no;
read only = yes;
write list = @Engineer
you'll also have to make sure that you have the permissions set correctly on the shares. You may also have to play around with users and groups etc so you can log in OK.
I hope this made sense and was helpfull in some way.
Chris
kastro68
25th March 2003, 06:57
Hi,
I'm still having trouble getting the linux box to handshake with the windows box. I know how to share files on the linux machine, the only problem is that i can't get the windows box to find the linux box and vice versa.
Is it correct to put the gateway on the windoes box to the same as the ip of the linux box?
and this command
>route add -net 192.168.0.0 netmask 255.255.255.0 eth0:1
a message pops up saying device not found.
but when I type this:
>route add -net 192.168.0.0 netmask 255.255.255.0 eth0
without the last 2 characters ":1" it this command works.
I would also like to know what the Host name is, and the Zeroconfig host.
AND is editing in smb.conf case sensitive?
mtc
25th March 2003, 08:00
Hi,
Is it correct to put the gateway on the windoes box to the same as the ip of the linux box?
Yes, so if when you did ifconfig on linux you set the ip to 192.168.0.1 then set the gateway of you windows box to 192.168.0.1
For the two boxes two communicate their IPs must be in the same range, so if you set the IP of your linux box to 192.168.0.1 then the IP of your windows box must be in the range 192.168.0.2 -> 192.168.0.254
As far as I know smb.conf is case sensitive.
As for the route commands I gave you, the eth0:1 was a mistake on my part, I forgot to fix that before copying and pasting :rolleyes:
I would also like to know what the Host name is, and the Zeroconfig host.
Without actually looking at a smb.conf file I honestly couldn't tell you what these are (I'm assuming they're in smb.conf??) but according to my docs I didn't touch them.
Hope this was helpful
Chris
Also have you tried pinging the machines, that way you'll at least know if it's a problem with samba, or with your routes.
juicemansam
25th March 2003, 11:51
@kastro68
Is it correct to put the gateway on the windoes box to the same as the ip of the linux box?
You don't really need a gateway (or gateway address) since both Linux and Windows understand the TCP/IP networking scheme, it would be needed if you were connecting IPX to TCP/IP, or AppleTalk to TCP/IP. The gateway address is just default address/route for outgoing info to go to should a requested address not be found at the LAN level. It's not necessary unless your Linux box will act as a server, firewall, router, etc.
The eth0 as mentioned earlier by others, is the first ethernet adapter loaded into the kernel. A single adapter could have multiple addresses assigned to it, they are referenced by a ':' followed by a number, ie. "eth0:1" would be ethernet adapter 0 alias 1. Linux this feature must be compiled into the kernel, for Windows you must have 2000 or XP.
Sometimes computers (network devices) are unable to 'find' each other because of an IP/Mask difference. For example, host0 has IP/Mask settings of 172.16.0.1/255.255.255.0 and host1 has 172.16.0.2/255.255.0.0. Even though their IP's are look to be on the same network there could be communication problems due to having different network masks. It's the mask that determines the 'network' address, not the IP address.
Also, make sure that you have common user accounts for both computers. Since you will be networking, you must have a username to be identified by. If you logon to Windows using "somelogin," you'll need to have a user login with the same name in Linux, and viceversa.
Regarding Samba, here's my smb.conf:
[global]
workgroup = WORKGROUP
server string = Samba Server
hosts allow = 192.168.0. 127.
log file = /var/log/samba.%m
max log size = 50
security = user
encrypt passwords = yes
ssl CA certDir = /etc/ssl/certs
socket options = TCP_NODELAY
dns proxy = no
[homes]
comment = Home Directories
browseable = no
writable = yes
[tmp]
comment = Temporary file space
path = /tmp
read only = no
public = yes
Make sure you set 'hosts allow,' it needs to be set so that Samba will allow connections from those networks or hosts.
I hope that helps. If you have any more questions don't hesitate to post them.
kastro68
25th March 2003, 15:54
Make sure you set 'hosts allow,' it needs to be set so that Samba will allow connections from those networks or hosts.
I didn't enable this in my smb.conf file, maybe this is why I can't get them to handshake. I'll try it as soon as I get home. I can't access the net from home at until I can resolve this networking issue.
I also discovered that when I make a clean boot into linux and type ifconfig, my ip is not listed.
However, after I type the commands suggested by mtcifconfig eth0 192.168.0.1 Only when I have typed that then type ifconfig then my inet addr is displayed. Everytime I re-boot then type ifconfig, my inet addr is no longer displayed.
I think there is also something that I forgot to mention in earlier posts. I am not connecting the 2 boxes through a hub, router or switch. They are connected directly from one Nic to another Nic using a twisted cat-5 cable. Could this be the problem?
security = user
I used security = share in my smb.conf file,
does this still mean that I must still need to use the same login for both boxes?
Also, make sure that you have common user accounts for both computers. Since you will be networking, you must have a username to be identified by. If you logon to Windows using "somelogin," you'll need to have a user login with the same name in Linux, and viceversa.
Also have you tried pinging the machines, that way you'll at least know if it's a problem with samba, or with your routes.
I tried pinging with the ping command both from the wbox and lbox but I don't really know what Ip i'm suppose to ping.
Oh another question. I am suppose to use a static Ip right, DHCP should only be used for the internet connection right?
Thanks for all the help,
I really appreciate it.
mtc
25th March 2003, 20:56
I tried pinging with the ping command both from the wbox and lbox but I don't really know what Ip i'm suppose to ping.
you should be trying to ping the ip numbers of your linux box (ie 192.168.0.1) from your windows box and vis-versa, and also possibly something like www.yahoo.com from your windows box to check to see if the windows box can see the internet. And you are correct in saying that DCHP should only be used for your internet connection.
You don't really need a gateway (or gateway address) since both Linux and Windows understand the TCP/IP networking scheme, it would be needed if you were connecting IPX to TCP/IP, or AppleTalk to TCP/IP. The gateway address is just default address/route for outgoing info to go to should a requested address not be found at the LAN level. It's not necessary unless your Linux box will act as a server, firewall, router, etc.
But you do need this seeing as you want to use your linux box as an internet gateway.
It won't make any difference how your PC's are connected, I've done it both using a hub, and crossover cables, so how you've done it is fine.
I also discovered that when I make a clean boot into linux and type ifconfig, my ip is not listed.
Oops, try putting your ip infomation into one of the GUI network configuration tools in linux like netconfig, then hopefully it should stay correct.
juicemansam is right make sure the netmask on both your PC's is the same 255.255.255.0 or nothing will work.
Good luck
jggimi
26th March 2003, 02:10
kastro, I've thought of a few things: do you have both daemons running? You need smb, but you also need nmb. Without the latter, NetBIOS is not running, and that might be why the linux box doesn't appear in the windows network browser.
Have you looked at the Samba documentation? There should be a very nice book (in Adobe Acrobat format) that was installed in your /usr/share/doc/packages/Samba... (or equivalent) directory structure. It's what I used to develop and test my network. If you haven't read the first few chapters, please do so. It will save you from having a lot of difficulty. For example, without it, I wouldn't have known that two daemons need to be running.
kastro68
26th March 2003, 05:49
do you have both daemons running? You need smb, but you also need nmb. Without the latter, NetBIOS is not running, and that might be why the linux box doesn't appear in the windows network browser.
I know smb is running but nmb is not. How do i get nmb running?
mtc
26th March 2003, 06:35
I know smb is running but nmb is not. How do i get nmb running?
>service nmb start
should do it
juicemansam
26th March 2003, 09:38
To get NMBD up and running you'll need to setup the lmhosts file. This file should be located where smb.conf is. From what I remember, this file is not generally installed, so you'll have to make it. It is very similar to the /etc/hosts file, except that the host names are case-insensitive. Here's a sample lmhosts:
#
# Sample Samba lmhosts file.
#
192.9.200.1 TESTPC
192.9.200.20 NTSERVER#20
192.9.200.21 SAMBASERVER
This file must be setup before running NMBD, otherwise, it won't run. What's worse is that NMBD won't tell you why it's not working.
Make sure you are using a crossover cable. The color order for the wires in the plugs should be the following, looking at them with the flap away from you and the cable hanging:
White/Orange, Orange, White/Green, Blue, White/Blue, Green, White/Brown, Brown (One end of the cable).
White/Green, Green, White/Orange, Blue, White/Blue, Orange, White/Brown, Brown (The other end of the cable).
If both cables ends look the same, you've got the wrong cable.
Good luck.
kastro68
26th March 2003, 09:42
I finally got the winbox to handshake with the linbox. I can share and see files from either box now.
I would like to thank all the people who helped me get it working. In no particular order, I would like to thank:
-spankmeister
-soulklekta
-mtc
-jggimi
-juicemansam
and
-BradChandler
The only problem that I am having is that I have to type the command
ifconfig eth0 192.168.0.1
each and every time I want to access/share files between the boxes after a reboot.
How would I get linux to run this command automatically each time I reboot? I tried netconfig but it doesn't seem to work.
Getting those 2 boxes to handshake was a good exercise for me, however if I were to reformat-reinstall linux, i'm not sure if I can remember all the stages of getting it to work.
Thanks again.
mtc
26th March 2003, 11:02
there should be a gui network configuration tool you can set the IP of your linux box with, just check your gnome/kde menu for it, failing that a cheap and nasty hack might be to just put that line into your /etc/rc.d/rc.local file.
kastro68
27th March 2003, 15:39
a cheap and nasty hack might be to just put that line into your /etc/rc.d/rc.local file.
I tried doing this, but it still doesn't work :(
Thanks anyway.
I'm going to format and reinstall linux, just to see if I can get the network working again from scratch.
BradChandler
31st March 2003, 18:43
Edit your /etc/sysconfig/network-scripts/ifcfg-eth0. You'll want it to look something like this:
DEVICE=eth0
IPADDR=192.168.0.1
ONBOOT=yes
I'm sure there's a way to do this in Mandrake Control Center, but I'm not at my Linux computer right now so I can't check.
kastro68
3rd April 2003, 18:25
thanks,
it works now :)
vBulletin® v3.8.4, Copyright ©2000-2010, Jelsoft Enterprises Ltd.