Nfs

Résolu
Bonjour.
J'essaie de monter un serveur de fichier en LAN FC6.
Sur le serveur.
cat /etc/hosts.allow
portmap: laptop_user
lockd: laptop_user
rquotad: laptop_user
mountd: laptop_user
statd: laptop_user

[root@localhost etc]# cat /etc/hosts.deny
portmap:ALL
lockd:ALL
mountd:ALL
rquotad:ALL
statd:ALL

[root@localhost etc]# cat /etc/exports
/home/fc_user/Desktop/Share/ laptop_user(rw)

[root@localhost etc]# cat /etc/sysconfig/iptables
# Firewall configuration written by system-config-securitylevel
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:RH-Firewall-1-INPUT - [0:0]
-A INPUT -j RH-Firewall-1-INPUT
-A FORWARD -j RH-Firewall-1-INPUT
-A RH-Firewall-1-INPUT -i lo -j ACCEPT
-A RH-Firewall-1-INPUT -p icmp --icmp-type any -j ACCEPT
-A RH-Firewall-1-INPUT -p 50 -j ACCEPT
-A RH-Firewall-1-INPUT -p 51 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp --dport 5353 -d 224.0.0.251 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp -m udp --dport 631 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m tcp --dport 631 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp --dport 2049 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 631 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 2049 -j ACCEPT
-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited

[root@localhost etc]# iptables -L -n
Chain INPUT (policy ACCEPT)
target prot opt source destination
RH-Firewall-1-INPUT all -- 0.0.0.0/0 0.0.0.0/0

Chain FORWARD (policy ACCEPT)
target prot opt source destination
RH-Firewall-1-INPUT all -- 0.0.0.0/0 0.0.0.0/0

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

Chain RH-Firewall-1-INPUT (2 references)
target prot opt source destination
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
ACCEPT icmp -- 0.0.0.0/0 0.0.0.0/0 icmp type 255
ACCEPT esp -- 0.0.0.0/0 0.0.0.0/0
ACCEPT ah -- 0.0.0.0/0 0.0.0.0/0
ACCEPT udp -- 0.0.0.0/0 224.0.0.251 udp dpt:5353
ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 udp dpt:631
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:631
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 state NEW udp dpt:2049
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:631
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:2049
REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited

[root@localhost etc]# tail -f /var/log/messages
Jan 17 21:10:27 localhost kernel: Removing netfilter NETLINK layer.
Jan 17 21:10:27 localhost kernel: ip_tables: (C) 2000-2006 Netfilter Core Team
Jan 17 21:10:27 localhost kernel: Netfilter messages via NETLINK v0.30.
Jan 17 21:10:27 localhost kernel: ip_conntrack version 2.4 (5887 buckets, 47096 max) - 228 bytes per conntrack
Jan 17 21:10:27 localhost kernel: ip6_tables: (C) 2000-2006 Netfilter Core Team
Jan 17 21:13:25 localhost kernel: Removing netfilter NETLINK layer.
Jan 17 21:13:25 localhost kernel: ip_tables: (C) 2000-2006 Netfilter Core Team
Jan 17 21:13:25 localhost kernel: Netfilter messages via NETLINK v0.30.
Jan 17 21:13:25 localhost kernel: ip_conntrack version 2.4 (5887 buckets, 47096 max) - 228 bytes per conntrack
Jan 17 21:13:25 localhost kernel: ip6_tables: (C) 2000-2006 Netfilter Core Team

Quand je fais sur le lapto_user (machine host)
mount fc_machine:/home/fc_user/Desktop/Share /home/laptop_user/Desktop/fc_share
j'obtiens l'erreur suivante
System Error: No route to host.

Mon iptables -L -n sorte

ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:2049
ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 state NEW udp dpt:2049

Je pense que j'ai besoin qqch comme

target prot opt source destination
ACCEPT tcp -- 192.168.1.1/24 0.0.0.0/0 state NEW tcp dpt:2049
ACCEPT udp -- 192.168.1.1/24 0.0.0.0/0 state NEW udp dpt:2049

Tout marche bien quand je désactive service iptable sur le serveur. Alors je pense que le problème doit venir de la configuration de /etc/sysconfig/iptables .

Merci pour l'aide.

> Lire le message (0 commentaire).
Configuration: Linux Fedora
Firefox 1.5.0.9

3 réponses

  • Votes
  • Date
  • Date décroissante
  1. Modérateur
    Salut,

    active ton firewall (iptables)

    ensuite tape

    iptables -A INPUT -i ton_interface -s 192.168.1.1 -j ACCEPT
    et teste le serveur

    Pour connaître ton interface tape ifconfig
    1. je viens de faire sur la machine 192.168.1.4 (serveur)
      iptables -A INPUT -i 192.168.1.2 -s 192.168.1.4 -j ACCEPT

      192.168.1.2 = la machine host

      suivi avec un service iptables restart

      iptables -L -n me donne
      Chain INPUT (policy ACCEPT)
      target prot opt source destination
      RH-Firewall-1-INPUT all -- 0.0.0.0/0 0.0.0.0/0

      Chain FORWARD (policy ACCEPT)
      target prot opt source destination
      RH-Firewall-1-INPUT all -- 0.0.0.0/0 0.0.0.0/0

      Chain OUTPUT (policy ACCEPT)
      target prot opt source destination

      Chain RH-Firewall-1-INPUT (2 references)
      target prot opt source destination
      ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
      ACCEPT icmp -- 0.0.0.0/0 0.0.0.0/0 icmp type 255
      ACCEPT esp -- 0.0.0.0/0 0.0.0.0/0
      ACCEPT ah -- 0.0.0.0/0 0.0.0.0/0
      ACCEPT udp -- 0.0.0.0/0 224.0.0.251 udp dpt:5353
      ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 udp dpt:631
      ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:631
      ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
      ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 state NEW udp dpt:2049
      ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:631
      ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:2049
      REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited

      et un Error: ou route to host sur 192.168.1.2
    2. Dans le commande
      iptables -A INPUT -i ton_interface -s 192.168.1.1 -j ACCEPT

      ton_interface = client ou serveur ??
  2. Modérateur
    Salut,

    je viens de faire sur la machine 192.168.1.4 (serveur)
    iptables -A INPUT -i 192.168.1.2 -s 192.168.1.4 -j ACCEPT


    -s veut dire ( source)
    donc comme tu es sur le serveur tu dois mettre
    iptables -A INPUT -i interface_serveur -s ip_machine_client -d ip_serveur(machine locale) -j ACCEPT
    pour interface_serveur tu dois avoir par exemple eth0 si tu es en ethernet et si tu as une seule carte ethernet configurer

    La commande /sbin/ifconfig t'affichera les interfaces sur ta machine
    1. Pour ceux qui galère comme moi faites un yum install firestarter. C'est une interface pour configurer les iptables. Je l'avais installé maintenant tout fonctionne.