我无法连接到运行 CentOS 6.4(最小安装)的 samba 服务器不是位于我的网络内。
当我尝试连接我的 Windows 7 客户端时,连接失败,并显示默认的“无法访问”对话框。
到目前为止我已经尝试过:
- 在我的 Samba 服务器上打开了端口 137、138、139、445
- 使用 nmap 验证端口是否打开(在 samba 服务器上)
- 尝试从我的客户端通过上述端口进行 telnet,但连接也失败了
- 重新安装 samba 并重新配置服务
- 暂时关闭 SELinux
iptables
# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT icmp -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:http
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:https
ACCEPT udp -- anywhere anywhere state NEW udp dpt:netbios-ns
ACCEPT udp -- anywhere anywhere state NEW udp dpt:netbios-dgm
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:netbios-ssn
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:microsoft-ds
REJECT all -- anywhere anywhere reject-with icmp-host-prohibited
Chain FORWARD (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT icmp -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
REJECT all -- anywhere anywhere reject-with icmp-host-prohibited
nmap
#nmap -sTU -O localhost
Starting Nmap 5.51 ( http://nmap.org ) at 2014-05-16 17:29 CEST
Nmap scan report for localhost (127.0.0.1)
Host is up (0.000042s latency).
Other addresses for localhost (not scanned): 127.0.0.1
Not shown: 1994 closed ports
PORT STATE SERVICE
22/tcp open ssh
25/tcp open smtp
80/tcp open http
139/tcp open netbios-ssn
445/tcp open microsoft-ds
68/udp open|filtered dhcpc
Samba 版本
#smbd --version
Version 3.6.9-168.el6_5
工作组在 smb.conf 中正确设置,nmb 正在运行。
答案1
大多数 ISP 都会过滤 netbios 端口。如果您从 Windows 客户端执行 nmap,您可能会看到该端口被列出,filtered
因为您的 ISP 正在阻止它。
尝试配置隧道协议,例如,openvpn
并尝试使用此设置。