- 论坛徽章:
- 0
|
用ipnat不好解决动态ip的重定向到内网的问题,如果要求不高可以ppp自带的重定向功能。不废话了,其余的参见man ppp。
nat port proto targetIP:targetPort[-targetPort] aliasPort[-aliasPort]
[remoteIP:remotePort[-remotePort]]
This command causes incoming proto connections to aliasPort to be
redirected to targetPort on targetIP. proto is either ``tcp'' or
``udp''.
A range of port numbers may be specified as shown above. The
ranges must be of the same size.
If remoteIP is specified, only data coming from that IP number is
redirected. remotePort must either be ``0'' (indicating any
source port) or a range of ports the same size as the other
ranges.
This option is useful if you wish to run things like Internet
phone on machines behind your gateway, but is limited in that
connections to only one interior machine per source machine and
target port are possible.
例:重定向ftp到192.168.1.10。编辑/etc/ppp.conf加上
nat enable yes
nat port tcp 192.168.1.10:20-21 20-21
注意要打开net.inet.ip.forwarding: 1 |
|