# NetBIOS broadcasts between two subnets

## kubalida

Hi,

I want to share NetBIOS connections (Win or Samba@Linux/*BSD) between

hosts in 2 subnetworks; say one is 192.168.1.0/255.255.255.0 and the other

is 192.168.2.0/255.255.255.0. All hosts in 2 networks are connected to each other with a router/internet gateway that is a member of both subnets.

My question is: is it possible to allow NetBIOS traffic between the 2 networks by assigning the hosts a broader netmask of, let's say, 255.255.0.0 (so they all would think they are in the same net) -- but _without_ changing the netmask on the router? Then, is it possible to make the router forward NetBIOS broadcasts from one network to the other?

BTW, How to make my iptables forward broadcasts? It doesn't do that if my default policy is DROP, and the forward rules are just like: iptables -A FORWARD -t filter -i eth0 -j ACCEPT, same with -i eth1 (masquerading for internet connections is put before that).

I was just wondering...

Kuba.

----------

## PowerFactor

I don't think there is a way to foward netbios broadcasts accoss routers.  It's ceartanly not a "normal" thing to do anyway.  One solution would be to setup the lmhosts files on every machine, but that could be cumbersome if your network has many machines.  One solution that might work ( I'm not at all sure about this one )  is to set up the lmhosts file on two machines (one on each network) so they can find each other,  and set their os level so they are always the master browsers on that net.

But the standard way to get smb working across networks would be to use wins.

----------

## petardi

Changing the netmask on the clients will not work. The client uses its netmask to determine when to ask for an IP directly (via ARP) and when to use a gateway. If you use a broader netmask, your subnets will not be able to see each other anymore.

----------

## grimshaw

You are asking for layer2 (where the broadcast occurs) and layer3 (where routing and subnets are managed) to play funny games.  There is logical separation between these two for good reason and you can achieve what you want (communication across subnets) without trying to forward broadcast information onto another subnet where it will be useless anyway.

As already pointed out, you can use samba for wins service which will keep a master browser environment along with all netbios names in a table that is reachable from either subnet.  So, configure wins in samba and configure your windows hosts to use it (or even deliver it via DHCP).

- John

----------

## jwegman

You do understand that you CAN forward netbios traffic and leave out the broadcasts... 

(Not for the seemless browser enabled connectivity of multiple subnets, but straight to the point connections.  For seemless connectivity, use WINS)

You will not have a "browser" pick list of machines to connect to via Windows or Samba, but if you need the SMB connectivity, you can map drives on another subnet manualy via hostname or IP.  I use internal DNS servers with a seperate zone for each subnet for name resolution, however as stated by PowerFactor, host files on each client will do the same thing with more work per client -or- use WINS (uggh)

----------

