aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Author Topic: question about iptable setting  (Read 3593 times)

terry

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 15
question about iptable setting
« on: October 28, 2004, 08:16:59 AM »

Hi

I read this page
http://www.amule.org/wiki/index.php/Firewall
and they say
I have to set
Code: [Select]
iptables -A INPUT -p tcp --dport XX -j ACCEPT
iptables -A INPUT -p udp --dport XX+3 -j ACCEPT
iptables -A INPUT -p udp --dport YY -j ACCEPT
but in my test
I  only set
Code: [Select]
iptables -A INPUT -p tcp --dport XX -j ACCEPT
I can do serch, and file download, and I see other can get file from my share directory.

Should do I open last 2 udp port?
and what is diffreant open them, last 2 udp port?

Thanks
« Last Edit: October 28, 2004, 09:14:51 AM by terry »
Logged

Supersnail

  • Full Member
  • ***
  • Karma: 4
  • Offline Offline
  • Posts: 186
Re: question about iptable setting
« Reply #1 on: October 28, 2004, 07:19:56 PM »

You can find all the ports and their purposes used by eMule (and by aMule) at http://www.emule-project.net/home/perl/help.cgi?l=1&topic_id=122&rm=show_topic
Logged

terry

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 15
Re: question about iptable setting
« Reply #2 on: October 28, 2004, 09:58:48 PM »

Thanks  :D
Logged

viz

  • Newbie
  • Karma: 0
  • Offline Offline
  • Posts: 2
Re: question about iptable setting
« Reply #3 on: November 24, 2004, 10:44:58 AM »

This is a old thread, but for a different view with anyone who has a similar problem try this:

iptables -t nat -A PREROUTING -p tcp --dport 4662 -j DNAT --to-destination xxx.xxx.x.x

xxx.xxx.x.x being destination machine ip address.

Was the only one that worked for me (Debian)

You will need 3 lines, ports

tcp 4662
udp 4665 (4662+3)
udp 4672

You can actually use any port (I think) above 1024 as long as one of the UDP ports is 3 numbers higher than the TCP port...

/viz
(this is about the limit of my knowledge in Linux! :)
Logged

Jacobo221

  • Hero Member
  • *****
  • Karma: 3
  • Offline Offline
  • Posts: 2712
Re: question about iptable setting
« Reply #4 on: November 25, 2004, 02:08:13 PM »

thanks :)
this confrms that the second part of that wiki article works hehe

Greetings!
Logged

paolo.belli

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 14
Re: question about iptable setting
« Reply #5 on: November 29, 2004, 09:22:48 PM »

When you set iptables,how do you save the new settings?          
I tried with "iptables-save", but when I reboot the system (SuSE 9.1) new settings disappear. Thanks for help!
Logged

Jacobo221

  • Hero Member
  • *****
  • Karma: 3
  • Offline Offline
  • Posts: 2712
Re: question about iptable setting
« Reply #6 on: November 29, 2004, 09:29:56 PM »

no idea. never used iptables here. I guess you have to set all those lines into ~/.bashrc or ~/.profile or /etc/profile or /etc/bashrc or whatever, or into someo init script (depending on which mode you want the firewall to be executed).

You should ask at some linux forum, but I'm 70% sure I'm right on my guess ;)

Greetings!
Logged

GonoszTopi

  • The current man in charge of most things.
  • Administrator
  • Hero Member
  • *****
  • Karma: 169
  • Offline Offline
  • Posts: 2685
Re: question about iptable setting
« Reply #7 on: November 30, 2004, 12:28:32 PM »

On RedHat 9.0 you can edit the file /etc/sysconfig/iptables, which has the same format as iptables-save, so you can do iptables-save > /etc/sysconfig/iptables, but i suggest editing the file. RedHat sets up iptables from this file upon system start, and some services directly edit the already-set-up iptables configuration upon their startup (e.g. ntpd), and you probably don't want their (sometimes not static) things saved.

You can also add these three lines to /etc/rc.d/rc.local or something similar on your system, so it'll get executed as the last part of the system startup.

I just found this one for SuSe http://forum.amule.org/thread.php?threadid=4297&sid= :)
Logged
concordia cum veritate