LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 01-25-2007, 02:22 AM   #1
collen
Member
 
Registered: Jun 2003
Location: /
Distribution: Fedora/Debian
Posts: 86

Rep: Reputation: 15
local network passes fire wall !?


hello everyone,

i have some sort of problem with my firewall (iptables)

our local network shows up on our internet imap server

locallan <-> firewalled router <-> intet
|
mail-server ^

here is some iptables info

eth1 and eth2 are local lan's, eth0 is the network interface connected to the internet
i use a masquerade rule, to coverup the local lan IP's,
but as you see in the iptables log, the ip's for the local lan still show's up ???
it's only for the imap services, other ports don't have this problem ???

how is this possible??? i thought i had a normal good firewall stript?


---iptables log--------------------------
From 192.168.9.93 - 6 packets
To 81.112.2.23 - 6 packets
Service: imap2 (tcp/143) ([IPTABLES DROP] - 6 packets
From 192.168.9.151 - 6 packets
To 81.112.2.23 - 6 packets
Service: imap2 (tcp/143) ([IPTABLES DROP] - 6 packets
-----------------------------------------
#!/bin/bash

iptables -F
iptables -t nat -F
iptables --delete-chain
iptables --table nat --delete-chain
echo 1 > /proc/sys/net/ipv4/ip_forward
echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
echo 0 > /proc/sys/net/ipv4/conf/all/accept_source_route
echo 0 > /proc/sys/net/ipv4/conf/all/accept_redirects
#####################
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT

#iptables -A INPUT -m state --state INVALID -j DROP
#iptables -A FORWARD -m state --state INVALID -j DROP
#iptables -A OUTPUT -m state --state INVALID -j DROP

iptables -A INPUT -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT

iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT
iptables -A FORWARD -i eth0 -o eth1 -j ACCEPT

iptables -A FORWARD -i eth2 -o eth0 -j ACCEPT
iptables -A FORWARD -i eth0 -o eth2 -j ACCEPT

iptables -A INPUT -i eth1 -j ACCEPT
iptables -A INPUT -i eth2 -j ACCEPT

iptables -A INPUT -i eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
#####################


(ps. ip's are fingerd!!)
 
Old 01-25-2007, 05:27 PM   #2
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 69
It looks like you firewall is completely open to traffic coming in the external interface (eth0) and going to either of the LAN interfaces (eth1/2). Is that what you want? What types of traffic do you want to allow?
 
Old 01-26-2007, 01:50 AM   #3
collen
Member
 
Registered: Jun 2003
Location: /
Distribution: Fedora/Debian
Posts: 86

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by Capt_Caveman
It looks like you firewall is completely open to traffic coming in the external interface (eth0) and going to either of the LAN interfaces (eth1/2). Is that what you want? What types of traffic do you want to allow?
ehh that's the point. it isn't !!

--> iptables -P INPUT DROP

by default all input's and forward's are droped !!
only connections that are esstablished are allowed

--> iptables -A INPUT -i eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT

what i don't get is that, i use the 'MASQUERADE' option, so internal ip's (192.168.9.XX) should not show up outside the lan's !?!
some how IMAP connection's by-passes the 'MASQUERADE' option, but i don't know why !!
 
  


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
fire wall berrance Red Hat 2 08-21-2004 11:55 AM
Do I need a fire wall? shanenin Linux - Security 9 12-11-2003 01:21 AM
how do i get through a fire wall pureskater561 Linux - Security 2 11-04-2003 09:48 AM
fire wall question newlinuxguy Linux - Networking 1 12-26-2002 06:09 PM
Going through the great [fire]wall bxb32001 General 26 10-19-2002 09:57 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

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