nixCraft Linux Forum

nixCraft

Linux / UNIX 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

Linux answers from nixCraft.


Networking, Firewalls and Security No it's not a secret. Talk about firewalls and security issues.

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 29-11-2007, 07:26 AM
Junior Member
User
 
Join Date: Nov 2007
OS: CentOS 5
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
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 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 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
  #2 (permalink)  
Old 29-11-2007, 10:16 AM
monk's Avatar
Senior Member
User
 
Join Date: Jan 2005
Location: Tibet
OS: Debian GNU/Linux
Posts: 506
Thanks: 0
Thanked 8 Times in 6 Posts
Rep Power: 7
monk has a spectacular aura about monk has a spectacular aura about
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 29-11-2007, 11:26 PM
Junior Member
User
 
Join Date: Nov 2007
OS: CentOS 5
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
natashak is on a distinguished road
Default Great!

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


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 Off


Similar Threads

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


All times are GMT +5.5. The time now is 11:43 PM.


Powered by vBulletin® Version 3.8.5 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2010 nixCraft. All rights reserved

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 37 38