ipchains a poradi pravidel

imf imf na centrum.cz
Pátek Leden 5 14:14:09 CET 2001


Ja mam take dotaz na toto tema mam udelanou maskaradu a mam nasledujici problem ftp zevnitr mi funguje pouze v pasivnim modu. Co s tim musim udelat???

mirek na kacir:~$ cat /etc/init.d/ipchains

#!/bin/sh

#

# ipchains



case "$1" in

start)

echo -n "Starting daemon:"

echo -n " portmap"

echo "."



echo 1 > /proc/sys/net/ipv4/ip_always_defrag

/sbin/ipchains -F input

/sbin/ipchains -A input -s 192.168.0.0/255.255.0.0 -i eth0 -j DENY



/sbin/ipchains -A input -d 192.168.0.0/255.255.0.0 -i eth0 -j DENY

#ftp

/sbin/ipchains -A input -i eth0 -d 194.108.xxx.xxx -y --destination-port 20 -p TCP -j ACCEPT

/sbin/ipchains -A input -i eth0 -d 194.108.xxx.xxx -y --destination-port 21 -p TCP -j ACCEPT

#ssh

/sbin/ipchains -A input -i eth0 -d 194.108.xxx.xxx -y --destination-port 22 -p TCP -j ACCEPT

#telnet

/sbin/ipchains -A input -i eth0 -d 194.108.xxx.xxx -y --destination-port 23 -p TCP -j ACCEPT

#smtp

/sbin/ipchains -A input -i eth0 -d 194.108.xxx.xxx -y --destination-port 25 -p TCP -j ACCEPT

#http

/sbin/ipchains -A input -i eth0 -d 194.108.xxx.xxx -y --destination-port 80 -p TCP -j ACCEPT

#pop3

/sbin/ipchains -A input -i eth0 -d 194.108.xxx.xxx -y --destination-port 110 -p TCP -j ACCEPT

#news

/sbin/ipchains -A input -i eth0 -d 194.108.xxx.xxx -y --destination-port 119 -p TCP -j ACCEPT

#imap

/sbin/ipchains -A input -i eth0 -d 194.108.xxx.xxx -y --destination-port 143 -p TCP -j ACCEPT





/sbin/ipchains -A input -i eth0 -d 194.108.98.26 -y -p TCP -j ACCEPT

/sbin/ipchains -F forward

/sbin/ipchains -A forward -s 192.168.1.0/255.255.255.0 -d 0.0.0.0/0.0.0.0 -j MASQ

#/sbin/ipchains -A forward -s 192.168.1.96/255.255.255.0 -d 0.0.0.0/0.0.0.0 -j MASQ

/sbin/ipchains -A forward -s 192.168.xxx.0/255.255.255.0 -d 0.0.0.0/0.0.0.0 -j MASQ

/sbin/ipchains -A forward -s 192.168.99.0/255.255.255.0 -d 0.0.0.0/0.0.0.0 -j MASQ



;;

*)

exit 1

;;

esac

exit 0

2) Chci mit maskaradu tak aby 2 pocitace byly pristupne zvenku tzn. na vnejsim interface budu mit 3 vnejsi IP adresy a jeden dve vnitrni adresy se budou prekladat na vnejsi ale i obracene ostatni vnitrni pocitace se budou prekladat na 3. zbylou IP adresu. Take bych chtel abych ty vnitrni pocitace tam mel kazdy zvlast a abych kazdou IP mel jako zvlastni pravidlo. Ve vysledky by to bylo tak, ze pokud si nekdo nastavi tento stroj jako DG tak mu to nebude chodit dokud ja tam nepridam pravidlo pro jeho IP. Tyto restrikce se tykaji pouze pristupu do internetu. Nikoli routovani mezi jednotlivymi vnitrnimi subsitemi

3) mam tam squid, ktery pracuje , ale kdyz ho chci pouzit pouze jak0o proxy, kterou nastavim v prohlizeci tak se objevi toto:

ERROR The requested URL could not be retrieved

While trying to retrieve the URL: http://www.cz/

The following error was encountered:

Access Denied.

Access control configuration prevents your request from being allowed at this time. Please contact your service provider if you feel this is incorrect.



Generated Fri, 05 Jan 2001 08:27:17 GMT by kacir.autocont.cz (Squid/2.2.STABLE5)

Co mi tam chybi?

Diky za radu





Další informace o konferenci Linux