作者:suxixb, Comments Rss, 留言, Trackback
用 iptables 实现端口映射
由于我这里是几台 Windows 连接网关通过ADSL共享上网的,网关为 Archlinux ,单网卡,有两个网络接口,eth0链接内网,地址192.168.1.2;ppp0为ADSL拨号连接,地址自动分配,内网网段为 192.168.1.0/24 。
下图为物理拓扑图
比如内网上的pc1这台机想要BT下载,由于p2p的工作原理,我们必须在网关上打开到pc1的端口映射,这里假设pc1的ip地址为192.168.1.11,bt下载端口为11197。
# iptables -t nat -A PREROUTING -p tcp -i ppp0 --dport 11197 -j DNAT --to-destination 192.168.1.11:11197
# iptables-save -c > /etc/iptables/iptables.rules(这条命令不能用sudo,可以先执行su命令。不执行这条命令的后果是重启机器后要重新执行上一条命令)
就是这么简单,你现在已经打开了pc1的端口映射,而电驴的 HighID 问题也可以参考这个方法。附上一张内网BT下载的截图。(为啥我的下载速度这么慢?大家都限速了??)
随机文章:
整个 Yo2 上的相关文章:
发布于 2008 07月 25th , 星期五 at 3:02 pm ,文章归类于 系统设置,
文章标签:Arch, iptables, MLDonkey。
Comments Rss,
留言, Trackback














Have your say
Fields in bold are required. Email addresses are never published or distributed.
Some HTML code is allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>URIs must be fully qualified (eg: http://www.domainname.com) and all tags must be properly closed.
Line breaks and paragraphs are automatically converted.
Please keep comments relevant. Off-topic, offensive or inappropriate comments may be edited or removed.