April 21, 2019

Routing NetBIOS with Linux - page 2


  • October 29, 1999
  • By Matt Clements

We will need several things to get this to work. First of all we need a Linux kernel capable of port forwarding, like the 2.2.x kernels which are capable of port forwarding without any patching. The 2.0.3x kernels will need to be patched. To find out how to do this have a look at this page:
Compile a kernel with the port forwarding feature enabled.

Next we will need the samba source. Follow a link from the Samba home page to download the source from your nearest mirror.

And we need the nbfw patch. This can be obtained from

Next we need to patch the samba source:

cd /usr/src/samba-2.0.x/source
patch -p0 < /tmp/nbfw-0.28/nbfw.diff

Finally we need to build the nbfw-patched version of samba. Do this in the same way that you would normally build samba...i.e., enter the source directory and enter

make install

You then edit the makefile, after the ./configure stage, to amend the locations of samba's various support files. All being well, we should now have built samba, and also the nbfw-enabled versions of the samba daemons (nmbdnbfw and smbdnbfw).

Next, we will need to create our smb.conf file. The default path to this file is /etc/smb.conf.

Something like this should work fine as a starting point:

   workgroup = DOMAIN
   server string = Samba Server
   share modes = yes
   interfaces =
   nbfw backend hosts =
   nbfw deny hosts =
   nbfw netbios names = "DOMAIN" BACKEND-2 BACKEND-3 USER-2 USER-3
   encrypt passwords = yes
   name resolve order = lmhosts bcast

   comment = Temporary file space
   path = /tmp
   read only = no
   public = yes


  • the lines specifically required for nbfw are the three that begin with nbfw, and the interfaces line.
  • Add the nbfw netbios names line if popup messages are required.
  • Most Popular LinuxPlanet Stories