brafik
2006-12-20 17:18:34 UTC
witam,
chce puscic forward tylko okreslonych portow, robie tak:
#!/bin/bash
serwisy="http pop3 smtp ssh"
iptables -P FORWARD DROP
for x in ${serwisy}
do
iptables -A FORWARD -i eth1 -o eth0 -s 10.138.0.0/255.255.255.0 -d 0/0 -p
tcp --dport ${x} -j ACCEPT
iptables -A FORWARD -i eth0 -o eth1 -s 0/0 -d 10.138.0.0/255.255.255.0 -p
tcp --dport ${x} -j ACCEPT
done
iptables -t nat -A POSTROUTING -s 10.138.0.0/24 -j MASQUERADE
wydaje mi sie ze powinno dzialac, ale cos jest nie tak, np. nie laduje stron
www
probowalem tez tak:
iptables -A FORWARD -s 10.138.0.0/24 -p tcp --dport ${x} -j ACCEPT
inny moja mysl to w petli:
iptables -A FORWARD -p tcp --dport ${x} -j ACCEPT
a za petla dodatkowo:
iptables -A FORWARD -i eth1 -o eth0 -s 10.138.0.0/255.255.255.0 -d 0/0 -j
ACCEPT
iptables -A FORWARD -i eth0 -o eth1 -s 0/0 -d 10.138.0.0/255.255.255.0 -j
ACCEPT
ale wtedy puszcza po wszystkich portach (tzn. kasuje w 'serwisy' http a
strony sie laduja)
prosze o pomoc
chce puscic forward tylko okreslonych portow, robie tak:
#!/bin/bash
serwisy="http pop3 smtp ssh"
iptables -P FORWARD DROP
for x in ${serwisy}
do
iptables -A FORWARD -i eth1 -o eth0 -s 10.138.0.0/255.255.255.0 -d 0/0 -p
tcp --dport ${x} -j ACCEPT
iptables -A FORWARD -i eth0 -o eth1 -s 0/0 -d 10.138.0.0/255.255.255.0 -p
tcp --dport ${x} -j ACCEPT
done
iptables -t nat -A POSTROUTING -s 10.138.0.0/24 -j MASQUERADE
wydaje mi sie ze powinno dzialac, ale cos jest nie tak, np. nie laduje stron
www
probowalem tez tak:
iptables -A FORWARD -s 10.138.0.0/24 -p tcp --dport ${x} -j ACCEPT
inny moja mysl to w petli:
iptables -A FORWARD -p tcp --dport ${x} -j ACCEPT
a za petla dodatkowo:
iptables -A FORWARD -i eth1 -o eth0 -s 10.138.0.0/255.255.255.0 -d 0/0 -j
ACCEPT
iptables -A FORWARD -i eth0 -o eth1 -s 0/0 -d 10.138.0.0/255.255.255.0 -j
ACCEPT
ale wtedy puszcza po wszystkich portach (tzn. kasuje w 'serwisy' http a
strony sie laduja)
prosze o pomoc
--
/jk
/jk