I want to create a gateway firewall for my network . I want to block all the internal traffic on gateway and allow it from two computers only . On gateway
--> eth0 is network card in gateway PC that connects to the Internet
--> eth1 is network card in gateway PC that connects to my internal network
I want to accept traffic from only two ip from internal network and forward them from eth0 to main internet and block all rest traffic.
Allow ip 192.168.10.25 and 192.168.10.14
My rules are as follows.
iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -P FORWARD DROP
iptables -I INPUT -s 192.168.10.25 -j ACCEPT
iptables -I INPUT -s 192.168.10.14 -j ACCEPT
iptables -I OUTPUT -s 192.168.10.25 -j ACCEPT
iptables -I OUTPUT -s 192.168.10.14 -j ACCEPT
iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE
iptables --append FORWARD --in-interface eth1 -j ACCEPT
echo "1" > /proc/sys/net/ipv4/ip_forward
Please any one can correct my rules .
-d
for destination (instead of-s
for source) on the twoOUTPUT
rules?