LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 12-08-2009, 03:14 PM   #1
aarondcounts
LQ Newbie
 
Registered: Oct 2007
Posts: 6

Rep: Reputation: 0
iptables on a promiscuous mode interface


I am trying to do something that in theory should be extremely easy but doesn't seem to work for me. I want to take a port that has mirrored traffic (used for my web-filtering product) and eliminate all of the traffic from networks that are not filtered. I want to do this by using Citrix XenServer and the iptables built into the server and DROP the packets that do not match what I want to accept. I have attached a basic design.

Simple explanation:

Traffic comes across span, hits the physical server, iptables filters off traffic, remaining traffic is visible to Windows Virtual servers.

Network Design
 
Old 12-08-2009, 07:12 PM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
Looks like you're trying to set up an IDS, can you post the rules you have so far ?
 
Old 12-09-2009, 06:59 AM   #3
aarondcounts
LQ Newbie
 
Registered: Oct 2007
Posts: 6

Original Poster
Rep: Reputation: 0
# Generated by iptables-save v1.3.5 on Tue Dec 8 14:24:06 2009
*raw
:PREROUTING ACCEPT [776:101474]
:OUTPUT ACCEPT [424:50996]
#:Webfilter_IDS - [0:0]
#-A PREROUTING -s 172.24.0.0/255.255.0.0 -i eth5 -j Webfilter_IDS
#-A Webfitler_IDS -s 172.24.253.0/255.255.255.0 -i eth5 -j DROP
COMMIT
# Completed on Tue Dec 8 14:24:06 2009
# Generated by iptables-save v1.3.5 on Tue Dec 8 14:24:06 2009
*mangle
:PREROUTING ACCEPT [2127:303772]
:INPUT ACCEPT [1681:217868]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [1156:171954]
:POSTROUTING ACCEPT [1156:171954]
#:Webfilter_IDS - [0:0]
#-A PREROUTING -s 172.24.0.0/255.255.0.0 -i eth5 -j Webfilter_IDS
#-A Webfilter_IDS -s 172.24.253.0/255.255.255.0 -i eth5 -j DROP
COMMIT
# Completed on Tue Dec 8 14:24:06 2009
# Generated by iptables-save v1.3.5 on Tue Dec 8 14:24:06 2009
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [1251:184611]
:RH-Firewall-1-INPUT - [0:0]
#:Webfilter_IDS - [0:0]
-A INPUT -j RH-Firewall-1-INPUT
-A FORWARD -j RH-Firewall-1-INPUT
#-A RH-Firewall-1-INPUT -s 172.24.0.0/255.255.0.0 -i eth5 -j Webfilter_IDS
-A RH-Firewall-1-INPUT -s 172.24.0.0/16 -i eth5 -j DROP
-A RH-Firewall-1-INPUT -i lo -j ACCEPT
-A RH-Firewall-1-INPUT -p icmp -m icmp --icmp-type any -j ACCEPT
-A RH-Firewall-1-INPUT -p esp -j ACCEPT
-A RH-Firewall-1-INPUT -p ah -j ACCEPT
-A RH-Firewall-1-INPUT -d 224.0.0.251 -p udp -m udp --dport 5353 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp -m udp --dport 631 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m tcp --dport 631 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A RH-Firewall-1-INPUT -p udp -m state --state NEW -m udp --dport 694 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 443 -j ACCEPT
-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited
#-A Webfilter_IDS -s 172.24.253.0/255.255.255.0 -i eth5 -j DROP
COMMIT
# Completed on Tue Dec 8 14:24:06 2009
 
Old 12-10-2009, 03:32 AM   #4
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
On a span port you probably don't want to reject any traffic as you would be interfering with the traffic you're mirroring, ( the source may get confused if it sees an ACK from the original destination as well as an ICMP host-prohibited from your XenServer for packets it sends).
Try changing the last REJECT to a DROP and see how that goes, if you could give an example of traffic that is getting through that you've denied that would be great

cheers
 
  


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
PPPoE and promiscuous mode lipun4u Linux - Networking 1 09-14-2008 06:53 AM
Wireshark in promiscuous mode TotalLinuxNoob Linux - Wireless Networking 5 06-20-2007 02:58 PM
Iptables in promiscuous mode Barzan Linux - Networking 3 10-23-2005 07:24 AM
Promiscuous Mode: Yes or No? AvatarofVirgo Linux - Security 3 02-22-2005 07:22 PM
Reconfiguring an interface to run in promiscuous mode with no ip address kaplan71 Fedora 1 10-13-2004 02:05 PM

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

All times are GMT -5. The time now is 11:23 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