iptables port forwarding for emule

January 1st, 2010 | Categories: linux | Tags: , ,

Suppose you wanna have HighID and open KAD network connection for eMule on a computer in a LAN, and the gateway is running iptables. Just add the rules below to your existing iptables rules and you are done.

# this example is based on the assumption that
# eth0 is WAN interface and eth1 is LAN interface,
# 192.168.0.2 is the ip address of a computer in LAN,
# 4262 is the tcp port for ed2k network,
# 4272 is the udp port for kad network.

-A PREROUTING -i eth0 -p tcp -m tcp --dport 4262 -j DNAT --to-destination 192.168.0.2:4262
-A PREROUTING -i eth0 -p udp -m udp --dport 4272 -j DNAT --to-destination 192.168.0.2:4272

-A FORWARD -d 192.168.0.2/32 -i eth0 -o eth1 -p tcp --dport 4262 -j ACCEPT
-A FORWARD -d 192.168.0.2/32 -i eth0 -o eth1 -p udp --dport 4272 -j ACCEPT
  1. January 12th, 2010 at 18:06
    Reply | Quote | #1

    为啥我ubuntu ip_forward 文件编辑不了。。

  2. January 12th, 2010 at 21:46
    Reply | Quote | #2

    你sudo了?
    或著直接edit /etc/sysctl.conf吧

Brain Bliss