NFS skrz ipchains
Erik Caha
caha na chemi.muni.cz
Neděle Květen 20 13:06:34 CEST 2001
Preji dobreho dne,
Ponekud nejsem schopen zprovoznit $subject na RH_7.1_en (reseni prosim
tudiz pomoci ipchains nikoliv iptables). Google mi vyplivl nekolik
podobnych dotazu jako mam ja, ale bez odpovedi.
Neco co vim o NFS (chyby prosim opravte):
vlastni komunikace probiha pres port 2049 protokol udp, experimentalne i
tcp, potrebuji portmapper na 111 a kdyz jadro neumi automaticky volat
rpc.lockd a rpc.statd, tak ty take. Na serveru potrebuji mit navic
spusteny rpc.nfsd a mountd.
Kofiguruji NFS klienta s lokalnim firewallem, tudiz by melo stacit:
cat /etc/sysconfig/ipchains
# Firewall configuration written by lokkit
# Manual customization of this file is not recommended.
# Note: ifup-post will punch the current nameservers through the
# firewall; such entries will *not* be listed here.
:input ACCEPT
:forward DENY
:output ACCEPT
###
# NFS needs fragments
###
-A input -f -j ACCEPT
-A input -s mynet/24 -d mymachine 2049 -p tcp -y -j ACCEPT
-A input -s mynet/24 -d mymachine 2049 -p udp -j ACCEPT
###
#portmapper
###
-A input -s mynet/24 -d mymachine 111 -p tcp -y -j ACCEPT
-A input -s mynet/24 -d mymachine 111 -p udp -j ACCEPT
###
# SSH
###
-A input -s 0/0 -d mymachine 22 -p tcp -y -j ACCEPT
-A input -s 0/0 -d mymachine 22 -p udp -j ACCEPT
###
-A input -s 0/0 -d 0/0 -i lo -j ACCEPT
###
# DNS
###
-A input -s dns1 53 -d 0/0 -p udp -j ACCEPT
-A input -s dns2 53 -d 0/0 -p udp -j ACCEPT
###
-A input -s 0/0 -d 0/0 -p tcp -y -j REJECT
-A input -s 0/0 -d 0/0 -p udp -j REJECT
-EOF-
Nestaci, problem je v odmitnuti vsech zbylych udp paketu. Kdyz zakomentuju
posledni radek, tak pochopitelne mohu vesele mountovat. V hosts.deny je
ALL:ALL a v hosts.allow ALL:mynet EXCEPT public_machine
Chybova hlaska od mount -t nfs NFSserver:/dir1/dir2 /dir3 je:
mount: RPC: Casovac vyprsel
Predpokladam, ze resim otazku, ktere dalsi porty je potreba mit pristupne
abych mohl namountovat NFS oddily. Reseni v NFS-HOWTO (trusted podsit)
bych se chtel vyhnout.
Dekuji
Erik Caha
caha na chemi.muni.cz
Další informace o konferenci Linux