Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[RESEAU] configuration
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index French
View previous topic :: View next topic  
Author Message
outreal
Tux's lil' helper
Tux's lil' helper


Joined: 21 Oct 2003
Posts: 77

PostPosted: Fri Jan 16, 2004 7:42 pm    Post subject: [RESEAU] configuration Reply with quote

Bonjour,
J'ai deux machines en réseau, celle qui a Gentoo et windows et qui possède la connexion ADSL; et l'autre qui tourne un Mdk 9.2

Le pb est que qd je suis sous win, j'arrive à partager la connexion internet, mais quand je suis sur gentoo, pas moyen de le faire. Je ne vois même pas l'aute machine.

Quelqu'un pourrait m'indiquer un tutoriel, un Howto ou quelque chose dans ce genre qui puisse m'aider ?

Merci d'avance,

OutReal

P.S. : j'ai déjà fait un tour sur Lea-linux.org, mais au bout d'un moment ils demandent d'utiliser linuxconf ou netconfig ou netcfg et je n'ai rien de tout cela, je n'ai même rien trouvé avec ces noms sur portage.
Back to top
View user's profile Send private message
Bastux
Guru
Guru


Joined: 15 Dec 2002
Posts: 369
Location: France - Paris

PostPosted: Fri Jan 16, 2004 8:40 pm    Post subject: Re: [RESEAU] configuration Reply with quote

outreal wrote:
Bonjour,
J'ai deux machines en réseau, celle qui a Gentoo et windows et qui possède la connexion ADSL; et l'autre qui tourne un Mdk 9.2

Le pb est que qd je suis sous win, j'arrive à partager la connexion internet, mais quand je suis sur gentoo, pas moyen de le faire. Je ne vois même pas l'aute machine.

Quelqu'un pourrait m'indiquer un tutoriel, un Howto ou quelque chose dans ce genre qui puisse m'aider ?

Merci d'avance,

OutReal

P.S. : j'ai déjà fait un tour sur Lea-linux.org, mais au bout d'un moment ils demandent d'utiliser linuxconf ou netconfig ou netcfg et je n'ai rien de tout cela, je n'ai même rien trouvé avec ces noms sur portage.


Ton post n'est pas très explicite sur le problème en question.

Est-ce que tu as le réseau? dans le sens ta carte réseau reconnue et ton /sbin/ifconfig bien configuré?

Et pour le partage de connexion as-tu fait quelque chose, installé iptables?
Back to top
View user's profile Send private message
scout
Veteran
Veteran


Joined: 08 Mar 2003
Posts: 1991
Location: France, Paris en Semaine / Metz le W-E

PostPosted: Fri Jan 16, 2004 10:40 pm    Post subject: Reply with quote

Quote:
Le pb est que qd je suis sous win, j'arrive à partager la connexion internet

Bah moi c'était quantique c'est pour cela que j'ai fait le partage avec ma gentoo.
Moi j'ai un modem ADSL ethernet: mon ordi avec la gentoo a sa carte eth0 sur le modem (modem en 192.168.1.1 et gentoo en 192.168.1.2) et sa carte eth1 sur le switch 100Mbps sur lequel sont brachés tout les autres ordis de la maison (tous en 172.16.0.* et la gentoo en 172.16.0.1).
J'ai un scipt iptables inspiré du Howto Gentoo sur la sécurité http://www.gentoo.org/doc/fr/gentoo-security.xml#doc_chap12
La ligne qui fait tout le travail de "masqerading" c'est à dire de partage de la connexion, c'est
$IPTABLES -A POSTROUTING -t nat -o $OINTERFACE -j MASQUERADE

