showmount被防火墙挡住

系统安装、升级讨论
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
回复
仅此v而已
帖子: 13
注册时间: 2015-01-28 11:09
系统: ubuntu14.04

showmount被防火墙挡住

#1

帖子 仅此v而已 » 2015-08-15 9:07

鸟哥设置nfs服务器时说添加端口到防火墙就行了,我直接用iptables -A INPUT -s 192.168.100.0/24 -j ACCEPT 客户端就是被屏蔽,网上大家都说要关了防火墙才行,我试了试iptables -F就可以访问了,难道只能关防火墙吗 :em20
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: showmount被防火墙挡住

#2

帖子 poloshiao » 2015-08-15 12:11

鸟哥设置nfs服务器时说添加端口到防火墙就行了
你貼出來的內容 沒有談到 port 是多少

如果是預設 參閱
1. http://serverfault.com/questions/377170 ... to-use-nfs
Which ports do I need to open in the firewall to use NFS?
2. http://serverfault.com/questions/157694 ... ewall?rq=1
Running NFS with iptables, change firewall?
3. http://serverfault.com/questions/348370 ... ewall?rq=1
NFS support in iptables (or other firewall)
4. http://manpages.ubuntu.com/manpages/viv ... unt.8.html
showmount - show mount information for an NFS server
仅此v而已
帖子: 13
注册时间: 2015-01-28 11:09
系统: ubuntu14.04

Re: showmount被防火墙挡住

#3

帖子 仅此v而已 » 2015-08-16 9:23

iptables -A INPUT -s 192.168.100.0/24 -j ACCEPT 这个命令不是允许192.168.1.0/24这个网段进入吗,没有设置端口默认不是全都允许吗
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: showmount被防火墙挡住

#4

帖子 poloshiao » 2015-08-16 13:13

默认不是全都允许吗
1. https://help.ubuntu.com/community/Iptab ... bles_howto
When you install Ubuntu, iptables is there, but it allows all traffic by default.
iptables -A INPUT -s 192.168.100.0/24 -j ACCEPT 这个命令不是允许192.168.1.0/24这个网段进入吗
2. 既然預設是全都允许 你這個 ACCEPT 豈不是 白加了
设置端口
3. https://help.ubuntu.com/community/IptablesHowTo
請使用 dport 搜尋

4. 補充
要設定 iptables
4-1. 開機
4-2. 先把以前的規則 全部清除 重新設定
sudo iptables -F
sudo iptables -X
sudo iptables -Z
4-3. 再先設定全部 DROP
sudo iptables -P INPUT DROP
sudo iptables -A FORWARD DROP
sudo iptables -A OUTPUT DROP
這樣 開機 預設全部 DROP
4-4. 然後 再逐項設定 ACCEPT 或 DROP
只有新設定的 ACCEPT 有效
4-5. 有需要 再追加 LOG 用於抓錯
4-6. 以上 只是大概
詳細 請參閱 manpage
回复