Results 1 to 7 of 7

Thread: Question on IP address connect with samba

  1. #1
    Join Date
    May 2006
    Beans
    115

    Question on IP address connect with samba

    Here is my network environment:


    I need to make those PC-xx computers able to connect to samba. I tried whenever I make those computers 192.168.1.x, they works. If 192.168.2.x, they don't work anymore. But due to insufficient IP numbers, I really have to make them 192.168.2.x . Right now, they all are contact by netbios name, my samba server is named SAMBA_PDC now.
    Attached Images Attached Images

  2. #2
    Join Date
    May 2008
    Location
    Pretoria, South Africa
    Beans
    59
    Distro
    Kubuntu 9.10 Karmic Koala

    Re: Question on IP address connect with samba

    What is your subnet masks?

    The problem is that SAMBA uses broadcasts for many of it's features, like netbios names.

    You either need to make them all be on the same ethernet network (no routers in between) and have their subnet masks be something that covers both, like 255.255.0.0. Then give them all the same broadcast address as well, like 192.168.1.255 (even the 192.168.2.0/24 subnet machines).

    If you really want/need a router in between them, make the router a bridge instead. Routers don't reroute broadcasts, which is why you need a bridge.

    The easiest is to obviously make a bigger subnet, as you only need to put them on the same ethernet network (same switches).

  3. #3
    Join Date
    May 2006
    Beans
    115

    Re: Question on IP address connect with samba

    Quote Originally Posted by ghostknife View Post
    What is your subnet masks?

    The problem is that SAMBA uses broadcasts for many of it's features, like netbios names.

    You either need to make them all be on the same ethernet network (no routers in between) and have their subnet masks be something that covers both, like 255.255.0.0. Then give them all the same broadcast address as well, like 192.168.1.255 (even the 192.168.2.0/24 subnet machines).

    If you really want/need a router in between them, make the router a bridge instead. Routers don't reroute broadcasts, which is why you need a bridge.

    The easiest is to obviously make a bigger subnet, as you only need to put them on the same ethernet network (same switches).
    How do I give them all the same broadcast address?
    You said make the router a bridge, but bridge don't have DHCP, isn't it? The bridge does not give IP 192.168.2.x.

  4. #4
    Join Date
    Nov 2006
    Location
    Dorset, UK
    Beans
    28
    Distro
    Ubuntu Jaunty Jackalope (testing)

    Re: Question on IP address connect with samba

    First, can the computers on the 192.168.2.x subnet ping the Samba server?

    If they can't, you have a networking problem not a Samba problem!

    If they can, next try this from one of the 192.168.2.x machines:

    Code:
    smbclient -L //192.168.1.99
    (replacing 192.168.1.99 with the actual IP address of the PDC).

    If that works, you should see a list of shares. If so, this means your problem is down to name resolution. You need to enable WINS on the Samba server (consult the docs on how to do it) and then tell the clients where to find the WINS server. The best way to do this is to configure your DHCP server to hand out the WINS server address, if you can. If not, you will have to manually specify it on each one.

  5. #5
    Join Date
    May 2006
    Beans
    115

    Re: Question on IP address connect with samba

    Quote Originally Posted by VSpike View Post
    First, can the computers on the 192.168.2.x subnet ping the Samba server?

    If they can't, you have a networking problem not a Samba problem!

    If they can, next try this from one of the 192.168.2.x machines:

    Code:
    smbclient -L //192.168.1.99
    (replacing 192.168.1.99 with the actual IP address of the PDC).

    If that works, you should see a list of shares. If so, this means your problem is down to name resolution. You need to enable WINS on the Samba server (consult the docs on how to do it) and then tell the clients where to find the WINS server. The best way to do this is to configure your DHCP server to hand out the WINS server address, if you can. If not, you will have to manually specify it on each one.
    I tried to ping, it didn't work. How do I fix this?

  6. #6
    Join Date
    May 2008
    Location
    Pretoria, South Africa
    Beans
    59
    Distro
    Kubuntu 9.10 Karmic Koala

    Re: Question on IP address connect with samba

    That means your routing isn't working correctly, or you are filtering ICMP packets on your router.

    What VSpike mentioned will work with routing. WINS servers eliminate the need for a bridge, but you will have to setup the WINS on all machines. When you use DHCP then then DHCP can setup the WINS for you. Maybe this will be an easier option.

    So setup the router and make sure it's all working fine first. Then setup a WINS server (you can have SAMBA be your WINS server). Setup DHCP to install the WINS server options on all the clients. You can do this by adding the following option in your DHCPD configuration file (replace the IP with the IP your your WINS/SAMBA server):
    Code:
      option netbios-name-servers 192.168.1.2;
    To help with the routing, do the following commands on the router and paste the output.
    Code:
    sudo iptables -nL 
    sudo iptables -t nat -nL
    sysctl net.ipv4

  7. #7
    Join Date
    May 2006
    Beans
    115

    Re: Question on IP address connect with samba

    I'm sorry. All my PCs are windows. Only the samba server is linux. My router is a actual basic router, too. Not the linux router. I don't think it can take commands.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •