LinuxQuestions.org
Help answer threads with 0 replies.
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 05-15-2006, 10:19 AM   #1
JJX
Member
 
Registered: Mar 2004
Location: Greece
Distribution: Debian
Posts: 351

Rep: Reputation: 31
iptables and two ethernet


I have a linux server that runs only apache (port 80) and ssh (port 22).
Address of eth cards:
eth0: 192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0
eth1: 192.168.2.1 Bcast:192.168.2.255 Mask:255.255.255.0

Until now i use this iptables script:
Quote:
iptables -P INPUT ACCEPT
iptables -F
iptables -A INPUT -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT
#### ICMP HANDLING ###
iptables -A INPUT -p icmp -m icmp --icmp-type 8 -m limit --limit 4/sec -j ACCEPT
iptables -A INPUT -p icmp -m icmp ! --icmp-type 8 -j ACCEPT
iptables -A INPUT -p icmp -j DROP

# Tell netfilter that all TCP sessions do indeed begin with SYN
iptables -A INPUT -p tcp ! --syn -m state --state NEW -j LOG --log-prefix "FIREWALL:Stealth scan?"
iptables -A INPUT -p tcp ! --syn -m state --state NEW -j DROP
# Accept inbound packets that are part of previously-OK'ed sessions
iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
# Accept ssh
iptables -A INPUT -p tcp -j ACCEPT --dport 22 -m state --state NEW
#Accept www
iptables -A INPUT -p tcp -j ACCEPT --dport 80 -m state --state NEW
# Default policy drop
iptables -P INPUT DROP
When i "nmap 192.168.1.1" from the same linux server i see many ports open (like port 9/13 etc...)
Why that? I think all ports except 22 and 80 should be closed....
 
Old 05-15-2006, 10:28 AM   #2
Linux~Powered
Member
 
Registered: Jan 2004
Location: /lost+found
Distribution: Slackware 14.2
Posts: 849

Rep: Reputation: 33
Because those services are running. A firewall doesn't shut down those services it just filters them. Go into your /etc/sercives, or where ever they are, and stop them. Or just filter them with your firewall.
 
Old 05-15-2006, 01:35 PM   #3
JJX
Member
 
Registered: Mar 2004
Location: Greece
Distribution: Debian
Posts: 351

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by Linux~Powered
Because those services are running. A firewall doesn't shut down those services it just filters them. Go into your /etc/sercives, or where ever they are, and stop them. Or just filter them with your firewall.
Yes, the firewall doesnt stop the services but when default policy is DROP [iptables -P INPUT DROP] it should block the ports.
Shouldnt it?

On an other computer with one ethernet and the same firewall it blocks all ports !
 
  


Reply


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
iptables and load balance ethernet john8675309 Linux - Software 2 04-28-2006 07:50 PM
iptables v1.2.9: Unknown arg `/sbin/iptables' Try `iptables -h' or 'iptables --help' Niceman2005 Linux - Security 4 12-29-2005 08:20 PM
Switch ethernet- to wireles - to ethernet? pterandon Linux - Networking 0 05-06-2005 04:28 PM
port forwarding with iptables and multiple ethernet interf. CleonII Linux - Security 8 04-15-2005 08:27 AM
Can't Bring Ethernet Up / Can't Active Ethernet / Guigo Linux - Newbie 8 04-03-2004 08:31 AM

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

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