Voilà un résumé fonctionnel de mon script, à mettre dans /etc/init.d (c'est expliqué sur le howto gentoo).

Bon y'a plusieurs avantages à mon script:
- je pense qu'il est bien pour la sécurité
- il est bien décomposé, donc il est facile d'en faire des modifications

Désavantages:
Il faut parfois le faire "chuter": /etc/init.d/firewall flat
c'est là une addition perso au script original du howto, car en effet, quand le script est activé, je n'arrive pas à faire de emerge sync ... il faut aussi le désactiver si tu surfes sur une page http où le port n'est pas 80.

j'ai aussi ajouté une section peer2peer et bittorrent: en gros je lance bittorrent avec l'utilisateur peer2peer qui a un uid de 1006, et aussi des règles pour que quand je fasse chuter le firewall on n'accède pas de l'extérieur à mon partage samba

Code:
#!/sbin/runscript
IPTABLES=/sbin/iptables
IPTABLESSAVE=/sbin/iptables-save
IPTABLESRESTORE=/sbin/iptables-restore
FIREWALL=/etc/firewall.rules
DNS1=192.168.1.1
#DNS1=195.114.64.235
#DNS2=212.242.40.51
#inside
IIP=172.16.0.1
IINTERFACE=eth1
LOCAL_NETWORK=172.16.0.0/29
#outside
OIP=192.168.1.2
OINTERFACE=eth0

opts="${opts} showstatus panic save restore showoptions rules open flat"

depend() {
  need net procparam
}

rules() {
  stop
  ebegin "Setting internal rules"

  einfo "Setting default rule to drop"
  $IPTABLES -P FORWARD DROP
  $IPTABLES -P INPUT   DROP
  $IPTABLES -P OUTPUT  DROP

  #default rule
  einfo "Creating states chain"
  $IPTABLES -N allowed-connection
  $IPTABLES -F allowed-connection
  $IPTABLES -A allowed-connection -m state --state ESTABLISHED,RELATED -j ACCEPT
  $IPTABLES -A allowed-connection -i $IINTERFACE -m limit -j LOG --log-prefix "Bad packet from ${IINTERFACE}:"
  $IPTABLES -A allowed-connection -j DROP

  #ICMP traffic
  einfo "Creating icmp chain"
  $IPTABLES -N icmp_allowed
  $IPTABLES -F icmp_allowed
  $IPTABLES -A icmp_allowed -m state --state NEW -p icmp --icmp-type time-exceeded -j ACCEPT
  $IPTABLES -A icmp_allowed -m state --state NEW -p icmp --icmp-type destination-unreachable -j ACCEPT
  $IPTABLES -A icmp_allowed -p icmp -j LOG --log-prefix "Bad ICMP traffic:"
  $IPTABLES -A icmp_allowed -p icmp -j DROP

  #Incoming traffic
  einfo "Creating incoming ssh traffic chain"
  $IPTABLES -N allow-ssh-traffic-in
  $IPTABLES -F allow-ssh-traffic-in
  #Flood protection
  $IPTABLES -A allow-ssh-traffic-in -m limit --limit 1/second -p tcp --tcp-flags ALL RST --dport ssh -j ACCEPT
  $IPTABLES -A allow-ssh-traffic-in -m limit --limit 1/second -p tcp --tcp-flags ALL FIN --dport ssh -j ACCEPT
  $IPTABLES -A allow-ssh-traffic-in -m limit --limit 1/second -p tcp --tcp-flags ALL SYN --dport ssh -j ACCEPT
  $IPTABLES -A allow-ssh-traffic-in -p tcp --dport ssh -j ACCEPT

  einfo "Creating incoming dns traffic chain"
  $IPTABLES -N allow-dns-traffic-in
  $IPTABLES -F allow-dns-traffic-in
  $IPTABLES -A allow-dns-traffic-in -p udp -i $IINTERFACE --dport domain -j ACCEPT

  einfo "Creating incoming smtp traffic chain"
  $IPTABLES -N allow-smtp-traffic-in
  $IPTABLES -F allow-smtp-traffic-in
  $IPTABLES -A allow-smtp-traffic-in -p tcp --dport smtp -j ACCEPT

  einfo "Creating incoming imap over ssl chain"
  $IPTABLES -N allow-imaps-traffic-in
  $IPTABLES -F allow-imaps-traffic-in
  $IPTABLES -A allow-imaps-traffic-in -p tcp -i $IINTERFACE --dport imaps -j ACCEPT
  $IPTABLES -A allow-imaps-traffic-in -p tcp -s 80.13.137.6 --dport imaps -j ACCEPT

  einfo "Creating incoming samba traffic chain"
  $IPTABLES -N allow-smb-traffic-in
  $IPTABLES -F allow-smb-traffic-in
  $IPTABLES -A allow-smb-traffic-in -p tcp -i $IINTERFACE --dport netbios-ns -j ACCEPT
  $IPTABLES -A allow-smb-traffic-in -p udp -i $IINTERFACE --dport netbios-ns -j ACCEPT
  $IPTABLES -A allow-smb-traffic-in -p tcp -i $IINTERFACE --dport netbios-dgm -j ACCEPT
  $IPTABLES -A allow-smb-traffic-in -p udp -i $IINTERFACE --dport netbios-dgm -j ACCEPT
  $IPTABLES -A allow-smb-traffic-in -p tcp -i $IINTERFACE --dport netbios-ssn -j ACCEPT
  $IPTABLES -A allow-smb-traffic-in -p udp -i $IINTERFACE --dport netbios-ssn -j ACCEPT

  einfo "Creating incoming BitTorrent traffic chain"
  $IPTABLES -N allow-bittorrent-traffic-in
  $IPTABLES -F allow-bittorrent-traffic-in
  $IPTABLES -A allow-bittorrent-traffic-in -p tcp --dport 6881 -j ACCEPT
  $IPTABLES -A allow-bittorrent-traffic-in -p tcp --dport 6882 -j ACCEPT
  $IPTABLES -A allow-bittorrent-traffic-in -p tcp --dport 6883 -j ACCEPT
  $IPTABLES -A allow-bittorrent-traffic-in -p tcp --dport 6884 -j ACCEPT
  $IPTABLES -A allow-bittorrent-traffic-in -p tcp --dport 6885 -j ACCEPT
  $IPTABLES -A allow-bittorrent-traffic-in -p tcp --dport 6886 -j ACCEPT
  $IPTABLES -A allow-bittorrent-traffic-in -p tcp --dport 6887 -j ACCEPT
  $IPTABLES -A allow-bittorrent-traffic-in -p tcp --dport 6888 -j ACCEPT
  $IPTABLES -A allow-bittorrent-traffic-in -p tcp --dport 6889 -j ACCEPT

  #outgoing traffic
  einfo "Creating outgoing ssh traffic chain"
  $IPTABLES -N allow-ssh-traffic-out
  $IPTABLES -F allow-ssh-traffic-out
  $IPTABLES -A allow-ssh-traffic-out -p tcp --dport ssh -j ACCEPT

  einfo "Creating outgoing dns traffic chain"
  $IPTABLES -N allow-dns-traffic-out
  $IPTABLES -F allow-dns-traffic-out
  $IPTABLES -A allow-dns-traffic-out -p udp -d $DNS1 --dport domain -j ACCEPT
#  $IPTABLES -A allow-dns-traffic-out -p udp -d $DNS2 --dport domain -j ACCEPT

  einfo "Creating outgoing http/https traffic chain"
  $IPTABLES -N allow-www-traffic-out
  $IPTABLES -F allow-www-traffic-out
  $IPTABLES -A allow-www-traffic-out -p tcp --dport www -j ACCEPT
  $IPTABLES -A allow-www-traffic-out -p tcp --dport https -j ACCEPT

  einfo "Creating outgoing ftp traffic chain"
  $IPTABLES -N allow-ftp-traffic-out
  $IPTABLES -F allow-ftp-traffic-out
  $IPTABLES -A allow-ftp-traffic-out -p tcp --dport ftp -j ACCEPT
  $IPTABLES -A allow-ftp-traffic-out -p tcp --dport ftp-data -j ACCEPT

  einfo "Creating outgoing rsync traffic chain"
  $IPTABLES -N allow-rsync-traffic-out
  $IPTABLES -F allow-rsync-traffic-out
  $IPTABLES -A allow-rsync-traffic-out -p tcp --dport rsync -j ACCEPT
  $IPTABLES -A allow-rsync-traffic-out -p udp --dport rsync -j ACCEPT

  einfo "Creating outgoing pop-3 traffic chain"
  $IPTABLES -N allow-pop3-traffic-out
  $IPTABLES -F allow-pop3-traffic-out
  $IPTABLES -A allow-pop3-traffic-out -p tcp --dport pop-3 -j ACCEPT

  einfo "Creating outgoing smtp traffic chain"
  $IPTABLES -N allow-smtp-traffic-out
  $IPTABLES -F allow-smtp-traffic-out
  $IPTABLES -A allow-smtp-traffic-out -p tcp --dport smtp -j ACCEPT

  einfo "Creating outgoing pyzor traffic chain"
  $IPTABLES -N allow-pyzor-traffic-out
  $IPTABLES -F allow-pyzor-traffic-out
  $IPTABLES -A allow-pyzor-traffic-out -p tcp -d 66.92.49.157 --dport 24441 -j ACCEPT

  einfo "Creating outgoing samba traffic chain"
  $IPTABLES -N allow-smb-traffic-out
  $IPTABLES -F allow-smb-traffic-out
  $IPTABLES -A allow-smb-traffic-out -p tcp -o $IINTERFACE --dport netbios-ns -j ACCEPT
  $IPTABLES -A allow-smb-traffic-out -p udp -o $IINTERFACE --dport netbios-ns -j ACCEPT
  $IPTABLES -A allow-smb-traffic-out -p tcp -o $IINTERFACE --dport netbios-dgm -j ACCEPT
  $IPTABLES -A allow-smb-traffic-out -p udp -o $IINTERFACE --dport netbios-dgm -j ACCEPT
  $IPTABLES -A allow-smb-traffic-out -p tcp -o $IINTERFACE --dport netbios-ssn -j ACCEPT
  $IPTABLES -A allow-smb-traffic-out -p udp -o $IINTERFACE --dport netbios-ssn -j ACCEPT

  $IPTABLES -A allow-smb-traffic-out -p tcp -o $OINTERFACE --dport netbios-ns -j DROP
  $IPTABLES -A allow-smb-traffic-out -p udp -o $OINTERFACE --dport netbios-ns -j DROP
  $IPTABLES -A allow-smb-traffic-out -p tcp -o $OINTERFACE --dport netbios-dgm -j DROP
  $IPTABLES -A allow-smb-traffic-out -p udp -o $OINTERFACE --dport netbios-dgm -j DROP
  $IPTABLES -A allow-smb-traffic-out -p tcp -o $OINTERFACE --dport netbios-ssn -j DROP
  $IPTABLES -A allow-smb-traffic-out -p udp -o $OINTERFACE --dport netbios-ssn -j DROP

  einfo "Creating outgoing irc traffic chain"
  $IPTABLES -N allow-irc-traffic-out
  $IPTABLES -F allow-irc-traffic-out
  $IPTABLES -A allow-irc-traffic-out -p tcp --dport ircd -j ACCEPT

  einfo "Creating outgoing peer to peer traffic chain"
  $IPTABLES -N allow-peer2peer-traffic-out
  $IPTABLES -F allow-peer2peer-traffic-out
  $IPTABLES -A allow-peer2peer-traffic-out -p tcp -o $OINTERFACE -m owner --uid-owner 1006 -j ACCEPT
 
  #Catch portscanners
  einfo "Creating portscan detection chain"
  $IPTABLES -N check-flags
  $IPTABLES -F check-flags
  $IPTABLES -A check-flags -p tcp --tcp-flags ALL FIN,URG,PSH -m limit --limit 5/minute -j LOG --log-level alert --log-prefix "NMAP-XMAS:"
  $IPTABLES -A check-flags -p tcp --tcp-flags ALL FIN,URG,PSH -j DROP
  $IPTABLES -A check-flags -p tcp --tcp-flags ALL ALL -m limit --limit 5/minute -j LOG --log-level 1 --log-prefix "XMAS:"
  $IPTABLES -A check-flags -p tcp --tcp-flags ALL ALL -j DROP
  $IPTABLES -A check-flags -p tcp --tcp-flags ALL SYN,RST,ACK,FIN,URG -m limit --limit 5/minute -j LOG --log-level 1 --log-prefix "XMAS-PSH:"
  $IPTABLES -A check-flags -p tcp --tcp-flags ALL SYN,RST,ACK,FIN,URG -j DROP
  $IPTABLES -A check-flags -p tcp --tcp-flags ALL NONE -m limit --limit 5/minute -j LOG --log-level 1 --log-prefix "NULL_SCAN:"
  $IPTABLES -A check-flags -p tcp --tcp-flags ALL NONE -j DROP
  $IPTABLES -A check-flags -p tcp --tcp-flags SYN,RST SYN,RST -m limit --limit 5/minute -j LOG --log-level 5 --log-prefix "SYN/RST:"
  $IPTABLES -A check-flags -p tcp --tcp-flags SYN,RST SYN,RST -j DROP
  $IPTABLES -A check-flags -p tcp --tcp-flags SYN,FIN SYN,FIN -m limit --limit 5/minute -j LOG --log-level 5 --log-prefix "SYN/FIN:"
  $IPTABLES -A check-flags -p tcp --tcp-flags SYN,FIN SYN,FIN -j DROP

  # Apply and add invalid states to the chains
  einfo "Applying chains to INPUT"
  $IPTABLES -A INPUT -m state --state INVALID -j DROP
  $IPTABLES -A INPUT -j icmp_allowed
#  $IPTABLES -A INPUT -j allow-rsync-traffic-in
  $IPTABLES -A INPUT -j check-flags
  $IPTABLES -A INPUT -i lo -j ACCEPT
  $IPTABLES -A INPUT -j allow-ssh-traffic-in
  $IPTABLES -A INPUT -j allow-dns-traffic-in
  $IPTABLES -A INPUT -j allow-smtp-traffic-in
  $IPTABLES -A INPUT -j allow-imaps-traffic-in
  $IPTABLES -A INPUT -j allow-smb-traffic-in
  $IPTABLES -A INPUT -j allow-bittorrent-traffic-in
  $IPTABLES -A INPUT -j allowed-connection

  einfo "Applying chains to FORWARD"
  $IPTABLES -A FORWARD -m state --state INVALID -j DROP
  $IPTABLES -A FORWARD -j icmp_allowed
  $IPTABLES -A FORWARD -j check-flags
  $IPTABLES -A FORWARD -o lo -j ACCEPT
  $IPTABLES -A FORWARD -j allow-dns-traffic-out
  $IPTABLES -A FORWARD -j allow-ssh-traffic-out
  $IPTABLES -A FORWARD -j allow-www-traffic-out
  $IPTABLES -A FORWARD -j allow-ftp-traffic-out
  $IPTABLES -A FORWARD -j allow-pop3-traffic-out
  $IPTABLES -A FORWARD -j allow-smtp-traffic-out
  $IPTABLES -A FORWARD -j allow-ntp-traffic-out
  $IPTABLES -A FORWARD -j allowed-connection

  einfo "Applying chains to OUTPUT"
  $IPTABLES -A OUTPUT -m state --state INVALID -j DROP
  $IPTABLES -A OUTPUT -j icmp_allowed
  $IPTABLES -A OUTPUT -j check-flags
  $IPTABLES -A OUTPUT -o lo -j ACCEPT
  $IPTABLES -A OUTPUT -j allow-dns-traffic-out
  $IPTABLES -A OUTPUT -j allow-ssh-traffic-out
  $IPTABLES -A OUTPUT -j allow-www-traffic-out
  $IPTABLES -A OUTPUT -j allow-ftp-traffic-out
  $IPTABLES -A OUTPUT -j allow-rsync-traffic-out
  $IPTABLES -A OUTPUT -j allow-pop3-traffic-out
  $IPTABLES -A OUTPUT -j allow-smtp-traffic-out
  $IPTABLES -A OUTPUT -j allow-ntp-traffic-out
  $IPTABLES -A OUTPUT -j allow-pyzor-traffic-out
  $IPTABLES -A OUTPUT -j allow-smb-traffic-out
  $IPTABLES -A OUTPUT -j allow-peer2peer-traffic-out
  $IPTABLES -A OUTPUT -j allowed-connection

  #Allow client to route through via NAT (Network Address Translation)
  $IPTABLES -A POSTROUTING -t nat -o $OINTERFACE -j MASQUERADE

  $IPTABLES -A PREROUTING -t nat -p tcp --dport 5190 -j DNAT --to-destination $IIP:22

  eend $?
}

open() {
  ebegin "Plus de firewall PAS de forwarding"
  $IPTABLES -F
  $IPTABLES -t nat -F
  $IPTABLES -X

  $IPTABLES -P FORWARD DROP

  $IPTABLES -P INPUT   ACCEPT
  $IPTABLES -A INPUT -p tcp -i $OINTERFACE --dport netbios-ns -j DROP
  $IPTABLES -A INPUT -p tcp -i $OINTERFACE --dport netbios-dgm -j DROP
  $IPTABLES -A INPUT -p tcp -i $OINTERFACE --dport netbios-ssn -j DROP
  $IPTABLES -A INPUT -p udp -i $OINTERFACE --dport netbios-ns -j DROP
  $IPTABLES -A INPUT -p udp -i $OINTERFACE --dport netbios-dgm -j DROP
  $IPTABLES -A INPUT -p udp -i $OINTERFACE --dport netbios-ssn -j DROP

  $IPTABLES -P OUTPUT  ACCEPT
  $IPTABLES -A OUTPUT -p tcp -o $OINTERFACE --dport netbios-ns -j DROP
  $IPTABLES -A OUTPUT -p tcp -o $OINTERFACE --dport netbios-dgm -j DROP
  $IPTABLES -A OUTPUT -p tcp -o $OINTERFACE --dport netbios-ssn -j DROP
  $IPTABLES -A OUTPUT -p udp -o $OINTERFACE --dport netbios-ns -j DROP
  $IPTABLES -A OUTPUT -p udp -o $OINTERFACE --dport netbios-dgm -j DROP
  $IPTABLES -A OUTPUT -p udp -o $OINTERFACE --dport netbios-ssn -j DROP

  eend $?
}

flat() {
  ebegin "Plus de firewall mais forwarding"
  $IPTABLES -F
  $IPTABLES -t nat -F
  $IPTABLES -X
  $IPTABLES -P FORWARD ACCEPT
  $IPTABLES -A FORWARD -p tcp --dport netbios-ns -j DROP
  $IPTABLES -A FORWARD -p tcp --dport netbios-dgm -j DROP
  $IPTABLES -A FORWARD -p tcp --dport netbios-ssn -j DROP
  $IPTABLES -A FORWARD -p udp --dport netbios-ns -j DROP
  $IPTABLES -A FORWARD -p udp --dport netbios-dgm -j DROP
  $IPTABLES -A FORWARD -p udp --dport netbios-ssn -j DROP
  $IPTABLES -A FORWARD -p tcp --sport netbios-ns -j DROP
  $IPTABLES -A FORWARD -p tcp --sport netbios-dgm -j DROP
  $IPTABLES -A FORWARD -p tcp --sport netbios-ssn -j DROP
  $IPTABLES -A FORWARD -p udp --sport netbios-ns -j DROP
  $IPTABLES -A FORWARD -p udp --sport netbios-dgm -j DROP
  $IPTABLES -A FORWARD -p udp --sport netbios-ssn -j DROP

  $IPTABLES -P INPUT ACCEPT
  $IPTABLES -A INPUT -p tcp --dport netbios-ns -j DROP
  $IPTABLES -A INPUT -p tcp --dport netbios-dgm -j DROP
  $IPTABLES -A INPUT -p tcp --dport netbios-ssn -j DROP
  $IPTABLES -A INPUT -p udp --dport netbios-ns -j DROP
  $IPTABLES -A INPUT -p udp --dport netbios-dgm -j DROP
  $IPTABLES -A INPUT -p udp --dport netbios-ssn -j DROP

  $IPTABLES -P OUTPUT ACCEPT
  $IPTABLES -A OUTPUT -p tcp --sport netbios-ns -j DROP
  $IPTABLES -A OUTPUT -p tcp --sport netbios-dgm -j DROP
  $IPTABLES -A OUTPUT -p tcp --sport netbios-ssn -j DROP
  $IPTABLES -A OUTPUT -p udp --sport netbios-ns -j DROP
  $IPTABLES -A OUTPUT -p udp --sport netbios-dgm -j DROP
  $IPTABLES -A OUTPUT -p udp --sport netbios-ssn -j DROP
 
  $IPTABLES -A POSTROUTING -t nat -o $OINTERFACE -j MASQUERADE
  eend $?
}

start() {
  ebegin "Starting firewall"
  if [ -e "${FIREWALL}" ]; then
    restore
  else
    einfo "${FIREWALL} does not exists. Using default rules."
    rules
  fi
  eend $?
}

stop() {
  ebegin "Stopping firewall"
  $IPTABLES -F
  $IPTABLES -t nat -F
  $IPTABLES -X
  $IPTABLES -P FORWARD ACCEPT
  $IPTABLES -P INPUT   ACCEPT
  $IPTABLES -P OUTPUT  ACCEPT
  eend $?
}

showstatus() {
  ebegin "Status"
  $IPTABLES -L -n -v --line-numbers
  einfo "NAT status"
  $IPTABLES -L -n -v --line-numbers -t nat
  eend $?
}

panic() {
  ebegin "Setting panic rules"
  $IPTABLES -F
  $IPTABLES -X
  $IPTABLES -t nat -F
  $IPTABLES -P FORWARD DROP
  $IPTABLES -P INPUT   DROP
  $IPTABLES -P OUTPUT  DROP
  $IPTABLES -A INPUT -i lo -j ACCEPT
  $IPTABLES -A OUTPUT -o lo -j ACCEPT
  eend $?
}

save() {
  ebegin "Saving Firewall rules"
  $IPTABLESSAVE > $FIREWALL
  eend $?
}

restore() {
  ebegin "Restoring Firewall rules"
  $IPTABLESRESTORE < $FIREWALL
  eend $?
}

restart() {
  svc_stop; svc_start
}

showoptions() {
  echo "Usage: $0 {start|save|restore|panic|stop|restart|showstatus|flat}"
  echo "start)      will restore setting if exists else force rules"
  echo "stop)       delete all rules and set all to accept"
  echo "rules)      force settings of new rules"
  echo "save)       will store settings in ${FIREWALL}"
  echo "restore)    will restore settings from ${FIREWALL}"
  echo "showstatus) Shows the status"
  echo "flat) Pour que le firewall devienne une passoire"
}

_________________
http://petition.eurolinux.org/ - Petition against ePatents
L'essence de la finesse
Back to top
View user's profile Send private message
outreal
Tux's lil' helper
Tux's lil' helper


Joined: 21 Oct 2003
Posts: 77

PostPosted: Sat Jan 17, 2004 12:44 am    Post subject: Reply with quote

@Bastux : pour simplifier : je ne sais pas comment partager ma connexion internet depuis gentoo :oops: Je n'arrive même pas à "pinger" l'autre pc

@scout : merci pour le script, une fois que j'aurai résolu mes pbs de base, je l'essairai.

OutReal
Back to top
View user's profile Send private message
Bastux
Guru
Guru


Joined: 15 Dec 2002
Posts: 369
Location: France - Paris

PostPosted: Sat Jan 17, 2004 10:22 am    Post subject: Reply with quote

outreal wrote:
@Bastux : pour simplifier : je ne sais pas comment partager ma connexion internet depuis gentoo :oops: Je n'arrive même pas à "pinger" l'autre pc

OutReal


Bon commençons déjà par régler ton problème de réseau.

Ta carte est-elle détectée ?
Si oui, que donne /sbin/ifconfig?
Back to top
View user's profile Send private message
outreal
Tux's lil' helper
Tux's lil' helper


Joined: 21 Oct 2003
Posts: 77

PostPosted: Sat Jan 17, 2004 12:48 pm    Post subject: Reply with quote

ifconfig me donne :
Quote:

eth0 Link encap:Ethernet HWaddr 00:60:4C:10:B0:9C
inet addr:192.168.0.2 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::260:4cff:fe10:b09c/10 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:641 errors:0 dropped:0 overruns:0 frame:0
TX packets:528 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:406241 (396.7 Kb) TX bytes:59627 (58.2 Kb)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:192 errors:0 dropped:0 overruns:0 frame:0
TX packets:192 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:9600 (9.3 Kb) TX bytes:9600 (9.3 Kb)

ppp0 Link encap:Point-to-Point Protocol
inet addr:82.64.24.210 P-t-P:192.168.254.254 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1492 Metric:1
RX packets:634 errors:0 dropped:0 overruns:0 frame:0
TX packets:517 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:394610 (385.3 Kb) TX bytes:48745 (47.6 Kb)


Mon modem ADSL est un Sagem Fast 800 et je me connecte en utilisant les drivers eagle, qui marchent à merveille.

Voilà ! Et merci pour ta patience... :oops:

OutReal
Back to top
View user's profile Send private message
Bastux
Guru
Guru


Joined: 15 Dec 2002
Posts: 369
Location: France - Paris

PostPosted: Sat Jan 17, 2004 2:34 pm    Post subject: Reply with quote

outreal wrote:
ifconfig me donne :
Quote:

eth0 Link encap:Ethernet HWaddr 00:60:4C:10:B0:9C
inet addr:192.168.0.2 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::260:4cff:fe10:b09c/10 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:641 errors:0 dropped:0 overruns:0 frame:0
TX packets:528 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:406241 (396.7 Kb) TX bytes:59627 (58.2 Kb)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:192 errors:0 dropped:0 overruns:0 frame:0
TX packets:192 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:9600 (9.3 Kb) TX bytes:9600 (9.3 Kb)

ppp0 Link encap:Point-to-Point Protocol
inet addr:82.64.24.210 P-t-P:192.168.254.254 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1492 Metric:1
RX packets:634 errors:0 dropped:0 overruns:0 frame:0
TX packets:517 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:394610 (385.3 Kb) TX bytes:48745 (47.6 Kb)


Mon modem ADSL est un Sagem Fast 800 et je me connecte en utilisant les drivers eagle, qui marchent à merveille.

Voilà ! Et merci pour ta patience... :oops:

OutReal


ton modem a l'air bien configué.
Ton réseau aussi.

Par contre quelle est l'ip et le masque de sous-réseau de tes autres machines? Elles sont aussi en 192.168.248.*** ou bien autre chose?
Le masque c'est le même?
Back to top
View user's profile Send private message
outreal
Tux's lil' helper
Tux's lil' helper


Joined: 21 Oct 2003
Posts: 77

PostPosted: Sat Jan 17, 2004 4:31 pm    Post subject: Reply with quote

je le confirme, mon modem est bien configuré car j'ai accès au net

quand au réseau, je ne sais pas d'où viens l'ip 192.168.0.2, je voulais que ce ce soit 192.168.0.1. D'auter part, en me loggant aujourd'hui, mon ip était quelque chose comme 192.168.60.30 :?

Où puis-je configurer définitivement mon ip ?

Quand à l'autre machine, elle recevait son ip automatiquement par dhcp en provenance de mon XP, car si je lui donnait un ip fixe (à savoir : 192.168.0.10), c'était impossible de partager la connexion. Mais ça ne me pose pas de pb de lui attribuer un ip fixe, car j'ai l'intention de me passer totalement de XP.

Donc, en répondant à ta question et en résumé :
Gentoo : 192.168.0.2
Mdk : 192.168.0.10

Le masque est le même, 255.255.255.0
Back to top
View user's profile Send private message
scout
Veteran
Veteran


Joined: 08 Mar 2003
Posts: 1991
Location: France, Paris en Semaine / Metz le W-E

PostPosted: Sun Jan 18, 2004 9:43 am    Post subject: Reply with quote

outreal wrote:
Où puis-je configurer définitivement mon ip ?

Edite le fichier /etc/conf.d/net : les commentaires expliquent comment remplir le fichier
_________________
http://petition.eurolinux.org/ - Petition against ePatents
L'essence de la finesse
Back to top
View user's profile Send private message
Bastux
Guru
Guru


Joined: 15 Dec 2002
Posts: 369
Location: France - Paris

PostPosted: Sun Jan 18, 2004 10:24 am    Post subject: Reply with quote

scout wrote:
outreal wrote:
Où puis-je configurer définitivement mon ip ?

Edite le fichier /etc/conf.d/net : les commentaires expliquent comment remplir le fichier



Le mieux c'est de suivre les instructions dans le guide de l'installation de gentoo, c'est très bien expliqué.
Back to top
View user's profile Send private message
Bastux
Guru
Guru


Joined: 15 Dec 2002
Posts: 369
Location: France - Paris

PostPosted: Sun Jan 18, 2004 10:26 am    Post subject: Reply with quote

outreal wrote:
je le confirme, mon modem est bien configuré car j'ai accès au net

quand au réseau, je ne sais pas d'où viens l'ip 192.168.0.2, je voulais que ce ce soit 192.168.0.1. D'auter part, en me loggant aujourd'hui, mon ip était quelque chose comme 192.168.60.30 :?

Où puis-je configurer définitivement mon ip ?

Quand à l'autre machine, elle recevait son ip automatiquement par dhcp en provenance de mon XP, car si je lui donnait un ip fixe (à savoir : 192.168.0.10), c'était impossible de partager la connexion. Mais ça ne me pose pas de pb de lui attribuer un ip fixe, car j'ai l'intention de me passer totalement de XP.

Donc, en répondant à ta question et en résumé :
Gentoo : 192.168.0.2
Mdk : 192.168.0.10

Le masque est le même, 255.255.255.0


pour que les deux machines puisse communiquer, il faut qu'elles aille le même masque de sous réseau, sinon ça va pas marcher.

Dès que tu es dans ce cas normalement le ping doit marcher.

Après, reprend le script de scout qui est très bien fait (merci d'ailleurs, je vais m'en inspirer, il était pas aussi complet le mien) et suis ses instructions.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index French All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum