LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-08-2010, 08:15 AM   #1
tincboy
Member
 
Registered: Apr 2010
Posts: 36

Rep: Reputation: 0
how to block netbios broadcasts


Hello,
I've a server in an European data center,
My server is receiving a lot of UDP Netbios Boradcast packets (I've sniffed them via tcpdump )

I've block the sender IP via iptables but tcpdump again shows the packets that are receiving.

an example tcpdump output
16:35:25.829592 IP SENDER-IP.netbios-ns > MY-SERVER-IP.255.netbios-ns: NBT UDP PACKET(137): QUERY; REQUEST; BROADCAST

How can I block those broadcast packets?
 
Old 10-08-2010, 12:59 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Are you doing a "DROP" in the iptables rule? You'll still see the traffic but should also see it DROPped. When I had to do similar for stuff hitting my DNS server I could still see it in tcpdump but could also see it was never getting to DNS after being dropped by iptables.
 
Old 10-08-2010, 04:08 PM   #3
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,974

Rep: Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623
You should actually block all that you don't need or only allow what you need. nebios should use a port but you block all udp that you don't use. Not sure what udp you'd normally want. Usually only port 80 tcp would be open maybe ssh ports or vpn ports.
 
Old 10-09-2010, 02:21 AM   #4
tincboy
Member
 
Registered: Apr 2010
Posts: 36

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by jefro View Post
You should actually block all that you don't need or only allow what you need. nebios should use a port but you block all udp that you don't use. Not sure what udp you'd normally want. Usually only port 80 tcp would be open maybe ssh ports or vpn ports.
I've heard that the iptables can't block broadcast packets.
Do you know a way to block them all?
 
Old 10-09-2010, 02:33 AM   #5
ganesh24pal@gmail.com
Member
 
Registered: Jun 2010
Location: Mumbai, India
Distribution: CentOS , Fedora, Open Suse
Posts: 193
Blog Entries: 5

Rep: Reputation: 3
Hi

You should actually block all that you don't need or only allow what you need.you can do this in iptables(Firewall level).
 
Old 10-09-2010, 02:45 AM   #6
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

I'm not necessarily sure you *want* to block NetBIOS, at least not within your local LAN. For better or worse, it's often an important for coexisting with Windows. For example, you might need NetBIOS in order to share disks or printers between Windows and Linux hosts.

HOWEVER:

If you really want to block it with iptables, it's easy. Just set up rules for the following ports:
Code:
- netbios-n       137 tcp 137 udp
- netbios-dgm             139 udp
- netbios-ssn     138 tcp 138 udp
- microsoft-ds    445 tcp 445 udp
- wins            137 tcp 137 udp
You could also try something like this:
Code:
iptables -I INPUT -m pkttype --pkt-type broadcast -j DROP
 
1 members found this post helpful.
Old 10-10-2010, 03:48 PM   #7
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,974

Rep: Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623
More examples. http://www.cyberciti.biz/tips/linux-...e-port-53.html
 
Old 10-10-2010, 10:14 PM   #8
kaushalpatel1982
Member
 
Registered: Aug 2007
Location: INDIA
Distribution: CentOS, RHEL, Fedora, Debian, Ubuntu, LinuxMint, Kali Linux, Raspbian
Posts: 166

Rep: Reputation: 10
You are right. We can not control broadcast packet to reach to the NIC, But yes we can drop the packets by IPTables. The Packets that you see is the packets you received on your interface in raw. You must check your iptables rules whether you are dropping packets or not.

You can check that by

iptables -nvx -t table-name -L

This will show you the rules prefixed with the packet count and data transfer.
 
1 members found this post helpful.
Old 10-11-2010, 02:37 AM   #9
tincboy
Member
 
Registered: Apr 2010
Posts: 36

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by kaushalpatel1982 View Post
You are right. We can not control broadcast packet to reach to the NIC, But yes we can drop the packets by IPTables. The Packets that you see is the packets you received on your interface in raw. You must check your iptables rules whether you are dropping packets or not.

You can check that by

iptables -nvx -t table-name -L

This will show you the rules prefixed with the packet count and data transfer.
Thanks, you are right.
I've successfully dropped broadcast packets by adding proper rule in forwarding rule.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
wall broadcasts not showing up in X terminals Axalon Linux - General 3 11-05-2007 01:14 PM
portsentry broadcasts ??? gabsik Linux - Networking 3 09-10-2006 07:30 PM
Getting broadcasts to the terminal debiant Linux - Networking 5 07-24-2006 09:51 AM
Snort only sees broadcasts jymbo Linux - Security 4 10-01-2003 07:00 PM
Should I be worried about the NBNS broadcasts _LR_ Linux - Networking 3 05-21-2003 09:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration