LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   iptables rules (https://www.linuxquestions.org/questions/linux-security-4/iptables-rules-42520/)

Darin 01-23-2003 12:39 PM

iptables rules
 
My linux firewall has ppp0 on a dialup to the internet and eth0 as the internal LAN, I'd like to set up rules for both ppp0 and eth1 as firewalled connections so I can run cable/dsl with dialup fallback and also set up eth0 and eth2 as internal subnets that can talk to each other (yes there are 3 NICs in there now) and also both access The Internet through the firewall.

I've read tons of firewall howtos/forums/documents and unfortunatly most of them cover ipchains while very few mention anything indepth about iptables. So my question is, does anyone have any good rules they use for iptables and/or info on how to set rules so they work with multiple internal and/or external interfaces?

my rc.firewall has this very simple ruleset currently:

echo " FWD: Allow all connections OUT and only existing and related ones IN"
/usr/sbin/iptables -A FORWARD -i ppp0 -o eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT
/usr/sbin/iptables -A FORWARD -i eth0 -o ppp0 -j ACCEPT
/usr/sbin/iptables -A FORWARD -j LOG
echo " Enabling SNAT (MASQUERADE) functionality on ppp0"
/usr/sbin/iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE

peter_robb 01-23-2003 04:32 PM

There are enough variables in your request to keep us busy for a while, so, the definitive iptables tutorial is here.


All times are GMT -5. The time now is 03:57 PM.