Disable Netbios Broadcasts on FreeBSD 7

Posted on 2012-09-07
Last Modified: 2016-02-11
goal: disable netbios broadcasts from port 137/138 w/o stopping samba/nmbd:

i tried:

vi /usr/local/etc/smb.conf

added line:

disable netbios = yes

to global parameters

restarted samba

/usr/local/etc/rc.d/samba restart

seems to have processed the parameters according to:


to no avail.

could this be accomplished via iptables? or how can this be accomplished?

thanks, in advance.
Question by:2newbie
    LVL 82

    Expert Comment

    by:Dave Baldwin
    This page says that Samba itself isn't doing the broadcasts.

    Author Comment

    Follow up Question or to rephrase the question:

    How would I block outbound udp\tcp netbios broadcasts on ports 137 and 139 via ipfw [freebsd] w/o effecting samba?

    I already tried disabling netbios via smb.conf - to no avail.

    albeit, /var/log/samba/log.smbd showed it processed the new parameter.
    LVL 82

    Expert Comment

    by:Dave Baldwin
    You have to find the service that is doing it.  The article I linked says Samba doesn't use netbios broadcasts.
    LVL 25

    Accepted Solution

    iptables is linux-specific

    freebsd features ipf, pf, ipfw firewalls natively

    "block out from any to any port = 137" should do the trick in any of them, obviously doing the same for port 138

    in order to activate a firewall, please refer to the handbook : you will find a clear and simple 2 or 3 steps tuto and valuable information that can be read within minutes.


    then i also believe determining what produces these broadcasts would be more interesting

    the only 2 softwares i can think about that are likely to do so would be samba (but i also kinda recollect it should not use broadcasts) and possibly ZFS if you activated the builtin SMB/CIFS shares

    to map network connections to processes, you can use sockstat (builtin) or install lsof, and possibly also get some information using netstat as root. these may also work for udp, depending on the flags used (mainly SO_REUSE) and the fact that a bind() call was made on the socket


    how the hell did you determine that your freeebsd machine was sending broadcasts ?

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Join & Write a Comment

    Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
    Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap ( Version 1.2 2.      Jpcap( Version 0.6 Prerequisite: 1.      GCC …
    Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
    Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now