RE: Firewall Setup on RH 9

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



-----Original Message-----
From: netfilter-admin@xxxxxxxxxxxxxxxxxxx
[mailto:netfilter-admin@xxxxxxxxxxxxxxxxxxx] On Behalf Of Christo
Bezuidenhout
Sent: Thursday, July 03, 2003 8:38 AM
To: netfilter@xxxxxxxxxxxxxxxxxxx
Subject: Firewall Setup on RH 9


I need to do the following.

1. I have a Redhat 9 Box with Two nics. NIC1 is my Private Network. NIC2
is connected to my PPP0 interface for internet access. I need to add
NIC3 which will be second Private Network.

2. Both NIC1 and NIC3 Should be able to Connect VIA NIC2 to Internet. 
NIC1 Should be able to connect to NIC3 but NIC3 must not be ABLE to
Connect to NIC1 's network

I have my network already setup as in 1 above and it working very well.
I'm using iptables to get this running. 

Please mail me offline if more info needed or with a suggestion

Christo 

Perhaps something like this.

NIC1=eth0
NIC2=ppp0
NIC3=eth1

modprobe ip_nat_ftp
 
iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -P FORWARD DROP

iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A OUTPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

#Allow everything out to $NIC2
iptables -A FORWARD -o $NIC2 -j ACCEPT
#Accept only connections from $NIC1 to $NIC3
iptables -A FORWARD -i $NIC1 -o $NIC3 -j ACCEPT

iptables -t nat -A POSTROUTING -o $NIC2 -j MASQUERADE
sysctl -w net.ipv4.ip_forward=1


/Klintan




[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux