如果您的IP地址每次连接到互联网时都会更改,请参阅本节和“步骤”部分。
感谢Peter Illmayer向我提供的以下信息:(对于那些使用动态IP的用户来说,这效果最好...)
------------------------------------------------------------ IN debian, I created a forward file in /etc/ppp/ip-up.d and put in #!/bin/sh ppp_ip="`/sbin/ifconfig ppp0 | grep 'inet addr' | awk '{print $2}' | sed -e 's/.*://'`" /usr/sbin/ipmasqadm portfw -f /usr/sbin/ipmasqadm portfw -a -P tcp -L ${ppp_ip} 6702 -R 192.168.0.2 6702 This is in a 2.2.x kernel with ipmasqadm installed with the appropriate kernel modules compiled in. ---------------------------------------------------------------Charles J. Fisher指出,如果您使用DHCP,也可以使用类似的脚本,将以下行插入到获取IP地址后运行的脚本中。
net_ip="`ifconfig eth0 | awk '/inet/ {sub(/addr:/,"",$2); print $2}'`" /usr/sbin/ipmasqadm portfw -f /usr/sbin/ipmasqadm portfw -a -P tcp -L ${net_ip} 6702 -R 192.168.1.2 6702当然,在您的IP伪装机后面使用Napster的机器越多,您需要做的端口转发就越多。