- 论坛徽章:
- 0
|
本帖最后由 yeqiyu 于 2012-12-12 16:20 编辑
大家好,第一次发帖就是求助帖~真是不好意思~
我分类我悬了系统安全,因为我觉得是安全模块导致这个问题出现的~ 要是选的不对,我会改正~~
服务器双IP,CentOS 6
公网IP:61.xx.xx.xxx
内网IP:192.168.12.154
用作mail服务器,安装sendmail,sendmail服务已启动。
可以在本机用命令行给本机发邮件,但是通过本机之外的机器发来的邮件却无法发送成功,返回的退信是25,timeout。
于是,我使用telnet测试
在本机分别telnet内网ip和回环ip的结果如下
#telnet 192.168.12.154 25
Trying 192.168.12.154...
telnet: connect to address 192.168.12.154: Connection refused
#telnet 127.0.0.1 25
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
220 host.domain ESMTP Sendmail 8.14.4/8.14.4; Tue, 11 Dec 2012 17:44:32 +0800
按照如上结果分析,可能是被iptables过滤掉了,但是~~~
下边是我的iptables,没有问题呀~
然后我又将iptables关闭了,再telnet,结果同上。
问了旁边的几个同事也是不知怎么回事,然后百度、google了一下也没有查到相关信息,具体的说,是我不知道关键词该怎么写了~
修改完毕iptables之后,重启过服务,后来连服务器都重启过,不过还是失败~~
不知道各位兄弟姐妹有没有碰到这个情况,还请给指点一下,十分感谢。
若需要其他信息我会马上提供。
SeLinux我也禁用掉了
/etc/sysconfig/selinux中的
SELINUX=disabled
附1
vi /etc/sysconfig/iptables
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8090 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 10022 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 25 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
附2
路由 route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
61.233.30.0 0.0.0.0 255.255.255.0 U 0 0 0 eth2
192.168.12.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
169.254.0.0 0.0.0.0 255.255.0.0 U 1002 0 0 eth1
169.254.0.0 0.0.0.0 255.255.0.0 U 1003 0 0 eth2
0.0.0.0 192.168.12.254 0.0.0.0 UG 0 0 0 eth1
------------------------------------
问题解决了,十分感谢大家的帮助,尤其是chenyx,非常感谢。
问题原因如下:
1.没有修改 sendmail.mc主配置文件
vi /etc/mail/sendmail.mc
# DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
改为 DAEMON_OPTIONS(`Port=smtp,Addr=0.0.0.0, Name=MTA')dnl
2.双网卡双IP 网关配置错误
将内网IP网关设置为空
|
|