- 论坛徽章:
- 2
|
本帖最后由 snakewqq 于 2015-03-03 00:19 编辑
情况是这样的,我的windows主机和linux服务器在一个路由器下,下以win和linux代替主机
win 的ip是192.168.1.101
linux的ip是192.168.1.5 (且在路由器设置ip固定)
路由器使用pppoe拨号上网,架设的是postfix邮件服务和httpd网页服务,xxx.ticp.net为花生壳注册域名设置于路由器动态DNS上,并且已经做了192.168.1.5的端口映射(1-2000端口都映射了)
现在的情况是linux telnet localhost 25是可以连上postfix服务器,但用域名就不行,win主机ping 192.168.1.5通,但是telnet 192.168.1.5 25则不通,域名也一样不通。linux httpd服务80端口,win主机用域名可以访问linux上的httpd服务的web页面,外网主机访问则不行,感觉像是因为有路由器问题,路由器设置了动态DNS,开启了web管理,并且可以正常在外网管理路由器管理界面,路由器web管理端口使用的1985,80端口已经映射给了linux 192.168.1.5的主机。
不知道大家能否看懂我的描述,简单说就是外网电脑不能用域名访问web服务(可以用域名访问路由器web管理),邮件服务linux上telnet成功,但测试发送本地邮件失败了
win:
C:\>telnet 192.168.1.5 25
正在连接192.168.1.5...无法打开到主机的连接。 在端口 25: 连接失败
C:\>telnet xxx.ticp.net 25
正在连接xxx.ticp.net...无法打开到主机的连接。 在端口 25: 连接失败
C:\>ping xxx.ticp.net
正在 Ping xxx.ticp.net [115.214.*.238] 具有 32 字节的数据:
来自 115.214.*.238 的回复: 字节=32 时间=1ms TTL=63
来自 115.214.*.238 的回复: 字节=32 时间<1ms TTL=63
来自 115.214.*.238 的回复: 字节=32 时间<1ms TTL=63
来自 115.214.*.238 的回复: 字节=32 时间<1ms TTL=63
-------------------------------------------------------------------
linux:
[root@PC-IBM ~]# netstat -anp|grep :25
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1772/master
tcp 0 0 ::1:25 :::* LISTEN 1772/master
[root@PC-IBM ~]# netstat -anp|grep :80
tcp 0 0 :::80 :::* LISTEN 1806/httpd
[root@PC-IBM ~]# ps -eaf|grep postfix
root 1772 1 0 23:18 ? 00:00:00 /usr/libexec/postfix/master
postfix 1780 1772 0 23:18 ? 00:00:00 pickup -l -t fifo -u
postfix 1781 1772 0 23:18 ? 00:00:00 qmgr -l -t fifo -u
root 4247 4067 0 23:40 pts/0 00:00:00 grep postfix
[root@PC-IBM ~]# ps -eaf|grep httpd
root 1806 1 0 23:18 ? 00:00:00 /usr/sbin/httpd
apache 2182 1806 0 23:18 ? 00:00:00 /usr/sbin/httpd
apache 2184 1806 0 23:18 ? 00:00:00 /usr/sbin/httpd
apache 2185 1806 0 23:18 ? 00:00:00 /usr/sbin/httpd
apache 2186 1806 0 23:18 ? 00:00:00 /usr/sbin/httpd
apache 2187 1806 0 23:18 ? 00:00:00 /usr/sbin/httpd
apache 2188 1806 0 23:18 ? 00:00:00 /usr/sbin/httpd
apache 2189 1806 0 23:18 ? 00:00:00 /usr/sbin/httpd
apache 2190 1806 0 23:18 ? 00:00:00 /usr/sbin/httpd
apache 2191 1806 0 23:18 ? 00:00:00 /usr/sbin/httpd
root 4287 4067 0 23:43 pts/0 00:00:00 grep httpd
[root@PC-IBM ~]# telnet xxx.ticp.net 25
Trying 115.214.*.238...
telnet: connect to address 115.214.*.238: Connection refused
[root@PC-IBM ~]# telnet localhost 25
Trying ::1...
Connected to localhost.
Escape character is '^]'.
220 markrouter.ticp.net ESMTP Postfix
EHLO 192.168.1.101
250-markrouter.ticp.net
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
quit
221 2.0.0 Bye
Connection closed by foreign host.
[root@PC-IBM ~]#
防火墙配置:
[root@PC-IBM ~]# cat /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 20 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -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 80 -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
SELINUX已经关闭
[root@PC-IBM ~]# cat /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
##SELINUX=enforcing
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
#SELINUXTYPE=targeted
#SELINUXTYPE=targeted
SELINUX=disabled
|
|