Welcome to Tech Support Forum home to more then 136,000 problems solved. Issues have included: Spyware, Malware, Virus Issues, Windows, Microsoft, Linux, Networking, Security, Hardware, and Gaming Getting your problem solved is as easy as:
1. Registering for a free account
2. Asking your question
3. Receiving an answer

Registered members:
* Get free support
* Communicate privately with other members (PM).
* Removal of this message
* See fewer ads.
* And much more..

 



Want to know how to post a question? click here Having problems with spyware and pop-ups? First Steps
Go Back   Tech Support Forum > Alternative Computing > Linux Support
User Name
Password
Site Map Register Donate Rules Blogs Mark Forums Read


Linux Support Linux - Operating Systems and Applications Support

Reply
 
LinkBack Thread Tools
Old 07-23-2008, 03:50 PM   #1 (permalink)
Registered User
 
Join Date: Jul 2008
Posts: 2
OS: Vista Sp1


Iptables guide

i have used linux before (mandrake, ubuntu/kubuntu) with a gui and never really had to dig into the guts of the kernal. now i have a vds and i need help with confiquring and enabling iptables, i have tired installing APF to manage this for me, but the install went wrong (didnt find this out until after spending 2 hours editting the conf.apf file) and i wanted to know if there is a reasonably easy guide out there that can help me get iptables confiqured correctly. im looking to block both incoming/outgoing udp/tcp port ranges and setting which ports i want to be in htm mode. my vds is running fedora core 6 with cpanel/whm. thank you in advance to any reply's and help :)

Last edited by FiLeBaRoN; 07-23-2008 at 03:51 PM.
FiLeBaRoN is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Important Information
Join the #1 Tech Support Forum Today - It's Totally Free!

TechSupportForum.com is a leading support website for your computer needs. We offer free, friendly and personalized computer support. Why pay to have your computer fixed when you can do it for free.

Join TechSupportforum.com Today - Click Here

Old 07-24-2008, 02:31 PM   #2 (permalink)
Registered User
 
hal8000's Avatar
 
Join Date: Dec 2006
Location: UK
Posts: 229
OS: PCLinux2009/Ubuntu/XP


Re: Iptables guide

Quote:
Originally Posted by FiLeBaRoN View Post
i have used linux before (mandrake, ubuntu/kubuntu) with a gui and never really had to dig into the guts of the kernal. now i have a vds and i need help with confiquring and enabling iptables, i have tired installing APF to manage this for me, but the install went wrong (didnt find this out until after spending 2 hours editting the conf.apf file) and i wanted to know if there is a reasonably easy guide out there that can help me get iptables confiqured correctly. im looking to block both incoming/outgoing udp/tcp port ranges and setting which ports i want to be in htm mode. my vds is running fedora core 6 with cpanel/whm. thank you in advance to any reply's and help :)

Theres no easy guides but the wiki has simple examples
http://en.wikipedia.org/wiki/Iptables

and later in the document links to external links, man iptables
is a good source for doc also
hal8000 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 07-24-2008, 09:08 PM   #3 (permalink)
Registered User
 
Join Date: Jul 2008
Location: MManila
Posts: 3
OS: JagzOS


Re: Iptables guide

best practice for firewall making is to deny everything.
and open just what you need
there are 3 tables in iptables filter, nat, and mangle, the default is filter.

the syntax is like this;
iptables [tables]/[options]/[interface]/[protocol]/[ipaddress][ports][conditions]
note: this is not the respective parameters

sample:

# flusing in chains
iptables -F

# flush user-define chains
iptables -X

# table nat
iptables -t nat -F
iptables -t nat -X

# table mangle
iptables -t mangle -F
iptables -t mangle -X

# set all default rules to DROP
iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -P FORWARD DROP

# allow loopback connections
# for incoming connection
iptables -A INPUT -i lo -j ACCEPT
# for outgoing connections
iptables -A OUTPUT -o lo -j ACCEPT

# user specific rules and policy starts here
hajji is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 07-24-2008, 10:22 PM   #4 (permalink)
Registered User
 
Join Date: Jul 2008
Location: MManila
Posts: 3
OS: JagzOS


Re: Iptables guide

for the in and out sample rules

# incoming http connection (port 80)
iptables -A INPUT -i eth0 -s 0/0 --source-port 1024:65535 -d 192.168.0.1 --destination-port 80 -j ACCEPT
# outgoing http (reply)
iptables -A OUTPUT -o eth0 -s 192.168.0.1 --source-port 80 -d 0/0 --destination-port 1024:65535 -j ACCEPT
hajji is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 07-25-2008, 08:28 AM   #5 (permalink)
Moderator/Fedora Amb.
 
wmorri's Avatar
 
Join Date: May 2008
Location: /pm/etc
Posts: 2,821
OS: Window 7/Fedora 10

My System

Send a message via AIM to wmorri
Re: Iptables guide

Also, you can check out the Ubuntu community documentation on it here.

Cheers!
__________________


Linux Forever!

wmorri is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -7. The time now is 01:35 AM.



Copyright 2001 - 2009, Tech Support Forum
Home Tips Plus | Outdoor Basecamp | Automotive Support Forum

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85