nixCraft Linux Forum

nixCraft

Linux Tech Support Forum

mounting an NFS filesystem with iptables

This is a discussion on mounting an NFS filesystem with iptables within the Networking, Firewalls and Security forums, part of the Mastering Servers category; I'm a newbie... I haven't found an answer to this one after a day on google, so help (or suggestions ...


Go Back   nixCraft Linux Forum > Mastering Servers > Networking, Firewalls and Security

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 11-29-2007, 07:26 AM
Junior Member
User
 
Join Date: Nov 2007
My distro: CentOS 5
Posts: 2
Rep Power: 0
natashak is on a distinguished road
Default mounting an NFS filesystem with iptables

I'm a newbie... I haven't found an answer to this one after a day on google, so help (or suggestions for where to look) would be deeply appreciated.

I have CentOS version 5.

I'm trying to mount the /home directory of linux box M (IP address 128.xx.xx.1) on linux box clients I and U (IP addresses 128.x.x.2 and .3). I've added lines in /etc/fstab, /etc/exports, and /etc/sysconfig/iptables, and I've found that it all works perfectly if M's firewall is disabled, but I can't get it to work with the firewall on (even when U and I's firewalls are active). I assume this means I and U are configured correctly, but M's firewall is stopping the transfer.

Portmapper, nfs, iptables are all active, and I've restarted all the services a number of times at different stages of fiddling.

My guess is it has something to do with assigning ports - I've seen some people mentioning this, but I'm not sure how to do this or what files are important. Using the -dport command in the iptables? But how do you know which port to route it to if so? Nothing I've tried has worked...

Thanks very much!

Here's some info on my system:
************************************************** *****
On the clients, /etc/fstab file has the line:
128.xx.xx.1:/home /home nfs rw 0 0
************************************************** *****
> iptables -L -n
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
ACCEPT all -- 0.0.0.0/0 128.xx.xx.2
ACCEPT all -- 0.0.0.0/0 128.xx.xx.3

Chain RH-Firewall-1-INPUT (2 reference
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 tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:2049
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:22
REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited
************************************************** **************
[root@M]# rpcinfo -p
program vers proto port
100000 2 tcp 111 portmapper
100000 2 udp 111 portmapper
100024 1 udp 638 status
100024 1 tcp 641 status
100011 1 udp 923 rquotad
100011 2 udp 923 rquotad
100011 1 tcp 923 rquotad
100011 2 tcp 923 rquotad
100003 2 udp 2049 nfs
100003 3 udp 2049 nfs
100003 4 udp 2049 nfs
100003 2 tcp 2049 nfs
100003 3 tcp 2049 nfs
100003 4 tcp 2049 nfs
100021 1 udp 32793 nlockmgr
100021 3 udp 32793 nlockmgr
100021 4 udp 32793 nlockmgr
100021 1 tcp 56882 nlockmgr
100021 3 tcp 56882 nlockmgr
100021 4 tcp 56882 nlockmgr
100005 1 udp 922 mountd
100005 1 tcp 922 mountd
100005 2 udp 922 mountd
100005 2 tcp 922 mountd
100005 3 udp 922 mountd
100005 3 tcp 922 mountd
************************************************** ***
> cat /etc/exports
/home 128.xx.xx.2(rw) 128.xx.xx.3(rw)




Thanks!!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 11-29-2007, 10:16 AM
monk's Avatar
Senior Member
User
 
Join Date: Jan 2005
Location: Tibet
My distro: Debian GNU/Linux
Posts: 481
Rep Power: 5
monk will become famous soon enough monk will become famous soon enough
Default

Try following tutorial
Redhat specific -> redhat.com | Knowledgebase

General tutorial -> Charles Curley - Software Engineer, Writer - NFS and Firewalls on Fedora Core
__________________
May the force with you!
Reply With Quote
  #3 (permalink)  
Old 11-29-2007, 11:26 PM
Junior Member
User
 
Join Date: Nov 2007
My distro: CentOS 5
Posts: 2
Rep Power: 0
natashak is on a distinguished road
Default Great!

That's exactly what I needed. Thanks so much.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
HP unix check filesystem for errors jerry HP-UX 0 06-09-2007 01:49 AM
Mounting servers in Linux rav Linux software 1 05-02-2007 11:57 PM
expand a filesystem indiresh Linux software 1 12-07-2006 03:59 PM
Unable to unmount a filesystem because of zombie processes toor Linux software 2 06-28-2006 12:13 PM
How to verify the options used when mounting a nfs FS. warren Solaris/OpenSolaris 4 03-28-2006 06:45 AM


All times are GMT +5.5. The time now is 12:31 PM.


Powered by vBulletin® Version 3.7.2 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36