LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices



Reply
 
Search this Thread
Old 07-14-2003, 02:39 PM   #1
hakcenter
Member
 
Registered: Apr 2003
Location: Not to far from the computer screen
Distribution: RedHat 9.0
Posts: 324

Rep: Reputation: 30
Linux router IPTABLES Howto


If someone will host the script, let me know and I'll edit this post.

Moderators, please sticky this.

Eth devices considered, eth0 eth1, one being WAN, one being internal LAN. Do not try to run this script remotely, you will be disconnected.

Last few lines must typed in console:

Flushing IP Tables Configuration

service iptables stop
service iptables save
service iptables start

Setting Default Rules

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

Securing Connections

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

iptables -P INPUT DROP
iptables -P FORWARD DROP

Please type the following:
ethX = WAN
ethZ = LAN
iptables -A INPUT -i ethZ -j ACCEPT
iptables -A INPUT -i ethX -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -t nat -A POSTROUTING -o ethX -j MASQUERADE

Last edited by hakcenter; 08-08-2003 at 06:54 PM.
 
Old 07-14-2003, 10:03 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,744
Blog Entries: 54

Rep: Reputation: 2973Reputation: 2973Reputation: 2973Reputation: 2973Reputation: 2973Reputation: 2973Reputation: 2973Reputation: 2973Reputation: 2973Reputation: 2973Reputation: 2973
With all due respect, I think this is a bit terse to call it a "Linux router IPTABLES Howto". You say "Eth devices considered, eth0 eth1, one being WAN, one being internal LAN" but looking tru this I spot 6 devices: eth{0,1,X,y,z,Z}. IMHO it cannot be considered complete w/o brief explanation, maybe a discussion could help you make it better.
 
  


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
howto relay ISPs dhcp ip's though linux router to LAN deice Linux - Networking 0 09-20-2004 12:40 PM
Linux Router HOWTO help required. adityanag Linux - Networking 2 09-15-2004 05:32 AM
Linux Gateway+Two NICS+Router+HOWTO pin_bk Linux - Networking 11 09-07-2004 01:29 PM
Howto setup two stage firewall? Linux and router-in-a-box? drdirt Linux - Security 5 01-10-2004 03:51 AM
isight through a linux router/firewall (iptables) rob_roman23 Linux - Networking 2 07-23-2003 11:19 AM


All times are GMT -5. The time now is 12:52 PM.

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