LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   A Simple IP / smba problem for the IP gurus (https://www.linuxquestions.org/questions/linux-networking-3/a-simple-ip-smba-problem-for-the-ip-gurus-56378/)

shassouneh 04-22-2003 11:41 PM

A Simple IP / smba problem for the IP gurus
 
The problem is simple, but yet annoying. Here is a breif description.

I have two machines on a aimple LAN. Nothing fancy at all. Just a 10BT hub, and one ethernet card per machine.

Machine Summary:

1 x Microsoft Windows XP Professional (IP: 208.152.2.199)
1 x SuSE Linux Professional 8.1 (running Samba). (IP: 208.152.6.114)

The problem in on the Linux machine. The machine receives its IP via DHCP, and is 208.152.6.114

For some reason, the ONLY way to get Samba to network nicely with Windows is If i manually set the linux IP to something like 208.152.2.x (example: 208.152.2.111).
Unfortunately setting this IP manually makes me lose my internet connection (on the Linux machine).
I tried filling in the values for the Defaul Gateway, Subnet Mask, DNS Servers, as well as the DHCP server and that did NOT help.

Is there a way to use an IP (received by DHCP) and network it nicely without having to have EITHER LAN or internet?

Can someone please help?

Thanx


jharris 04-23-2003 02:26 AM

The IP address you are getting via DHCP for the linux box - does it have an entry in a DNS server anywhere. If it doesn't then Windows probably isn't ever going to see it.

cheers

Jamie...

shassouneh 04-23-2003 02:45 AM

I don't know if it does or not. The DNS server is controlled and maintained by my ISP, so I know nothing about its nature or what it does :(

jharris 04-23-2003 02:56 AM

Sounds like internally you have no name lookups which will cause you problems like this. Make sure that the IP address being used by your linux box is in /etc/hosts on linux and c:\windows\system32\drivers\etc\hosts on Windows (you may need to create this file). You want something like
Code:

208.152.6.114 linuxBoxesHostName
208.152.2.199 windowsBoxesHostName

in each file. You'll also want to check that Samba and XP are in the same Workgroup. To test if those setting are correct you should be able to ping both machines from the command line of either machine. Clearly if the IP addresses that the Linux box is using changes then you'll need to edit these files again.

cheers

Jamie...

Looking_Lost 04-23-2003 05:39 AM

What is your exact network setup ie. what connects to what.

Subnet mask as well have you got it as 255.255.255.0 cos they are on different subnets.

shassouneh 04-23-2003 01:58 PM

Well, the setup is very simple. There is a 10BT hub, and both machines are connected to the hub. The hub gives each machine an IP via the DHCP server of our ISP.
As for different subnets, please note that that should NOT be a problem. With the same setup, If i reboot the linux machine into Windows 2000, I get the same IP, and subnet mask, and networking works without a hitch!!!

baldy3105 04-23-2003 02:59 PM

If you are using class c masks i.e. 255.255.255.0 then it is definitely a problem, as these will be two different subnets and it will not work. Have you supplied the subnet mask in the DHCP? If machines are left to assume the mask then you may get odd results. If you want to use these addresses you will need to use a class B mask - 255.255.0.0

osfestus 04-23-2003 03:07 PM

You said it yourself, it won't work until you manually set the linux ip to 208.152.2.x. That is because at 208.152.6.x, it is on a different subnet than the XP box. The only way those two ip's would work together is if you set the subnet mask for both with a starting value of 255.255.0.0 (you can subnet starting with /16 and get those two to be within the same subnet but that is beyond this particular issue). Also, I notice that you are using addresses that do not belong to the blocks allocated by RFC 1918 to private organizations. Be aware that those addresses most likely belong to another organization, so you should take care to make sure that IP's in your setup that MAY belong to someone else don't get passed out of your routing boundary. I am not going to bother working it out, but you probably may get some functionality if one of those masks is 16 bit and the other 24 bit, but you really should assure that they are set correctly. If both masks are 24 bit, those two ip's will not communicate.

shassouneh 04-23-2003 04:09 PM

Quote:

You said it yourself, it won't work until you manually set the linux ip to 208.152.2.x. That is because at 208.152.6.x, it is on a different subnet than the XP box. The only way those two ip's would work together is if you set the subnet mask for both with a starting value of 255.255.0.0 (you can subnet starting with /16 and get those two to be within the same subnet but that is beyond this particular issue). Also, I notice that you are using addresses that do not belong to the blocks allocated by RFC 1918 to private organizations. Be aware that those addresses most likely belong to another organization, so you should take care to make sure that IP's in your setup that MAY belong to someone else don't get passed out of your routing boundary. I am not going to bother working it out, but you probably may get some functionality if one of those masks is 16 bit and the other 24 bit, but you really should assure that they are set correctly. If both masks are 24 bit, those two ip's will not communicate.
Please read above carefully. I said it doesn't work in Linux. But Windows 2000 also gets this very same IP and Windows 2000 and Xp network flawlessly. This is a problem ONLY on windows.
Also, I do NOT wish to set up the IP manually. I just want ot set up networking with the IP the dhcp server assigns. In other words, I don't see the "point" in setting up things manually if they work in winbloze just fine!

NOTE: I will post the outputs of ifconfig and ipconfig in the next reply.

shassouneh 04-23-2003 04:10 PM

data
 
Linux side

Code:

fallasteeni:~ # ifconfig
eth0      Link encap:Ethernet  HWaddr 00:10:B5:0E:F4:82
          inet addr:208.152.6.114  Bcast:255.255.255.255  Mask:255.255.255.0
          inet6 addr: fe80::210:b5ff:fe0e:f482/10 Scope:Link
          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:124861 errors:0 dropped:0 overruns:0 frame:0
          TX packets:96841 errors:0 dropped:0 overruns:0 carrier:0
          collisions:1125 txqueuelen:100
          RX bytes:138180934 (131.7 Mb)  TX bytes:13644481 (13.0 Mb)
          Interrupt:11 Base address:0xff00

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:553 errors:0 dropped:0 overruns:0 frame:0
          TX packets:553 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:42182 (41.1 Kb)  TX bytes:42182 (41.1 Kb)

fallasteeni:~ #

Windows XP Professional side
Code:



Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

E:\Documents and Settings\Samer.COMP>ipconfig /all

Windows IP Configuration

        Host Name . . . . . . . . . . . . : comp
        Primary Dns Suffix  . . . . . . . :
        Node Type . . . . . . . . . . . . : Unknown
        IP Routing Enabled. . . . . . . . : No
        WINS Proxy Enabled. . . . . . . . : No

Ethernet adapter Local Area Connection:

        Connection-specific DNS Suffix  . : davis.tsunamiusa.com
        Description . . . . . . . . . . . : 3Com EtherLink 10/100 PCI TX NIC (3C
905B-TX)
        Physical Address. . . . . . . . . : 00-10-4B-0C-91-84
        Dhcp Enabled. . . . . . . . . . . : Yes
        Autoconfiguration Enabled . . . . : Yes
        IP Address. . . . . . . . . . . . : 208.152.2.199
        Subnet Mask . . . . . . . . . . . : 255.255.255.0
        Default Gateway . . . . . . . . . : 208.152.2.1
        DHCP Server . . . . . . . . . . . : 208.152.0.9
        DNS Servers . . . . . . . . . . . : 12.127.17.72
                                            207.108.48.1
        Lease Obtained. . . . . . . . . . : Wednesday, April 23, 2003 1:48:17 AM

        Lease Expires . . . . . . . . . . : Wednesday, April 30, 2003 1:48:17 AM


E:\Documents and Settings\Samer.COMP>

smb.conf

Code:

# smb.conf is the main samba configuration file. You find a full commented
# version at /usr/share/doc/packages/samba/examples/smb.conf.SuSE
# Date: 2002-09-12
[global]
        workgroup = Workgroup
        netbios name = Fallasteeni
        server string = Samer's Desktop (LINUX)
        os level = 2
        unix extensions = yes
        encrypt passwords = yes
        character set = ISO8859-15
        client code page = 850
[mp3]

        comment = MP3 files
        path = /mp3
        directory mask=0555

NOTE: I trid this smb.conf file by setting the IP manually to 208.152.2.11 and it works, so don't worry about changing this file

Again, I must emphasize that I do NOT wish to manually set things up. I would much rather get things to work with the IP address the DHCP server assigns. This is because the DHCP server is controlled by my ISP and it assigns new IPs periodically.

osfestus 04-23-2003 04:34 PM

alrighty then, you are running samba on a box with a live ip and then the two machines are supposed to network together using these ip's? First, I won't even bother about the security thing. Second, if you isp is sending leased addresses to the boxes and giving you a live address and gateway then these two boxes will also send out communications via the internet and SMB will not pass that way (most likely) through an ISP router, at least not with any frequency. Let me just add that Linux and Windows are irrelevant when it comes to standards based networking protocols like tcp/ip. If I link two machines via some common media (as long as there is no router configured to route between them) with two incompatible network ip addresses, they will NEVER communicate. I don't care if its linux-linux , windows-windows, linux-windows, or TRS80-AppleII. There is alot more going on here.

jharris 04-23-2003 06:26 PM

You're definately not going to get those two machines talking nicely to one another when they're on different subnets. You can't have two different subnets on the same physical network and expect things to work properly...

If you are managing to get IP from one machine to another under Windows then it must be going from one machine through your hub out onto the web to that subnets default gateway, through to the other subnet and back into your hub to the 'other' machine.

Crazy stuff...

Jamie...

osfestus 04-23-2003 08:32 PM

that's what I am saying lol... you are trying to pass smb/netbios calls out through to your isp, through their routing and back into your other machine... I am amazed you have had any success at all!

shassouneh 04-23-2003 10:38 PM

I don't understand. If you read the output from ifconfig and ipconfig (above) they BOTh say the subnet mask is 255.255.255.0 So what's the problem?
Also, What I fail to understand is in windows I get the same Ip i get for linux, on the same subnet, BUT in linux i have to force a different IP and in windows i don't
What's going on here?

Also, Is there ANY way I can peacfully use the IP the DHCP server assigns to do this networking without manually setting up an IP like say 208.152.2.111 ???

c4_4ya 04-24-2003 12:17 AM

I know you want to do this automatically, but here is what I would do, and you would only have to do this once:

On XP:
Go to your network properties, TCP/IP properties, Alternate Configuration tab, and manually assign an IP address and netmask (ex. 192.168.0.1 mask:255.255.255.0)

-On Linux: Create a subinterface eth0:1 and assign an IP from the same subnet in previous example (ex. 192.168.0.2 mask:255.255.255.0)

-Modify your hosts file to reflect the name/ip mappings on BOTH machines (linux, typically /etc/hosts-- on Windows XP: c:\<system root>\system32\drivers\etc\hosts

This is also a better idea for security, I would bind samba only to your internal IP on linux.

Hope this helps!


All times are GMT -5. The time now is 11:41 AM.