Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Security
User Name
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.


  Search this Thread
Old 04-21-2009, 09:08 AM   #1
Registered: May 2004
Posts: 43

Rep: Reputation: 15
Iptables: prevent spoofing with multiple internal nets?

Hi all,

I want to prevent spoofing in my iptables config. However, I am confused about how to go about it when using multiple internal nets. For instance:


So, to do anti-spoofing I have to put a line like:

iptables -A FORWARD -i eth1 -s ! (NET_1 OR NET_2) -j DROP

Obviously the above line won't work in iptables, but you see what I am trying to accomplish. Can anyone help me out?
Old 04-21-2009, 10:12 AM   #2
Registered: Feb 2009
Posts: 63

Rep: Reputation: 16
Create a rule for each single network?
Old 04-21-2009, 12:36 PM   #3
LQ Guru
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 377Reputation: 377Reputation: 377Reputation: 377
iptables -P FORWARD DROP
iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i eth1 -o eth0 -s -m state --state NEW -j ACCEPT
iptables -A FORWARD -i eth2 -o eth0 -s -m state --state NEW-j ACCEPT


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
solution to prevent arp spoofing h725 Linux - Security 2 01-22-2009 04:20 PM
Please help with anti-spoofing in iptables jnyunt Linux - Networking 1 06-23-2008 10:16 AM
iptables forward - multiple external to multiple internal astbis Linux - Networking 3 01-24-2008 04:27 PM
need help : iptables problems? arp spoofing romeo_tango Linux - Security 5 03-12-2007 06:43 AM
Preventing IP Spoofing through IPTABLES bkankur Linux - Security 8 02-27-2005 07:13 PM > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 07:01 PM.

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