LinuxQuestions.org
Register a domain and help support LQ
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 02-22-2004, 07:48 AM   #1
hotrodowner
Member
 
Registered: Mar 2002
Distribution: Too many to count
Posts: 368

Rep: Reputation: 30
firewall outgoing connections


There have been port scanning viruses going around from people bringing in computers from their homes. I need a linux computer that will allow dhcp, and only forward udp ports 53, and tcp ports 20, 21, and 80. I have tried to make iptables do this with both the filters table and the nat table, but it either forwards everything, or nothing. Can someone please tell me what commands to give iptables?
 
Old 02-22-2004, 09:27 AM   #2
g-rod
Member
 
Registered: Dec 2003
Location: Long Island, NY USA
Distribution: RedHat, SUSE
Posts: 336

Rep: Reputation: 30
The iptables forward change should look like
iptables -P FORWARD DROP;
iptables -I FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT;
iptables -I FORWARD -i eth 0 -p tcp -d 0.0.0.0/0 --dport 80 -J ACCEPT;
iptables -I FORWARD -i eth 0 -p udp -d 0.0.0.0/0 --dport 53 -J ACCEPT;
iptables -I FORWARD -i eth0 -p tcp -d 0.0.0.0/0 --dport 20:21 -J ACCEPT;
iptables -A FORWARD -i eth0 -o eth1 -j log --log-prefix "internal drop";
iptables -t nat -I POSTROUTING -i eth0 -o eth0 -j MASQUERADE;

I assumed that eth0 is the internal network card and eth1 is external. You will need to add input rules to secure the box.
 
Old 02-22-2004, 12:51 PM   #3
hotrodowner
Member
 
Registered: Mar 2002
Distribution: Too many to count
Posts: 368

Original Poster
Rep: Reputation: 30
Thank you very much I was leaving the standard FORWARD rule at the end, so I had the default to DROP, then I told it to accept certain rules, but then I had it forward everything anyways. Thanks again.
 
  


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
SuSEfirewall - how to block outgoing connections dbraghi Linux - Security 4 04-02-2005 09:08 PM
Intercept outgoing traffic through a firewall???? macburton Linux - Security 1 10-17-2004 01:10 PM
preventing users to make outgoing connections Shroom Linux - Security 5 06-15-2003 05:57 AM
outgoing connections DonMiner Linux - Networking 2 05-02-2003 09:51 AM
Spurious outgoing connections while browsing LQ the theorist LQ Suggestions & Feedback 1 05-24-2002 10:29 AM


All times are GMT -5. The time now is 07:40 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration