vos2009 安装后,打开了相应的端口,仍然单通,但关了防火墙可以双通

你把服务器要开端口转发
vi /etc/sysctl.conf 
net.ipv4.ip_forward = 0
把0改为1 注意=号前后空格
sysctl -p
让配置生效
 
或修改iptables配置文件
# Firewall configuration written by system-config-securitylevel
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:RH-Firewall-1-INPUT - [0:0]
-A INPUT -j RH-Firewall-1-INPUT
-A FORWARD -j RH-Firewall-1-INPUT
-A RH-Firewall-1-INPUT -i lo -j ACCEPT
-A RH-Firewall-1-INPUT -p icmp --icmp-type any -j ACCEPT
-A RH-Firewall-1-INPUT -p 50 -j ACCEPT
-A RH-Firewall-1-INPUT -p 51 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp --dport 5353 -d 224.0.0.251 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp -m udp --dport 631 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m tcp --dport 631 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A RH-Firewall-1-INPUT -p TCP --dport 1202 -j LOG  --log-level debug
-A RH-Firewall-1-INPUT -s ! 220.233.6.220 -p TCP --dport 1202 -j DROP            
-A RH-Firewall-1-INPUT -s 222.95.0.0/255.255.0.0 -j DROP
-A RH-Firewall-1-INPUT -s 222.94.0.0/255.255.0.0 -j DROP
-A RH-Firewall-1-INPUT -s 58.212.0.0/255.255.0.0 -j DROP
#-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited
COMMIT
 
 
上面220.233.6.220改成自己的。

你可能感兴趣的:(vos2009 安装后,打开了相应的端口,仍然单通,但关了防火墙可以双通)