Chinaunix
标题:
大家好,关于一个动态端口转发的问题
[打印本页]
作者:
kisswenyao
时间:
2004-04-17 18:06
标题:
大家好,关于一个动态端口转发的问题
我用的是ADSL上网,内网网卡eth0 192.168.0.1
我具体的做法是这样的修改/etc/sysconfig/iptables(把原有的内容都删除),修改完如下
# Firewall configuration written by lokkit
# Manual customization of this file is not recommended.
# Note: ifup-post will punch the current nameservers through the
# firewall; such entries will *not* be listed here.
*mangle
REROUTING ACCEPT [0]
:INPUT ACCEPT [0]
:FORWARD ACCEPT [0]
:OUTPUT ACCEPT [0]
OSTROUTING ACCEPT [0]
*nat
REROUTING ACCEPT [0]
OSTROUTING ACCEPT [0]
:OUTPUT ACCEPT [0]
[0]-A POSTROUTING -o ppp0 -j MASQUERADE
COMMIT
*filter
:INPUT ACCEPT [0]
:FORWARD ACCEPT [0]
:OUTPUT ACCEPT [0]
COMMIT
修改/etc/sysctl.conf,把net.ipv4.ip_forward设置成1,如下:
net.ipv4.ip_forward = 1
这样以后客户端都可以上网了,使用也很正常,但是有一点我内网有一台WEB服务器,我有动态的域名,现在要对名发布,域名可以邦定我动态的IP但是不知这个IP怎么转发到我的内存IP 192.168.0.12上来,请各位高手解决,在线等
谢了
作者:
llzqq
时间:
2004-04-17 18:09
标题:
大家好,关于一个动态端口转发的问题
iptables -t nat -A POSTROUTING -j MASQUERADE
iptables -t nat -A PREROUTING -d nero.3322.org -p tcp --dport 80 -j
DNAT --to-destination 192.168.0.12
欢迎光临 Chinaunix (http://bbs.chinaunix.net/)
Powered by Discuz! X3.2