CentOS 端口转发的问题,求帮助

我看你有戏 2014-10-06 11:07:07
iptables中的内容

# Generated by iptables-save v1.3.5 on Mon Oct 6 07:55:24 2014
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [457:46034]
:RH-Firewall-1-INPUT - [0:0]
-A INPUT -j RH-Firewall-1-INPUT
-A INPUT -p tcp -m tcp --dport 8080 -j ACCEPT
-A FORWARD -j RH-Firewall-1-INPUT
-A RH-Firewall-1-INPUT -i lo -j ACCEPT
-A RH-Firewall-1-INPUT -p icmp -m icmp --icmp-type any -j ACCEPT
-A RH-Firewall-1-INPUT -p esp -j ACCEPT
-A RH-Firewall-1-INPUT -p ah -j ACCEPT
-A RH-Firewall-1-INPUT -d 224.0.0.251 -p udp -m udp --dport 5353 -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 RELATED,ESTABLISHED -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 9999 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 8080 -j ACCEPT
-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited
COMMIT
# Completed on Mon Oct 6 07:55:24 2014
# Generated by iptables-save v1.3.5 on Mon Oct 6 07:55:24 2014
*nat
:PREROUTING ACCEPT [7:224]
:POSTROUTING ACCEPT [18:1350]
:OUTPUT ACCEPT [18:1350]
-A PREROUTING -p tcp -m tcp --dport 8080 -j DNAT --to-destination 192.168.1.100:1521
-A POSTROUTING -p tcp -m tcp --dport 1521 -j SNAT --to-source 192.168.1.110
COMMIT
# Completed on Mon Oct 6 07:55:24 2014




##**********************************************************
#本地网卡IP 192.168.1.110
#我想实现 访问192.168.1.110:8080的时候,端口转发到192.168.1.100:1521(是web服务)
#为啥如上面设置不行
...全文
316 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
我看你有戏 2014-10-07
  • 打赏
  • 举报
回复
little difct give some help
  • 打赏
  • 举报
回复
引用 2 楼 henry3695 的回复:
[quote=引用 1 楼 micropentium6 的回复:] have u done this yet? sysctl -w net.ipv4.ip_forward=1 make sure you enable ip forwarding first then here is a good reference https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/4/html/Security_Guide/s1-firewall-ipt-fwd.html
是这样的192.168.1.110的端口是通过路由器隐射过去的8080 我希望通过外网的域名访问8080端口好像不行啊 [/quote] there will be a lot of places that things could go wrong. ur switch first, then the firewall of ur network, then the iptable rules...
我看你有戏 2014-10-07
  • 打赏
  • 举报
回复
引用 1 楼 micropentium6 的回复:
have u done this yet? sysctl -w net.ipv4.ip_forward=1 make sure you enable ip forwarding first then here is a good reference https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/4/html/Security_Guide/s1-firewall-ipt-fwd.html
是这样的192.168.1.110的端口是通过路由器隐射过去的8080 我希望通过外网的域名访问8080端口好像不行啊
  • 打赏
  • 举报
回复
have u done this yet? sysctl -w net.ipv4.ip_forward=1 make sure you enable ip forwarding first then here is a good reference https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/4/html/Security_Guide/s1-firewall-ipt-fwd.html

19,613

社区成员

发帖
与我相关
我的任务
社区描述
系统使用、管理、维护问题。可以是Ubuntu, Fedora, Unix等等
社区管理员
  • 系统维护与使用区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