Skip to contentSkip to conversation

Firewall Setup on RH 9

DISCUSSION Christo Bezuidenhout 2 participants 2 messages Jul 3, 2003

lore
Share & tools
lore
#0 lore raw

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

#1 lore raw

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Christo Bezuidenhout
Sent: Thursday, July 03, 2003 8:38 AM
To: [email protected]
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