LinuxQuestions.org
Review your favorite Linux distribution.
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 05-10-2010, 01:45 PM   #1
mpapet
Member
 
Registered: Nov 2003
Location: Los Angeles
Distribution: debian
Posts: 548

Rep: Reputation: 72
Thumbs up iptables & DNS packets


Hi,

I'm trying to work out a way to inspect/modify dns requests as an advertising filter. Iptables is a good place to do this, but I'm having some problems disassembling the packet.

Test:
On my dev box, when a DNS reply is returned from a request made on the dev box. I use this rule to route the reply packet through a queue:

iptables -A INPUT -p udp --sport 53 -j NFQUEUE --queue-num 1


Will the rule catch the inbound udp packet with the dns reply in it?

I get something in the queue, but it's unintelligible when attempting to disassemble the packet. I don't want to move onto looking at my program until I get some feedback on the rule.

Here's a primitive diagram of what I'm working towards:

host ->DNS request->iptables(no outbound rules)-> DNS Server
->DNS Answer ->iptables(queue udp 53 packets)
->inspect packet program-> Allow/Deny -> host processes allowed packets
 
Old 05-10-2010, 02:01 PM   #2
Steviepower
Member
 
Registered: May 2010
Location: Eindhoven
Distribution: ubuntu/debian
Posts: 152

Rep: Reputation: 25
I've done a similar thing with snort + squid... I hope this helps you a bit.
 
  


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
plz give me some firewall(iptables or ipchain) for my dns,web & mail server fadu Linux - Security 6 07-03-2009 11:44 PM
iptables not dropping packets? Petro P Linux - Networking 0 07-03-2008 11:21 PM
IPTables and matching packets. Deleriux Linux - Networking 1 05-28-2008 06:08 PM
iptables & netfiler: Limit icmp Packets Per IP Address wwnexc Linux - Networking 7 08-01-2006 03:25 PM
iptables won't let packets in - check please? Simon Bridge Linux - Security 1 01-23-2004 09:26 PM

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

All times are GMT -5. The time now is 11:43 AM.

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