Difference between revisions of "Firewall-cn"

From AMule Project FAQ
Jump to: navigation, search
m (Linksys WRT54GSV4: correct some mistakes)
(DLink Router configuration: All of the issue firewall are ok)
 
(2 intermediate revisions by the same user not shown)
Line 30: Line 30:
  
 
=== [http://www.linksys.com Linksys]路由器配置 ===
 
=== [http://www.linksys.com Linksys]路由器配置 ===
This portion of the wiki applies only to stock versions of the [http://www.linksys.com Linksys] firmware. If you are using a [http://www.linksys.com Linksys] router running a variant of the [[GPL]] code, please follow the guides directly above as you are most likely using iptables.
+
<!--This portion of the wiki applies only to stock versions of the [http://www.linksys.com Linksys] firmware. If you are using a [http://www.linksys.com Linksys] router running a variant of the [[GPL]] code, please follow the guides directly above as you are most likely using iptables.-->
 +
这部分只适用于stock版(stock version)的 [http://www.linksys.com Linksys]硬件。如果您在使用不同的 [[GPL]]版本(code)的 [http://www.linksys.com Linksys],请直接参考您最可能在用的上面提到的iptables指导。
  
Log into your [http://www.linksys.com Linksys] router. After successfully logging in, click on the main menu link labeled '''Applications & Gaming''' after which you should see an additional submenu list for this section. Make sure you are under the correct submenu by clicking '''Port Range Forwarding'''.
+
<!--Log into your [http://www.linksys.com Linksys] router. After successfully logging in, click on the main menu link labeled '''Applications & Gaming''' after which you should see an additional submenu list for this section. Make sure you are under the correct submenu by clicking '''Port Range Forwarding'''.-->
 +
登录您的 [http://www.linksys.com Linksys]路由器。在成功登录后,在主菜单上查找'''应用程序和游戏(Applications & Gaming)'''标签,之后您会看到额外的子菜单列表。点击 '''端口转发(Port Range Forwarding)'''保证您在正确的子菜单下.。
  
At this point, you should see a table with 6 columns. The columns are: ''Application'', ''Start to'', ''End'', ''Protocol'', ''IP Address'', ''Enable''.
+
<!--At this point, you should see a table with 6 columns. The columns are: ''Application'', ''Start to'', ''End'', ''Protocol'', ''IP Address'', ''Enable''.-->
 +
这时,您会看到带有6个字段的一张表。字段分别为:''应用程序(Application)'', ''起始端口(Start to)'', ''结束端口(End)'', ''协议(Protocol)'', ''IP地址(IP Address)'', ''启用(Enable)''。
  
'''The Application column'''<br>
+
'''应用程序字段'''<br>
Friendly name for the service. Put anything you want here, [[aMule]] being suggested.
+
服务的适当名称。可以输入任何您喜欢的。推荐使用 [[aMule]] 。<!--Friendly name for the service. Put anything you want here, [[aMule]] being suggested.-->
  
'''The Start to -> End column'''<br>
+
'''起始端口-结束端口字段'''<br>
Start and end ports. '''Start to''' should be ''4662'' but, in the end, this should reflect whatever port you have defined in [[aMule]] ''Preferences'' -> ''Connection'' -> ''Client TCP Port''. '''End''' should be ''4672'' but, in the end, this should reflect whatever port you have defined in [[aMule]] ''Preferences'' -> ''Connection'' -> ''eMule extended UDP Port''.
+
起始端口和结束端口。''起始端口''默认是 ''4662''。但是最终还是决定于您在[[aMule]] 的''首选项(Preferences)'' -> ''连接(Connection)'' -> ''客户端TCP端口(Client TCP Port)''中设定的端口。''结束端口''默认是 ''4672''。但是最终还是决定于您在[[aMule]] 的''首选项(Preferences)'' -> ''连接(Connection)'' -> ''eMule扩展UDP端口(eMule extended UDP Port)''中设定的端口。<!--Start and end ports. '''Start to''' should be ''4662'' but, in the end, this should reflect whatever port you have defined in [[aMule]] ''Preferences'' -> ''Connection'' -> ''Client TCP Port''. '''End''' should be ''4672'' but, in the end, this should reflect whatever port you have defined in [[aMule]] ''Preferences'' -> ''Connection'' -> ''eMule extended UDP Port''.-->
  
I suggest using 2 separate entries for each port unless this is not possible.
+
<!--I suggest using 2 separate entries for each port unless this is not possible.-->
 +
我建议使用不同的条目针对不同的端口,除非这样不可行。
  
'''The Protocol column'''<br>
+
'''协议字段'''<br>
Protocol to listen for. If you use one line to open your [[aMule]] ports, set this option to '''Both'''. If you use a separate entry line for each, select option '''TCP''' for [[FAQ_eD2k-Kademlia#What_does_each_port_do?|Client TCP Port]] and option '''UDP''' for [[eMule]] [[FAQ_eD2k-Kademlia#What_does_each_port_do?|extended UDP Port]].
+
<!--Protocol to listen for. If you use one line to open your [[aMule]] ports, set this option to '''Both'''. If you use a separate entry line for each, select option '''TCP''' for [[FAQ_eD2k-Kademlia#What_does_each_port_do?|Client TCP Port]] and option '''UDP''' for [[eMule]] [[FAQ_eD2k-Kademlia#What_does_each_port_do?|extended UDP Port]].-->
 +
需监听的协议。如果仅使用一行来打开您的[[aMule]]端口,将其设置成为 '''(全部)Both'''选项。如果您分开设置每一项,选择'''TCP'''选项设置为[[FAQ_eD2k-Kademlia#What_does_each_port_do?|TCP客户端口]]和选择 '''UDP'''选项设置为[[eMule]] [[FAQ_eD2k-Kademlia#What_does_each_port_do?|扩展UDP端口]]。
  
'''The IP Address column'''<br>
+
'''IP地址字段'''<br>
Internal [[IP address]] to forward requests to. This is typically the internal (private) [[IP address]] of the computer that will use [[aMule]].
+
<!--Internal [[IP address]] to forward requests to. This is typically the internal (private) [[IP address]] of the computer that will use [[aMule]].-->
 +
用来将请求转发到的内网[[IP address|IP地址]] 。这个是使用[[aMule]]的电脑的内网(私有)[[IP address|IP地址]]。
  
'''The Enable column'''<br>
+
'''启用字段'''<br>
Enable rule. You'll need to check this in order to enable your [[aMule]] rules.
+
<!--Enable rule. You'll need to check this in order to enable your [[aMule]] rules.-->
 +
启用规则。您需要选中这个来启用您制定的 [[aMule]]规则。
  
After adding your rule, make sure you save your settings. You can verify whether your rules work by [http://www.amule.org/testport.php testing your ports].
+
<!--After adding your rule, make sure you save your settings. You can verify whether your rules work by [http://www.amule.org/testport.php testing your ports].-->
 +
在添加您自己的规则之后,一定要保存您的设置。您可以在[http://www.amule.org/testport.php 测试端口]页面确定您的规则是否有效。
  
=== [http://www.dlink.com DLink] Router configuration ===
+
=== [http://www.dlink.com DLink] 路由器配置 ===
Log in to your [http://www.dlink.com DLink] router.  There are three steps to take to enable your [[aMule]] [[port]]s.
+
  
'''IP Address setup'''
+
登录您的[http://www.dlink.com DLink]路由器。需要三部操作来启用您的[[aMule]] [[port|端口]]。
  
In the Home tab, click the DHCP button.  This page displays the current [[IP address]]es assigned by the router, both static and dynamic. Look for the name or MAC address of the computer you'll be running [[aMule]] on. If your computer is receiving dynamically assigned [[IP address]]es, you will have to change your settings every so often if your [[IP address]] changes. To avoid this, use the Static DHCP section, and perform the following steps:
+
'''IP地址建立 '''
  
*'''Name''': Type in the name of your computer here, could be anything
+
在首页标签上,点击DHCP按钮。该页面显示了当前由路由器分配的[[IP address|IP地址]],包括静态的和动态的。查看您正在运行[[aMule]]的电脑名称和网卡地址。如果您的电脑是通过动态分配[[IP address|IP地址]],当您的[[IP address|IP地址]]改变时,您必须屡次更改您的设置。为了避免这些,使用静态DHCP(Static DHCP),按照以下步骤:
*'''IP''': The [[IP address]] you want the router to always assign to your computer
+
*'''MAC Address''': The MAC address of your computer. You should be already connected to the router, so you can find your computer in the ''DHCP Client'' drop-down menu, and click clone, to populate this number
+
*Click ''Apply''
+
  
Now your computer will always receive the same [[IP address]].
+
*'''名称''':在这里输入您电脑的名称,可以是任何内容
 +
*'''IP''': 您想使路由器每次给您电脑分配的[[IP address|IP地址]]
 +
*'''网卡地址''': 您电脑的网卡地址。您既然已经连接到路由器,您就可以在''DHCP客户端(DHCP Client)''下拉菜单中找到您的电脑,然后点击克隆(clone),使用该地址
 +
*点击''应用(Apply)''
  
Now click on the ''Advanced'' tab, and there are two areas that need to be updated:
+
到此您的电脑将每次都收到相同的[[IP address|IP地址]]。
  
'''Virtual Server'''
+
现在点击''高级(Advanced)''菜单,这里有两个区域需要更新:
*Click the ''Virtual Server'' button. This page forwards external requests to a specific internal [[IP address]] in your network
+
*Click ''Enabled''
+
*Enter a name in the ''Name'' entry box, eg ''aMule TCP''
+
*Enter your static [[IP address]] in the ''Private IP'' box
+
*Select [http://www.ietf.org/rfc/rfc793.txt TCP] in ''Protocol type''
+
*Private [[port]] is the [[port]] that the router will forward the requests to on your computer. This can be anything, a good value is the default [[aMule]] [http://www.ietf.org/rfc/rfc793.txt TCP] [[port]], ''4662''
+
*Public [[port]] is the [[port]] that the router will receive requests on. Again, a good value is the [[aMule]] [http://www.ietf.org/rfc/rfc793.txt TCP] [[port]] of ''4662''
+
*Schedule is the times at which the port is open. Select ''Always'', or whatever times you wish
+
*Click ''Apply''
+
  
'''Applications'''
+
'''虚拟服务器(Virtual Server)'''
*Click the ''Applications'' button. This page allows you to enter a range of [[port]]s to open for application usage
+
*点击''虚拟服务器(Virtual Server)''按钮。此页面将转发局域网内的请求到特定的网内[[IP address|IP地址]]
*Click ''Enabled''
+
*点击''启用(Enabled)
*Enter the [http://www.ietf.org/rfc/rfc793.txt TCP] [[port]] in the first ''Trigger Port'' box, a good value being ''4662''
+
*''名称''栏中输入一个名字,比如''aMule TCP''
*Select ''Trigger Type'' as [http://www.ietf.org/rfc/rfc793.txt TCP]
+
*''私有IP''栏中输入您的静态[[IP address|IP地址]]
*In ''Public Port'', enter the range from your [[aMule]] [http://www.ietf.org/rfc/rfc793.txt TCP] [[port]] to your [[aMule]] [http://www.faqs.org/rfcs/rfc768.html UDP] [[port]], usually ''4662''-''4672''
+
*在''协议类型(Protocol type)''中选择[http://www.ietf.org/rfc/rfc793.txt TCP]
*Select ''UDP'' as the ''Public Type''
+
*私有[[port|端口]]是路由器会转发到的您电脑上的端口。这可以是任何端口,比较好的端口是默认的[[aMule]] [http://www.ietf.org/rfc/rfc793.txt TCP] [[port|端口]], ''4662''
*Click ''Apply''
+
*公共[[port|端口]]是路由器接收请求所用的[[port|端口]]。同样,比较好的值是[[aMule]] [http://www.ietf.org/rfc/rfc793.txt TCP] [[port|端口]] ''4662''
 +
*进程(Schedule )是端口在何时打开。选择''总是(Always)''或者任何您希望的时间
 +
*点击 ''应用(Apply)''
  
You should now be all set, assuming that your computer firewall is setup to allow access on the selected [[port]]s.
+
'''应用程序(Applications)'''
 +
*点击 ''应用程序(Applications)''按钮。该页面会让您输入为应用程序使用而打开的[[port|端口]]范围。
 +
*点击 ''启用(Enabled)''
 +
*在第一个''触发端口(Trigger Port)''框中输入 [http://www.ietf.org/rfc/rfc793.txt TCP] [[port|端口]] ,比较好的值是''4662''
 +
*选择''触发类型(Trigger Type)'' 为 [http://www.ietf.org/rfc/rfc793.txt TCP]
 +
*在 ''公共端口(Public Port)''中,输入从[[aMule]] [http://www.ietf.org/rfc/rfc793.txt TCP] [[port|端口]]到您的[[aMule]] [http://www.faqs.org/rfcs/rfc768.html UDP] [[port|端口]]范围,通常是 ''4662''-''4672'''
 +
*选择''UDP'' 作为''公共类型(Public Type)''
 +
*点击 ''应用(Apply)''
  
'''Alternate Configuration (ie instead of Applications) for D-Link '''
+
您需要全部设置,假设您电脑上的防火墙已经设置成对所有选中的[[port|端口]]放行。
*Go back to virtual server and set 2 other virtual servers for the UDP ports
+
(It works only that way on my D-Link DI-804HV)
+
  
*Virtual server aMuleUDP4665 - select your IP address and UDP and 4665 (port)
+
'''D-Link的其他配置 (不是使用应用程序(Applications)) '''
 +
*返回到虚拟服务器然后设置2个其他的使用UDP端口的虚拟服务器
 +
(这仅仅在我的 D-Link DI-804HV中工作)
  
*Virtual Server aMuleUDP4672 - select your ip address and UDP and 4672 (port)
+
*虚拟服务器 aMuleUDP4665 - 选择您的IP地址 和 UDP 还有 4665 (端口)
  
(disable the above amule applications if you did try and it do not work).
+
*虚拟服务器 aMuleUDP4672 - 选择您的IP地址 和 UDP 还有 4672 (端口)
Then you shoudl have all arrows green ( and 3 virtual servers running for amule, 1 for TCP and 2 for UDP).
+
  
'''Another Alternate Configuration (using Firewall rules) for D-Link (tested on D-Link DI-624) '''
+
(如果您试验了上面amule 应用程序而且不可用的话关掉它).
*Click on ''Advanced'' tab then click on ''Firewall''. This page can be used to setup firewall rules directly '''Without ANY further settings in ''Virtual server'' or ''Applications'' tabs'''
+
然后您应当会看到所有的都变成绿色进度条 (3个虚拟服务器在为amule工作, 1 个 TCP端口 和 2 个 UDP端口).
  
*Click ''Enabled''
+
'''另一种D-Link (在D-Link DI-624已试验)配置 (使用防火墙规则) '''
 +
*点击''高级(Advanced)'' 菜单然后点击''防火墙(Firewall)''。此页面可以直接设置防火墙规则而'''不用任何更多的在 ''虚拟服务器'' 或者 ''应用程序'' 菜单里面设置'''  
  
*Enter your preferred name for the rule (must be unique)
+
*点击''启用(Enabled)''
  
*Select ''WAN'' as source interface and ''*'' for source IP Range Start (IP Range End can be left blank)
+
*输入您喜欢的规则名称(必须保证唯一)
  
*Select ''LAN'' as destination interface and enter the static IP of your PC running aMule for destination IP Range Start (IP Range End can be left blank)
+
*选择''WAN'' 作为源网络接口,并且 ''*'' 作为源IP范围的起始(IP范围的结束可以不输)
  
*Select ''*'' as destination protocol
+
*选择 ''LAN'' 作为目标网络接口并且输入您运行aMule电脑的静态IP地址作为目标IP范围的起始地址(IP范围结束地址可以不输)
  
*Enter ''4662-4672'' as destination port range
+
*选择''*'' 作为目标协议
  
*Select your preferred scheduling
+
*输入 ''4662-4672''作为目标端口范围
  
*Click apply
+
*选择您希望的进程
  
'''IMPORTANT NOTE''': disable all existing entries for aMule you may have specified in ''Virtual server'' or ''Applications'' tabs.
+
*点击''应用(Apply)''
  
*Reboot your router to be sure new configuration is applied (''Tools'' -> ''Misc'').
+
'''特别注意''': 关掉所有您在 ''虚拟服务器(Virtual server)'' 或者 ''应用程序(Applications)''菜单中指定的已打开的端口
  
  
=== [http://www.belkin.com Belkin] Router configuration ===
+
*重启您的路由器,应用新的配置 (''工具(Tools)'' -> ''杂项(Misc)'')
Log in to your Belkin router: [http://192.168.2.1 192.168.2.1].  You will be following these steps twice: once to create a [http://www.ietf.org/rfc/rfc793.txt TCP] record, and again to create a UDP record.
+
  
*Click the ''Virtual Servers'' link in the ''Firewall'' section on the left. This page forwards external requests to a specific internal [[IP address]] in your network
+
=== [http://www.belkin.com 贝尔金(Belkin)] 路由器配置 ===
*Pick the first empty row
+
登录您的 [http://www.belkin.com 贝尔金(Belkin)]路由器: [http://192.168.2.1 192.168.2.1]。您需要重复接下来的步骤两次:一次建立[http://www.ietf.org/rfc/rfc793.txt TCP] 记录,再一次建立UDP记录<!-- You will be following these steps twice: once to create a [http://www.ietf.org/rfc/rfc793.txt TCP] record, and again to create a UDP record.-->
*Check ''Enabled''
+
*Enter any name you like in the ''Description'' entry box, eg: ''aMule TCP/UDP''
+
*For the ''Inbound port'' entry boxes, enter ''4660'' and ''4712''.
+
*Select ''TCP'' or ''UDP'' out of the ''Type'' dropdown.  If you already have one set up, pick the other.
+
*For ''Private IP address'' enter the IP address the router assigned your machine. There are many ways to find this. Ubuntu users might want to use gnome-nettool (Network Tools) and look at the IPv4 entry under the appropriate network interface. If you like the terminal, type ifconfig and look for the inet addr entry. If you're in Windows, you can type ipconfig from the command line. No matter how you do it, the number should look like 192.168.2.x where x is the number you will be entering.
+
*''Private port'' is the [[port]] that the router will forward the requests to on your computer. Though this can be anything, the default [[aMule]] port is 4662 for TCP and 4672 for UDP.  Entering ''4660'' and ''4712'', same as the inbound port range above, will cover other possible ports.
+
*Repeat the steps above to make sure you have an entry for both TCP and another entry for UDP.
+
*Click ''Apply''
+
*If you have aMule open, go to it click ''Disconnect''.  When the button changes, click ''Connect''.  Kad should no longer be firewalled and you should not get another Low ID error.  If you do still have issues, make sure you completed all the steps correctly by testing your ports: [http://www.amule.org/testport.php http://www.amule.org/testport.php]
+
  
Keep in mind that the ''Private IP address'' number could change if you're ever disconnected from the router, because it is dynamically assigned by default.
+
*点击左侧''防火墙(Firewall)''下的''虚拟服务器(Virtual Servers)''链接。该页面会引导到您到网络中指定的内网[[IP address|IP地址]]<!--Click the ''Virtual Servers'' link in the ''Firewall'' section on the left. This page forwards external requests to a specific internal [[IP address]] in your network-->
 +
*选择第一行空行
 +
*选中''启用(Enabled)''
 +
*在''描述(Description)''中输入您喜欢的名字,就比如:''aMule TCP/UDP''
 +
*在''Inbound port''输入框中输入 ''4660'' 和 ''4712''。
 +
*在''类型(Type)''下拉按钮中选择''TCP''或者''UDP''。如果您已经设置好了一个,那就选另一个。
 +
*对于 ''私有IP地址(Private IP address)'',输入路由器分配给您机器的IP地址。有很多方法可以找到IP地址。 Ubuntu用户可以使用 gnome-nettool (Network Tools)然后查看网络接口属性下的IPv4地址。如果您喜欢使用终端(terminal),输入''ifconfig''然后查看对应网卡下的inet addr条目。如果您在Windows下,您可以从命令行(command line)输入ipconfig。无论您怎么做,得到的地址应该像192.168.2.x的样子,其中x是某些数字,而这个地址是您需要输入的。<!--For ''Private IP address'' enter the IP address the router assigned your machine.  There are many ways to find this. Ubuntu users might want to use gnome-nettool (Network Tools) and look at the IPv4 entry under the appropriate network interface.  If you like the terminal, type ifconfig and look for the inet addr entry.  If you're in Windows, you can type ipconfig from the command line.  No matter how you do it, the number should look like 192.168.2.x where x is the number you will be entering.-->
 +
 
 +
*''私有端口(Private port)''是指路由器将请求转发到您电脑上的那个[[port|端口]]。虽然该端口可以是任何值,但默认的 [[aMule]] 端口是TCP下的4662和UDP下的4672。如果输入与上面  inbound port 一样''4660''和''4712''的会覆盖其他可能端口。<!--is the [[port]] that the router will forward the requests to on your computer. Though this can be anything, the default [[aMule]] port is 4662 for TCP and 4672 for UDP.  Entering ''4660'' and ''4712'', same as the inbound port range above, will cover other possible ports.-->
 +
*重复上面的步骤,确定您的TCP类型和UDP类型都已经配置完成。<!--Repeat the steps above to make sure you have an entry for both TCP and another entry for UDP.-->
 +
*点击''应用(Apply)''
 +
*如果您的aMule在运行,点击软件上的“''断开(Disconnect)''”。当按钮改变时,再点击“''连接(Connect)''”。Kad就不会再被防火墙拦截而您再也不会获得低ID错误。如果您依旧还存在问题,测试您的端口,确定您正确完成了所有步骤:[http://www.amule.org/testport.php http://www.amule.org/testport.php]
 +
<!--If you have aMule open, go to it click ''Disconnect''.  When the button changes, click ''Connect''.  Kad should no longer be firewalled and you should not get another Low ID error.  If you do still have issues, make sure you completed all the steps correctly by testing your ports: [http://www.amule.org/testport.php http://www.amule.org/testport.php]-->
 +
 
 +
记住如果您一旦与路由器失去连接,''私有IP地址(Private IP address)''可能会改变,因为它默认是动态分配。
  
 
=== 美国网件(Netgear)路由器 ===
 
=== 美国网件(Netgear)路由器 ===

Latest revision as of 14:44, 5 September 2011

English | Deutsch | Español |简体中文

Routers路由器

这里是一些路由器介绍以及如何进行允许设置连接到aMule的端口。

在下面的介绍中,示例使用的是默认的端口(就是4662标准客户端TCP端口4672扩展客户端UDP端口以及4665扩展服务器请求UDP端口)。

Linksys WRT54GSV4

  1. 打开您的浏览器,输入地址 http://192.168.1.1然后登录。
  2. 进入游戏和应用程序(Gaming applications)
  3. 然后启用连接到您电脑的端口:
    1. 标准客户端TCP端口
      1. 更改起始端口(Ports start)结束端口(End)全部为4662
      2. 在下一项设置为TCP
      3. 在该项中,最后3个数字是您的局域网 IP
    2. 扩展客户端UDP端口
      1. 更改起始端口(Ports start)结束端口(End)全部为4672
      2. 下一项设置为UDP
      3. 在该项中,最后3个数字是您的局域网 IP
    3. 扩展服务器请求UDP端口
      1. 更改起始端口(Ports start)结束端口(End)全部为4665
      2. 下一项设置为UDP
      3. 在该项中,最后3个数字是您的局域网 IP
  4. 然后选中 启用(Enable)'
  5. 然后点击保存设置(Save settings)
  6. 然后重启aMule :)

Linksys路由器配置

这部分只适用于stock版(stock version)的 Linksys硬件。如果您在使用不同的 GPL版本(code)的 Linksys,请直接参考您最可能在用的上面提到的iptables指导。

登录您的 Linksys路由器。在成功登录后,在主菜单上查找应用程序和游戏(Applications & Gaming)标签,之后您会看到额外的子菜单列表。点击 端口转发(Port Range Forwarding)保证您在正确的子菜单下.。

这时,您会看到带有6个字段的一张表。字段分别为:应用程序(Application), 起始端口(Start to), 结束端口(End), 协议(Protocol), IP地址(IP Address), 启用(Enable)

应用程序字段
服务的适当名称。可以输入任何您喜欢的。推荐使用 aMule

起始端口-结束端口字段
起始端口和结束端口。起始端口默认是 4662。但是最终还是决定于您在aMule首选项(Preferences) -> 连接(Connection) -> 客户端TCP端口(Client TCP Port)中设定的端口。结束端口默认是 4672。但是最终还是决定于您在aMule首选项(Preferences) -> 连接(Connection) -> eMule扩展UDP端口(eMule extended UDP Port)中设定的端口。

我建议使用不同的条目针对不同的端口,除非这样不可行。

协议字段
需监听的协议。如果仅使用一行来打开您的aMule端口,将其设置成为 (全部)Both选项。如果您分开设置每一项,选择TCP选项设置为TCP客户端口和选择 UDP选项设置为eMule 扩展UDP端口

IP地址字段
用来将请求转发到的内网IP地址 。这个是使用aMule的电脑的内网(私有)IP地址

启用字段
启用规则。您需要选中这个来启用您制定的 aMule规则。

在添加您自己的规则之后,一定要保存您的设置。您可以在测试端口页面确定您的规则是否有效。

DLink 路由器配置

登录您的DLink路由器。需要三部操作来启用您的aMule 端口

IP地址建立

在首页标签上,点击DHCP按钮。该页面显示了当前由路由器分配的IP地址,包括静态的和动态的。查看您正在运行aMule的电脑名称和网卡地址。如果您的电脑是通过动态分配IP地址,当您的IP地址改变时,您必须屡次更改您的设置。为了避免这些,使用静态DHCP(Static DHCP),按照以下步骤:

  • 名称:在这里输入您电脑的名称,可以是任何内容
  • IP: 您想使路由器每次给您电脑分配的IP地址
  • 网卡地址: 您电脑的网卡地址。您既然已经连接到路由器,您就可以在DHCP客户端(DHCP Client)下拉菜单中找到您的电脑,然后点击克隆(clone),使用该地址
  • 点击应用(Apply)

到此您的电脑将每次都收到相同的IP地址

现在点击高级(Advanced)菜单,这里有两个区域需要更新:

虚拟服务器(Virtual Server)

  • 点击虚拟服务器(Virtual Server)按钮。此页面将转发局域网内的请求到特定的网内IP地址
  • 点击启用(Enabled)
  • 名称栏中输入一个名字,比如aMule TCP
  • 私有IP栏中输入您的静态IP地址
  • 协议类型(Protocol type)中选择TCP
  • 私有端口是路由器会转发到的您电脑上的端口。这可以是任何端口,比较好的端口是默认的aMule TCP 端口, 4662
  • 公共端口是路由器接收请求所用的端口。同样,比较好的值是aMule TCP 端口4662
  • 进程(Schedule )是端口在何时打开。选择总是(Always)或者任何您希望的时间
  • 点击 应用(Apply)

应用程序(Applications)

  • 点击 应用程序(Applications)按钮。该页面会让您输入为应用程序使用而打开的端口范围。
  • 点击 启用(Enabled)
  • 在第一个触发端口(Trigger Port)框中输入 TCP 端口 ,比较好的值是4662
  • 选择触发类型(Trigger Type)TCP
  • 公共端口(Public Port)中,输入从aMule TCP 端口到您的aMule UDP 端口范围,通常是 4662-4672'
  • 选择UDP 作为公共类型(Public Type)
  • 点击 应用(Apply)

您需要全部设置,假设您电脑上的防火墙已经设置成对所有选中的端口放行。

D-Link的其他配置 (不是使用应用程序(Applications))

  • 返回到虚拟服务器然后设置2个其他的使用UDP端口的虚拟服务器

(这仅仅在我的 D-Link DI-804HV中工作)

  • 虚拟服务器 aMuleUDP4665 - 选择您的IP地址 和 UDP 还有 4665 (端口)
  • 虚拟服务器 aMuleUDP4672 - 选择您的IP地址 和 UDP 还有 4672 (端口)

(如果您试验了上面amule 应用程序而且不可用的话关掉它). 然后您应当会看到所有的都变成绿色进度条 (3个虚拟服务器在为amule工作, 1 个 TCP端口 和 2 个 UDP端口).

另一种D-Link (在D-Link DI-624已试验)配置 (使用防火墙规则)

  • 点击高级(Advanced) 菜单然后点击防火墙(Firewall)。此页面可以直接设置防火墙规则而不用任何更多的在 虚拟服务器 或者 应用程序 菜单里面设置
  • 点击启用(Enabled)
  • 输入您喜欢的规则名称(必须保证唯一)
  • 选择WAN 作为源网络接口,并且 * 作为源IP范围的起始(IP范围的结束可以不输)
  • 选择 LAN 作为目标网络接口并且输入您运行aMule电脑的静态IP地址作为目标IP范围的起始地址(IP范围结束地址可以不输)
  • 选择* 作为目标协议
  • 输入 4662-4672作为目标端口范围
  • 选择您希望的进程
  • 点击应用(Apply)

特别注意: 关掉所有您在 虚拟服务器(Virtual server) 或者 应用程序(Applications)菜单中指定的已打开的端口


  • 重启您的路由器,应用新的配置 (工具(Tools) -> 杂项(Misc))

贝尔金(Belkin) 路由器配置

登录您的 贝尔金(Belkin)路由器: 192.168.2.1。您需要重复接下来的步骤两次:一次建立TCP 记录,再一次建立UDP记录

  • 点击左侧防火墙(Firewall)下的虚拟服务器(Virtual Servers)链接。该页面会引导到您到网络中指定的内网IP地址
  • 选择第一行空行
  • 选中启用(Enabled)
  • 描述(Description)中输入您喜欢的名字,就比如:aMule TCP/UDP
  • Inbound port输入框中输入 46604712
  • 类型(Type)下拉按钮中选择TCP或者UDP。如果您已经设置好了一个,那就选另一个。
  • 对于 私有IP地址(Private IP address),输入路由器分配给您机器的IP地址。有很多方法可以找到IP地址。 Ubuntu用户可以使用 gnome-nettool (Network Tools)然后查看网络接口属性下的IPv4地址。如果您喜欢使用终端(terminal),输入ifconfig然后查看对应网卡下的inet addr条目。如果您在Windows下,您可以从命令行(command line)输入ipconfig。无论您怎么做,得到的地址应该像192.168.2.x的样子,其中x是某些数字,而这个地址是您需要输入的。
  • 私有端口(Private port)是指路由器将请求转发到您电脑上的那个端口。虽然该端口可以是任何值,但默认的 aMule 端口是TCP下的4662和UDP下的4672。如果输入与上面 inbound port 一样46604712的会覆盖其他可能端口。
  • 重复上面的步骤,确定您的TCP类型和UDP类型都已经配置完成。
  • 点击应用(Apply)
  • 如果您的aMule在运行,点击软件上的“断开(Disconnect)”。当按钮改变时,再点击“连接(Connect)”。Kad就不会再被防火墙拦截而您再也不会获得低ID错误。如果您依旧还存在问题,测试您的端口,确定您正确完成了所有步骤:http://www.amule.org/testport.php

记住如果您一旦与路由器失去连接,私有IP地址(Private IP address)可能会改变,因为它默认是动态分配。

美国网件(Netgear)路由器

首先,进入您的路由器控制页面,在http://routerlogin.net/start.htm。然后,在屏幕的左侧,高级选项下面,点击”端口转发(Port Forwarding)/端口触发(Port Triggering)“。点击“添加自定义服务”按钮,命名为aMule1(或者其他的),使它为仅TCP转发,开始端口(starting port)和结束端口( ending port)都为4662,服务器IP地址为当前使用的地址(如果您是唯一一个连接到路由器上的话,或许是192.168.1.2,但还是要检查一下),然后点击“应用(Apply)”。重复以上步骤,使用aMule2,aMule3,都选择“仅用UDP”,aMule2起始端口和结束端口都为4665,aMule3的起始端口和结束端口都为4672。(也就是,对于aMule2和aMule3起始端口和结束端口都是一样的,但是aMule2=4665,aMule3=4672.)保证iptables在运行aMule(如上)的机器上被正确设置好,这就算大功告成。

很明显,不是所有的美国网件(Netgear)的路由器都一样,毕竟在 DG834G上这会更复杂。到路由器配置页面:

  1. 内容过滤(Content Filtering)菜单下选择服务(Services)
  2. 根据您的aMule连接配置(Connection preferences)添加三条规则(1条TCP,2条UDP)
  3. 在同一菜单下选择防火墙规则(Firewall Rules)
  4. 将三条规则添加为Inbound Services
  5. 将UDP规则添加为 Outbound Services(只有一条是必须的但是为了防止意外我也添加了其他的)

TRENDnet 路由器TW100

首先连接到您的路由器:通常打开浏览器然后直接输入路由器IP地址:例如 192.168.0.1 (或者 192.168.1.1),然后登录框会出现(具体依赖于在您的路由器配置)-如果这样,输入用户名'admin',密码为空(或者是您设定好的那个)。

然后在左侧菜单,选择网络(Internet)然后选择高级设置(高级网络,Advanced Internet),然后点击/选择,[Special Applications|特殊应用程序(Special Applications)]:

在特殊应用程序(Special Applications)列表中添加或者替换成两行内容: (请不要删除您在使用和已经被可用的内容) (例如仅仅在Nr.5或者Nr.6后面添加新的amule应用程序)

创建如下全部内容:

amuleU4665 TCP-4665-4665 UDP-4665-4665

amuleU4672 TCP-4672-4672 UDP-4672-4672 )

(在我的应用列表中 “amuleU4665” 和 “amule4672”处于Nr1和Nr2,但可以在您列表中的任何位置)。

->点击左侧的小框[ ]中的类似amuleUxxxx的应用程序来使特殊应用程序可以工作。

然后点击[保存],接着点击[关闭]

接着在页面-高级网络(Advanced Internet)点击[保存]

最后的步骤就是点击左侧的“虚拟服务器(Virtual Servers)”菜单,“虚拟服务器页面会出现“

添加一个新的虚拟服务器,名称为:AmuleTCP

选择您电脑*IP地址:在下拉菜单中选择

选择:TCP

输入4662端口和4662端口(两个输入为同一端口)

然后[添加为新服务器(Add as new server)]

Then you are set to have High ID and Kad ON. Finished with the Low-ID, yellow arrows and Kad Firewalled. Now all you arrows should be green and you should have access to Kad and ed2K. 接着就会设置为拥有 高ID(HighID)和Kad网络允许(ON)。

特别注意:

  • 在您的电脑使用DHCP时您要更加小心(就像从路由器获取IP地址)。

路由器可能不会总给您的电脑相同的IP地址。 (通常情况下会这样,但是有时候会有所改变)。 如果您发现您获得了低ID,您有两个解决办法:(2个解决办法)

1)再次登回路由器,回到虚拟服务器 (virtual server),选择您建立的"amuleTCP虚拟服务器",在"PC(server)"中重新选择您的电脑。然后选择[更新此服务器(Update this server)]然后退出。这样应该可以了。

或者另外方法:

2)如果您愿意您可以给您的电脑配置固定IP地址。如果因为您的DHCP路由器总给您分配不同的IP地址而导致您经常获得低ID的话,您可以将您的电脑设置为静态IP模式或者DHCP保留地址。但是您在这之前需要知道您的DNS服务器地址。所以向您的ISP查看DNS服务器。然后将您的电脑配置成 固定DHCP (Fixed DHCP)/静态地址(Static Address)/手动地址(Manual Address)(这个名字是根据您运行的操作系统)。您的网络设置,输入您希望的IP地址,您的网关(即您的路由器IP地址)和从您的ISP获得的DNS地址。


假如您的 TRENDNet路由器崩溃或者停止从/到您装有aMule的电脑上的传输数据。(这个发生在我身上),应该:

- 减少连接限制到100(或者50)(在选项 Preferences -> 连接Connection)

- 减少"最多新建连接/5秒(Max new connections / 5 secs)"为10(或者5)(在选项 Preferences->Core Tweaksr)

停止amule并且重新启动aMule保证配置可以使用。


测试以保证您的配置正确。这会使您的路由器更稳定和防止路由器崩溃(就像您不得不重置路由并且/或者启动停止)。这或许对其他路由器也适用(?)。

(TRENDnet Firewall from RFV - --Robert364 17:05, 5 Nov 2006 (CET))

OpenBSD

OpenBSD上的防火墙叫做 packetfilter (pf),为了是aMule运行,您必须将下面规则添加到您的pf.conf文件(/etc/pf.conf):

 # aMule TCP 和 UDP
 rdr pass on egress proto tcp to port 4662 -> IPADDR
 rdr pass on egress proto udp to port 4672 -> IPADDR
 rdr pass on egress proto udp to port 4665 -> IPADDR

IPADDR是在网络上运行aMule电脑的内网IP地址。

所使用关键字egress,Pf能够自动猜测外部网络接口名称(连接互联网部分)(这意味着,对于默认路由器通过的网络接口,如果有更改它将动态更新)。

示例(运行aMule的电脑IP是192.168.1.10):

 # aMule TCP 和 UDP
 rdr pass on egress proto tcp to port 4662 -> 192.168.1.10
 rdr pass on egress proto udp to port 4672 -> 192.168.1.10
 rdr pass on egress proto udp to port 4665 -> 192.168.1.10

当然,为了使运行aMule的电脑必须有权限连接网络,所以也要添加下面规则:

 nat on egress from IPADDR to any -> (egress)

IPADDR是在网络上运行aMule电脑的内网IP地址。

示例(像上面):

 nat on egress from 192.168.1.10 to any -> (egress)

为了激活更改后的配置,重启或者执行下面命令:

 pfctl -f /etc/pf.conf

为了在启动时自动加载防火墙:

 echo PF=yes >> /etc/rc.conf.local


为了使KAD顺利连接而不是被防火墙阻拦,将下面内容放在pf.conf文件NAT字段的前面(因为NAT规则使用列表的第一个匹配,而不像pf.conf的其他部分):

 no nat on egress proto udp from 192.168.1.10 port 4672 to any

查看the FAQ中的为什么我的Kademlia仍然显示被防火墙阻拦?

这里找不到我的路由器类型怎么办?

如果您用的是其他类型的路由器,在网址: http://www.portforward.com/ 中 查看您对应类型的正确的A-Mule (或者 E-Mule)的 NAT-设置