On Fri, 2003-04-04 at 20:01, JAGOT Vincent wrote:
> Salut !
>
> >
> >
> > J'ai le m�me probl�me, entre autres. Il n'y a plus de LAN chez moi :(
> >
> > Je suis stup�fait par l'effet d�vastateur de cette M�J : Je n'ai plus de
> > pr�f�rences Gnome, pleins de trucs sont cass�s, notamment iptables.
> > Nautilus ne se lance plus, et crache une erreur bonobo (qu'URPMI n'avait
> > pas r�-install� !!)
> >
>
> Je suis content, je ne suis pas le seul ! ! !
> ;-))
>
> Je commence m�me � me poser la question si je ne vais pas revenir en
> arri�re ! !
Mais non.
Bon il faut qu'on trouve. Ma fille vient rentrer du Tae-kwon-do, si je
remet pas le r�seau dans l'heure elle va me p�ter 1 cable et je vais
m'en prendre une.
Il y a une regle iptables, peut-�tre juste une seule, qui ne va pas.
Enfin, qui ne va plus.
Voila mon script iptables (crado, je sais, G pas le temps!), qui g�re �a
chez moi, attach�. Le truc c'est qu'il est assez ardu de d�terminer
laquelle de ces r�gles n'� plus maintenant l'heur de seoir � m�d�me
iptables.
Franchement changer D trucs aussi crutiaux C 1 peu violent, moi je
trouve.
pX
>
> A+
>
> Vincent
>
> --
> ################################################
> #JAGOT Vincent / [EMAIL PROTECTED] #
> # Linux Mandrake 9.1 / Kernel 2.4.18 #
> ################################################
>
>
>
> ----
>
> Vous souhaitez acquerir votre Pack ou des Services MandrakeSoft?
> Rendez-vous sur "http://www.mandrakestore.com"
--
pubkey 1024D/152F3376 Jabber:xaccrocheur
<---------------------
http://www.halluci.net
--------------------> ICQ:1858180
#!/bin/sh
# this script copyleft(c) 2003 xiX [EMAIL PROTECTED]
echo "Setting up RANELAN IPtables rules ([EMAIL PROTECTED])"
echo "Setting up RANELAN IPtables rules ([EMAIL PROTECTED])" >> /dev/console
# where iptables binary lives
IPTABLES=/sbin/iptables
# Setting up Forwarding
echo 1 > /proc/sys/net/ipv4/ip_forward
# Setting up IP spoofing protection
if [ -e /proc/sys/net/ipv4/conf/all/rp_filter ]
then
for f in /proc/sys/net/ipv4/conf/*/rp_filter
do
echo 1 > $f
done
fi
# Rules
ADSL_GW="10.0.0.10" # My Firewall external IP
ADSL_DEV="10.0.0.138" # IP of my ADSL Modem
LOOPBACK="127.0.0.1" # no comments
FW_LAN="192.168.1.1" # my LAN gateway.
LAN="192.168.1.0/24" # My subnet & bits.
ANY="0.0.0.0/0" # Internet
KEEPSTATE=" -m state --state ESTABLISHED,RELATED"
# Devices
NIC_LAN="eth1" # device for LAN
NIC_NET="eth0" # device for ADSL
# High ports
hports="1024:"
# Flush all
$IPTABLES -F
$IPTABLES -X
# Deny all by default
$IPTABLES -P INPUT DROP
$IPTABLES -P OUTPUT DROP
$IPTABLES -P FORWARD DROP
# ADSL Tunnel rules
$IPTABLES -A INPUT -j ACCEPT -i $NIC_NET -s $ADSL_DEV -d $ADSL_GW
$IPTABLES -A OUTPUT -j ACCEPT -o $NIC_NET -d $ADSL_DEV -s $ADSL_GW
# accept ANYthing on LOOPBACK device
$IPTABLES -A INPUT -j ACCEPT -p ALL -i lo
$IPTABLES -A OUTPUT -j ACCEPT -p ALL -o lo
# accept ANYthing LAN if from LAN device
$IPTABLES -A INPUT -j ACCEPT -p ALL -i $NIC_LAN
$IPTABLES -A OUTPUT -j ACCEPT -p ALL -o $NIC_LAN
# Redirectly transparently to Squid WWW requests (you have to setup a
# proxy (Squid for example) listeting on this IP & port)
#$IPTABLES -t nat -A PREROUTING -i $NIC_LAN -p TCP -j DNAT \
# --dport 80 --to-destination $FW_LAN:8080
# Activate Forwarding
$IPTABLES -A FORWARD -j ACCEPT -i $NIC_LAN -o ppp0 -s $LAN
$IPTABLES -A FORWARD -j ACCEPT -o $NIC_LAN -i ppp0 -s $ANY
# and masquerade LAN to Internet with Firewall Internet IP.
$IPTABLES -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
# activate established mode on all protocols (statefull inspection)
$IPTABLES -A OUTPUT -j ACCEPT -o ppp0 -p TCP $KEEPSTATE
$IPTABLES -A INPUT -j ACCEPT -i ppp0 -p TCP $KEEPSTATE
$IPTABLES -A OUTPUT -j ACCEPT -o ppp0 -p UDP $KEEPSTATE
$IPTABLES -A INPUT -j ACCEPT -i ppp0 -p UDP $KEEPSTATE
$IPTABLES -A OUTPUT -j ACCEPT -o ppp0 -p ICMP $KEEPSTATE
$IPTABLES -A INPUT -j ACCEPT -i ppp0 -p ICMP $KEEPSTATE
# Accept ports back from ppp, if flow return, all protocols
$IPTABLES -A OUTPUT -j ACCEPT -p ALL -o ppp0
# Special for service providers
# If you want to provide FTP server to Internet
#$IPTABLES -A INPUT -j ACCEPT -p TCP -i ppp0 --sport $hports --dport 20
#$IPTABLES -A INPUT -j ACCEPT -p TCP -i ppp0 --sport $hports --dport 21
# peer 2 peer stuff
# kaza, edonky,winmx,gnutella
# for PORT in 1214 4662 6257 6699 6346 6347
#for PORT in 4662
#do
# iptables -A FORWARD -p tcp --dport $PORT -j ACCEPT
# iptables -A FORWARD -p udp --dport $PORT -j ACCEPT
#done
#$IPTABLES -A INPUT -i $NIC_NET -p TCP -s 0/0 -d 0/0 --dport 4662:4666 -j ACCEPT
#$IPTABLES -A OUTPUT -o $NIC_NET -p TCP -s 0/0 -d 0/0 --dport 4662:4666 -j ACCEPT
#$IPTABLES -A INPUT -i $NIC_NET -p UDP -s 0/0 -d 0/0 --dport 4662:4666 -j ACCEPT
#$IPTABLES -A OUTPUT -o $NIC_NET -p UDP -s 0/0 -d 0/0 --dport 4662:4666 -j ACCEPT
# or a HTTP server
#$IPTABLES -A INPUT -j ACCEPT -p TCP -i ppp0 --sport $hports --dport 80
$IPTABLES -A INPUT -j ACCEPT -p TCP -i ppp0 --sport $hports --dport 4662
$IPTABLES -A FORWARD -p tcp --dport 4662 -j ACCEPT
$IPTABLES -A FORWARD -p udp --dport 4662 -j ACCEPT
# Drop broadcasts pollution (not logged)
$IPTABLES -A INPUT -i $NIC_NET -p ALL -j DROP -s 10.0.0.255
$IPTABLES -A INPUT -i $NIC_NET -p ALL -j DROP -d 10.0.0.255
$IPTABLES -A OUTPUT -o $NIC_NET -p ALL -j DROP -s 10.0.0.255
$IPTABLES -A OUTPUT -o $NIC_NET -p ALL -j DROP -d 10.0.0.255
$IPTABLES -A INPUT -i $NIC_NET -p ALL -j DROP -s 0.0.0.0
$IPTABLES -A INPUT -i $NIC_NET -p ALL -j DROP -d 0.0.0.0
$IPTABLES -A OUTPUT -o $NIC_NET -p ALL -j DROP -s 0.0.0.0
$IPTABLES -A OUTPUT -o $NIC_NET -p ALL -j DROP -d 0.0.0.0
$IPTABLES -A INPUT -i $NIC_NET -p ALL -j DROP -s 255.255.255.255
$IPTABLES -A INPUT -i $NIC_NET -p ALL -j DROP -d 255.255.255.255
$IPTABLES -A OUTPUT -o $NIC_NET -p ALL -j DROP -s 255.255.255.255
$IPTABLES -A OUTPUT -o $NIC_NET -p ALL -j DROP -d 255.255.255.255
# Reject and log others. Log into log level emergency, with line prefixes with 'FW'.
$IPTABLES -N log_and_drop
$IPTABLES -A INPUT -j log_and_drop
#$IPTABLES -A INPUT -j LOG --log-level emerg --log-prefix='FW'
$IPTABLES -A INPUT -j REJECT
$IPTABLES -A INPUT -i $NIC_NET -p TCP -s 0/0 --dport 4660:4666 -d 0/0 -j ACCEPT
$IPTABLES -A OUTPUT -o $NIC_NET -p TCP -s 0/0 --dport 4660:4666 -d 0/0 -j ACCEPT
echo "RANELAN IPtables rules set ([EMAIL PROTECTED])"
echo "RANELAN IPtables rules set ([EMAIL PROTECTED])" >> /dev/console
Vous souhaitez acquerir votre Pack ou des Services MandrakeSoft?
Rendez-vous sur "http://www.mandrakestore.com"