Skip to contentSkip to conversation

opening a port..

DISCUSSION mdew 9 participants 25 messages Jan 8, 2003 – Jan 9, 2003

lore
Share & tools
lore

mdew

author
#0 lore raw

Hi,
Just *testing* this out..

iptables -A INPUT -i eth0 -p tcp --dport 4662 -j ACCEPT iptables -A INPUT -i eth0 -p udp --dport 4662 -j ACCEPT iptables -A INPUT -i eth1 -p udp --dport 4662 -j ACCEPT iptables -A INPUT -i eth1 -p tcp --dport 4662 -j ACCEPT iptables -A INPUT -i eth1 -p tcp --sport 4662 -j ACCEPT iptables -A INPUT -i eth1 -p udp --sport 4662 -j ACCEPT iptables -A INPUT -i eth0 -p udp --sport 4662 -j ACCEPT iptables -A INPUT -i eth0 -p tcp --sport 4662 -j ACCEPT

iptables -A FORWARD -o eth0 -p tcp --dport 4662 -j ACCEPT iptables -A FORWARD -o eth1 -p tcp --dport 4662 -j ACCEPT iptables -A FORWARD -o eth1 -p udp --dport 4662 -j ACCEPT iptables -A FORWARD -o eth0 -p udp --dport 4662 -j ACCEPT iptables -A FORWARD -o eth0 -p udp --sport 4662 -j ACCEPT iptables -A FORWARD -o eth1 -p udp --sport 4662 -j ACCEPT iptables -A FORWARD -o eth1 -p tcp --sport 4662 -j ACCEPT iptables -A FORWARD -o eth0 -p tcp --sport 4662 -j ACCEPT

yet, when i try to telnet to it,

mdew:~# telnet 127.0.0.1 4662
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused

Yeah I know I have lots of unnessary rules, but im only testing 'em...it just seems a little strange that i cant see 4662 (Edonkey port) on the router.

-mdew

#1 lore raw
Quoted 28 lines · mdew

Hi,
Just *testing* this out..

iptables -A INPUT -i eth0 -p tcp --dport 4662 -j ACCEPT iptables -A INPUT -i eth0 -p udp --dport 4662 -j ACCEPT iptables -A INPUT -i eth1 -p udp --dport 4662 -j ACCEPT iptables -A INPUT -i eth1 -p tcp --dport 4662 -j ACCEPT iptables -A INPUT -i eth1 -p tcp --sport 4662 -j ACCEPT iptables -A INPUT -i eth1 -p udp --sport 4662 -j ACCEPT iptables -A INPUT -i eth0 -p udp --sport 4662 -j ACCEPT iptables -A INPUT -i eth0 -p tcp --sport 4662 -j ACCEPT

iptables -A FORWARD -o eth0 -p tcp --dport 4662 -j ACCEPT iptables -A FORWARD -o eth1 -p tcp --dport 4662 -j ACCEPT iptables -A FORWARD -o eth1 -p udp --dport 4662 -j ACCEPT iptables -A FORWARD -o eth0 -p udp --dport 4662 -j ACCEPT iptables -A FORWARD -o eth0 -p udp --sport 4662 -j ACCEPT iptables -A FORWARD -o eth1 -p udp --sport 4662 -j ACCEPT iptables -A FORWARD -o eth1 -p tcp --sport 4662 -j ACCEPT iptables -A FORWARD -o eth0 -p tcp --sport 4662 -j ACCEPT

yet, when i try to telnet to it,

mdew:~# telnet 127.0.0.1 4662
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused
Quoted 7 lines

Yeah I know I have lots of unnessary rules, but im only testing 'em...it just seems a little strange that i cant see 4662 (Edonkey port) on the router.

-mdew

Note:
telnet 127.0.0.1 port

This will not go through any of the interfaces(eth*). You should allow
this through -i lo.

Here some how you are getting connected and you are getting the response connection refused. Probably you are not running the service on the router!.

Signature · 2 lines
Dharmendra.T
Linux Enthu
author
#2 lore raw
Quoted 41 lines · Dharmendra.T
Quoted 28 lines · mdew

Hi,
Just *testing* this out..

iptables -A INPUT -i eth0 -p tcp --dport 4662 -j ACCEPT iptables -A INPUT -i eth0 -p udp --dport 4662 -j ACCEPT iptables -A INPUT -i eth1 -p udp --dport 4662 -j ACCEPT iptables -A INPUT -i eth1 -p tcp --dport 4662 -j ACCEPT iptables -A INPUT -i eth1 -p tcp --sport 4662 -j ACCEPT iptables -A INPUT -i eth1 -p udp --sport 4662 -j ACCEPT iptables -A INPUT -i eth0 -p udp --sport 4662 -j ACCEPT iptables -A INPUT -i eth0 -p tcp --sport 4662 -j ACCEPT

iptables -A FORWARD -o eth0 -p tcp --dport 4662 -j ACCEPT iptables -A FORWARD -o eth1 -p tcp --dport 4662 -j ACCEPT iptables -A FORWARD -o eth1 -p udp --dport 4662 -j ACCEPT iptables -A FORWARD -o eth0 -p udp --dport 4662 -j ACCEPT iptables -A FORWARD -o eth0 -p udp --sport 4662 -j ACCEPT iptables -A FORWARD -o eth1 -p udp --sport 4662 -j ACCEPT iptables -A FORWARD -o eth1 -p tcp --sport 4662 -j ACCEPT iptables -A FORWARD -o eth0 -p tcp --sport 4662 -j ACCEPT

yet, when i try to telnet to it,

mdew:~# telnet 127.0.0.1 4662
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused
Quoted 7 lines

Yeah I know I have lots of unnessary rules, but im only testing 'em...it just seems a little strange that i cant see 4662 (Edonkey port) on the router.

-mdew

Note:
telnet 127.0.0.1 port

Quoted 11 lines

This will not go through any of the interfaces(eth*). You should allow
this through -i lo.

Here some how you are getting connected and you are getting the response connection refused. Probably you are not running the service on the router!.

Signature · 2 lines
Dharmendra.T
Linux Enthu

ok, telnet from another machine to the router.

telnet 10.0.0.6 4662
Trying 10.0.0.6...
telnet: Unable to connect to remote host: Connection refused

what "service" should I be running? I simply want 4662 open both ways.

-mdew

#3 lore raw
Quoted 7 lines

ok, telnet from another machine to the router.

telnet 10.0.0.6 4662
Trying 10.0.0.6...
telnet: Unable to connect to remote host: Connection refused

what "service" should I be running? I simply want 4662 open both ways.

# netstat -an|grep 4662
should tell you if your box is listening at all on port 4662.

If you run eDonkey server on the firewall box, open port in the INPUT chain.
If your eDonkey server is *behind* the firewall, open the port in the FORWARD chain, and add a DNAT rule in the nat table -> PREROUTING chain.

Rob

#4 lore raw
Quoted 8 lines · Rob Sterenborg
Quoted 7 lines

ok, telnet from another machine to the router.

telnet 10.0.0.6 4662
Trying 10.0.0.6...
telnet: Unable to connect to remote host: Connection refused

what "service" should I be running? I simply want 4662 open both ways.

Quoted 7 lines
# netstat -an|grep 4662
should tell you if your box is listening at all on port 4662.

If you run eDonkey server on the firewall box, open port in the INPUT chain.
If your eDonkey server is *behind* the firewall, open the port in the FORWARD chain, and add a DNAT rule in the nat table -> PREROUTING chain.

the edonkey server is behind the firewall

210.54.175.12--->eth0 (Router) 10.0.0.6(eth1)--->10.0.0.x

iptables -t nat -A PREROUTING -p tcp -i eth0 -d 210.54.175.12 --dport 4662 -j DNAT --to 10.0.0.6:4662 iptables -A FORWARD -p tcp -i eth0 -d 10.0.0.6 --dport 4662 -j ACCEPT

like that?

author
#5 lore raw
In reply to Rob Sterenborg
Quoted 8 lines · Rob Sterenborg
Quoted 7 lines

ok, telnet from another machine to the router.

telnet 10.0.0.6 4662
Trying 10.0.0.6...
telnet: Unable to connect to remote host: Connection refused

what "service" should I be running? I simply want 4662 open both ways.

Quoted 7 lines
# netstat -an|grep 4662
should tell you if your box is listening at all on port 4662.

If you run eDonkey server on the firewall box, open port in the INPUT chain.
If your eDonkey server is *behind* the firewall, open the port in the FORWARD chain, and add a DNAT rule in the nat table -> PREROUTING chain.

the edonkey server is behind the firewall

210.54.175.12--->eth0 (Router) 10.0.0.6(eth1)--->10.0.0.x

iptables -t nat -A PREROUTING -p tcp -i eth0 -d 210.54.175.12 --dport 4662 -j DNAT --to 10.0.0.6:4662 iptables -A FORWARD -p tcp -i eth0 -d 10.0.0.6 --dport 4662 -j ACCEPT

like that?

#6 lore raw
Quoted 17 lines · mdew
Quoted 8 lines · Rob Sterenborg
Quoted 7 lines

ok, telnet from another machine to the router.

telnet 10.0.0.6 4662
Trying 10.0.0.6...
telnet: Unable to connect to remote host: Connection refused

what "service" should I be running? I simply want 4662 open both ways.

Quoted 7 lines
# netstat -an|grep 4662
should tell you if your box is listening at all on port 4662.

If you run eDonkey server on the firewall box, open port in the INPUT chain.
If your eDonkey server is *behind* the firewall, open the port in the FORWARD chain, and add a DNAT rule in the nat table -> PREROUTING chain.

Quoted 6 lines

the edonkey server is behind the firewall

210.54.175.12--->eth0 (Router) 10.0.0.6(eth1)--->10.0.0.x

iptables -t nat -A PREROUTING -p tcp -i eth0 -d 210.54.175.12 --dport 4662 -j DNAT --to 10.0.0.6:4662

This should work without the last rule.

iptables -A FORWARD -p tcp -i eth0 -d 10.0.0.6 --dport 4662 -j ACCEPT

Quoted 5 lines

like that?

Signature · 2 lines
Dharmendra.T
Linux Enthu
author
#7 lore raw
Quoted 20 lines · Dharmendra.T
Quoted 19 lines · mdew
Quoted 8 lines · Rob Sterenborg
Quoted 7 lines

ok, telnet from another machine to the router.

telnet 10.0.0.6 4662
Trying 10.0.0.6...
telnet: Unable to connect to remote host: Connection refused

what "service" should I be running? I simply want 4662 open both ways.

Quoted 7 lines
# netstat -an|grep 4662
should tell you if your box is listening at all on port 4662.

If you run eDonkey server on the firewall box, open port in the INPUT chain.
If your eDonkey server is *behind* the firewall, open the port in the FORWARD chain, and add a DNAT rule in the nat table -> PREROUTING chain.

the edonkey server is behind the firewall

Quoted 10 lines
Quoted 4 lines

210.54.175.12--->eth0 (Router) 10.0.0.6(eth1)--->10.0.0.x

iptables -t nat -A PREROUTING -p tcp -i eth0 -d 210.54.175.12 --dport 4662 -j DNAT --to 10.0.0.6:4662

This should work without the last rule.

iptables -A FORWARD -p tcp -i eth0 -d 10.0.0.6 --dport 4662 -j ACCEPT

Quoted 2 lines

like that?

the router isnt picking this up..

mdew:~# iptables -t nat -A PREROUTING -p tcp -i eth0 -d 210.54.175.12
--dport 4662 -j DNAT --to 10.0.0.6:4662
mdew:~# iptables -A FORWARD -p tcp -i eth0 -d 10.0.0.6 --dport 4662 -j
ACCEPT
mdew:~# netstat -an|grep 4662
mdew:~#
mdew@nirvana:~$ nmap 10.0.0.6

Starting nmap V. 3.10ALPHA4 ( www.insecure.org/nmap/ ) Interesting ports on debian (10.0.0.6):
(The 1598 ports scanned but not shown below are in state: closed)

Port       State       Service
22/tcp     open        ssh
25/tcp     open        smtp
110/tcp    open        pop-3
113/tcp    open        auth
135/tcp    filtered    loc-srv
139/tcp    filtered    netbios-ssn
8080/tcp   open        http-proxy

Nmap run completed -- 1 IP address (1 host up) scanned in 2.545 seconds

#8 lore raw
Quoted 55 lines · mdew
Quoted 20 lines · Dharmendra.T
Quoted 19 lines · mdew
Quoted 8 lines · Rob Sterenborg
Quoted 7 lines

ok, telnet from another machine to the router.

telnet 10.0.0.6 4662
Trying 10.0.0.6...
telnet: Unable to connect to remote host: Connection refused

what "service" should I be running? I simply want 4662 open both ways.

Quoted 7 lines
# netstat -an|grep 4662
should tell you if your box is listening at all on port 4662.

If you run eDonkey server on the firewall box, open port in the INPUT chain.
If your eDonkey server is *behind* the firewall, open the port in the FORWARD chain, and add a DNAT rule in the nat table -> PREROUTING chain.

the edonkey server is behind the firewall

Quoted 10 lines
Quoted 4 lines

210.54.175.12--->eth0 (Router) 10.0.0.6(eth1)--->10.0.0.x

iptables -t nat -A PREROUTING -p tcp -i eth0 -d 210.54.175.12 --dport 4662 -j DNAT --to 10.0.0.6:4662

This should work without the last rule.

iptables -A FORWARD -p tcp -i eth0 -d 10.0.0.6 --dport 4662 -j ACCEPT

Quoted 2 lines

like that?

the router isnt picking this up..

mdew:~# iptables -t nat -A PREROUTING -p tcp -i eth0 -d 210.54.175.12
--dport 4662 -j DNAT --to 10.0.0.6:4662
mdew:~# iptables -A FORWARD -p tcp -i eth0 -d 10.0.0.6 --dport 4662 -j
ACCEPT
mdew:~# netstat -an|grep 4662
mdew:~#
mdew@nirvana:~$ nmap 10.0.0.6

Starting nmap V. 3.10ALPHA4 ( www.insecure.org/nmap/ ) Interesting ports on debian (10.0.0.6):
(The 1598 ports scanned but not shown below are in state: closed)

Port       State       Service
22/tcp     open        ssh
25/tcp     open        smtp
110/tcp    open        pop-3
113/tcp    open        auth
135/tcp    filtered    loc-srv
139/tcp    filtered    netbios-ssn
8080/tcp   open        http-proxy
Quoted 3 lines

Nmap run completed -- 1 IP address (1 host up) scanned in 2.545 seconds

Quoted 1 line

As said you are not running any service on that port so the port is not listening, Try the rules by listening a port using nc(netcat)

# nc -l -p 4662

And then run nmap. You should get listed this port!

Signature · 2 lines
Dharmendra.T
Linux Enthu
author
#9 lore raw
Quoted 60 lines · Dharmendra.T
Quoted 55 lines · mdew
Quoted 20 lines · Dharmendra.T
Quoted 19 lines · mdew
Quoted 8 lines · Rob Sterenborg
Quoted 7 lines

ok, telnet from another machine to the router.

telnet 10.0.0.6 4662
Trying 10.0.0.6...
telnet: Unable to connect to remote host: Connection refused

what "service" should I be running? I simply want 4662 open both ways.

Quoted 7 lines
# netstat -an|grep 4662
should tell you if your box is listening at all on port 4662.

If you run eDonkey server on the firewall box, open port in the INPUT chain.
If your eDonkey server is *behind* the firewall, open the port in the FORWARD chain, and add a DNAT rule in the nat table -> PREROUTING chain.

the edonkey server is behind the firewall

Quoted 10 lines
Quoted 4 lines

210.54.175.12--->eth0 (Router) 10.0.0.6(eth1)--->10.0.0.x

iptables -t nat -A PREROUTING -p tcp -i eth0 -d 210.54.175.12 --dport 4662 -j DNAT --to 10.0.0.6:4662

This should work without the last rule.

iptables -A FORWARD -p tcp -i eth0 -d 10.0.0.6 --dport 4662 -j ACCEPT

Quoted 2 lines

like that?

the router isnt picking this up..

mdew:~# iptables -t nat -A PREROUTING -p tcp -i eth0 -d 210.54.175.12
--dport 4662 -j DNAT --to 10.0.0.6:4662
mdew:~# iptables -A FORWARD -p tcp -i eth0 -d 10.0.0.6 --dport 4662 -j
ACCEPT
mdew:~# netstat -an|grep 4662
mdew:~#
mdew@nirvana:~$ nmap 10.0.0.6

Starting nmap V. 3.10ALPHA4 ( www.insecure.org/nmap/ ) Interesting ports on debian (10.0.0.6):
(The 1598 ports scanned but not shown below are in state: closed)

Port       State       Service
22/tcp     open        ssh
25/tcp     open        smtp
110/tcp    open        pop-3
113/tcp    open        auth
135/tcp    filtered    loc-srv
139/tcp    filtered    netbios-ssn
8080/tcp   open        http-proxy
Quoted 3 lines

Nmap run completed -- 1 IP address (1 host up) scanned in 2.545 seconds

Quoted 1 line
Quoted 10 lines

As said you are not running any service on that port so the port is not listening, Try the rules by listening a port using nc(netcat)

# nc -l -p 4662

And then run nmap. You should get listed this port!

Signature · 2 lines
Dharmendra.T
Linux Enthu
mdew:~# nc -l -p 4662
ãP<H¹ogÝT'b´\Y6▒http://emule-project.net<6Ñ~ÖEmdew:~#

(some strange characters, then it quits)

mdew:~# netstat -an|grep 4662
mdew:~#
nirvana:/home/mdew# nmap 10.0.0.6

Starting nmap V. 3.10ALPHA4 ( www.insecure.org/nmap/ ) Interesting ports on debian (10.0.0.6):
(The 1591 ports scanned but not shown below are in state: closed)

Port       State       Service
22/tcp     open        ssh
25/tcp     open        smtp
110/tcp    open        pop-3
111/tcp    filtered    sunrpc
113/tcp    open        auth
135/tcp    filtered    loc-srv
136/tcp    filtered    profile
137/tcp    filtered    netbios-ns
138/tcp    filtered    netbios-dgm
139/tcp    filtered    netbios-ssn
199/tcp    filtered    smux
826/tcp    filtered    unknown
953/tcp    filtered    rndc
8080/tcp   open        http-proxy
#10 lore raw
Quoted 22 lines
Quoted 8 lines
# nc -l -p 4662

And then run nmap. You should get listed this port!

Signature · 2 lines
Dharmendra.T
Linux Enthu
mdew:~# nc -l -p 4662
ãP<H¹ogÝT'b´\Y6▒http://emule-project.net<6Ñ~ÖEmdew:~#

(some strange characters, then it quits)

mdew:~# netstat -an|grep 4662
mdew:~#
nirvana:/home/mdew# nmap 10.0.0.6

Starting nmap V. 3.10ALPHA4 ( www.insecure.org/nmap/ ) Interesting ports on debian (10.0.0.6):
(The 1591 ports scanned but not shown below are in state: closed)

Quoted 19 lines
Port       State       Service
22/tcp     open        ssh
25/tcp     open        smtp
110/tcp    open        pop-3
111/tcp    filtered    sunrpc
113/tcp    open        auth
135/tcp    filtered    loc-srv
136/tcp    filtered    profile
137/tcp    filtered    netbios-ns
138/tcp    filtered    netbios-dgm
139/tcp    filtered    netbios-ssn
199/tcp    filtered    smux
826/tcp    filtered    unknown
953/tcp    filtered    rndc
8080/tcp   open        http-proxy

nc, I mean to say netcat.?

Signature · 2 lines
Dharmendra.T
Linux Enthu
author
#11 lore raw
Quoted 42 lines · Dharmendra.T
Quoted 22 lines
Quoted 8 lines
# nc -l -p 4662

And then run nmap. You should get listed this port!

Signature · 2 lines
Dharmendra.T
Linux Enthu
mdew:~# nc -l -p 4662
ãP<H¹ogÝT'b´\Y6▒http://emule-project.net<6Ñ~ÖEmdew:~#

(some strange characters, then it quits)

mdew:~# netstat -an|grep 4662
mdew:~#
nirvana:/home/mdew# nmap 10.0.0.6

Starting nmap V. 3.10ALPHA4 ( www.insecure.org/nmap/ ) Interesting ports on debian (10.0.0.6):
(The 1591 ports scanned but not shown below are in state: closed)

Quoted 19 lines
Port       State       Service
22/tcp     open        ssh
25/tcp     open        smtp
110/tcp    open        pop-3
111/tcp    filtered    sunrpc
113/tcp    open        auth
135/tcp    filtered    loc-srv
136/tcp    filtered    profile
137/tcp    filtered    netbios-ns
138/tcp    filtered    netbios-dgm
139/tcp    filtered    netbios-ssn
199/tcp    filtered    smux
826/tcp    filtered    unknown
953/tcp    filtered    rndc
8080/tcp   open        http-proxy
Quoted 1 line

nc, I mean to say netcat.?

it was netcat

apt-get install netcat

#12 lore raw
Quoted 15 lines · mdew
Quoted 12 lines · Dharmendra.T
Quoted 12 lines
Quoted 9 lines
# nc -l -p 4662

And then run nmap. You should get listed this port!

Signature · 2 lines
Dharmendra.T
Linux Enthu
mdew:~# nc -l -p 4662
ãP<H¹ogÝT'b´\Y6▒http://emule-project.net<6Ñ~ÖEmdew:~#
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

(some strange characters, then it quits)

mdew:~# netstat -an|grep 4662
mdew:~#
nirvana:/home/mdew# nmap 10.0.0.6

nmap -p4662 10.0.0.6
Should work better.
and a new version of nmap should work better, too.
I heard that when you use nmap as your way it picks just well known ports (/etc/service file ?) and then you won´t get this special port if its not in there.(Maybe I´m wrong)

Quoted 37 lines
Quoted 24 lines
Quoted 24 lines

Starting nmap V. 3.10ALPHA4 ( www.insecure.org/nmap/ ) Interesting ports on debian (10.0.0.6):
(The 1591 ports scanned but not shown below are in state: closed)

Port       State       Service
22/tcp     open        ssh
25/tcp     open        smtp
110/tcp    open        pop-3
111/tcp    filtered    sunrpc
113/tcp    open        auth
135/tcp    filtered    loc-srv
136/tcp    filtered    profile
137/tcp    filtered    netbios-ns
138/tcp    filtered    netbios-dgm
139/tcp    filtered    netbios-ssn
199/tcp    filtered    smux
826/tcp    filtered    unknown
953/tcp    filtered    rndc
8080/tcp   open        http-proxy
Quoted 3 lines

nc, I mean to say netcat.?

it was netcat

apt-get install netcat

author
#13 lore raw
Quoted 21 lines · Jörg Esser
Quoted 17 lines · mdew
Quoted 14 lines · Dharmendra.T
Quoted 14 lines
Quoted 9 lines
# nc -l -p 4662

And then run nmap. You should get listed this port!

Signature · 2 lines
Dharmendra.T
Linux Enthu
mdew:~# nc -l -p 4662
ãP<H¹ogÝT'b´\Y6▒http://emule-project.net<6Ñ~ÖEmdew:~#

(some strange characters, then it quits)

Quoted 7 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
mdew:~# netstat -an|grep 4662
mdew:~#
nirvana:/home/mdew# nmap 10.0.0.6

nmap -p4662 10.0.0.6

hmm
with all the changes it still cant see it

nirvana:/home/mdew# nmap -p4662 10.0.0.6

Starting nmap V. 3.10ALPHA4 ( www.insecure.org/nmap/ ) The 1 scanned port on debian (10.0.0.6) is: closed

Nmap run completed -- 1 IP address (1 host up) scanned in 0.319 seconds

Quoted 46 lines

Should work better.
and a new version of nmap should work better, too.
I heard that when you use nmap as your way it picks just well known ports (/etc/service file ?) and then you won´t get this special port if its not in there.(Maybe I´m wrong)

Quoted 37 lines
Quoted 24 lines
Quoted 24 lines

Starting nmap V. 3.10ALPHA4 ( www.insecure.org/nmap/ ) Interesting ports on debian (10.0.0.6):
(The 1591 ports scanned but not shown below are in state: closed)

Port       State       Service
22/tcp     open        ssh
25/tcp     open        smtp
110/tcp    open        pop-3
111/tcp    filtered    sunrpc
113/tcp    open        auth
135/tcp    filtered    loc-srv
136/tcp    filtered    profile
137/tcp    filtered    netbios-ns
138/tcp    filtered    netbios-dgm
139/tcp    filtered    netbios-ssn
199/tcp    filtered    smux
826/tcp    filtered    unknown
953/tcp    filtered    rndc
8080/tcp   open        http-proxy
Quoted 3 lines

nc, I mean to say netcat.?

it was netcat

apt-get install netcat

Chain INPUT (policy ACCEPT)

target     prot opt source               destination
ACCEPT     tcp  --  anywhere             anywhere           tcp dpt:pop3
ACCEPT     udp  --  anywhere             anywhere           udp dpt:pop3
ACCEPT     udp  --  anywhere             anywhere           udp dpt:pop3
ACCEPT     tcp  --  anywhere             anywhere           tcp dpt:pop3
ACCEPT     tcp  --  anywhere             anywhere           tcp dpt:smtp
ACCEPT     tcp  --  anywhere             anywhere           tcp dpt:ssmtp
REJECT     tcp  --  anywhere             anywhere           tcp dpts:135:netbios-ssn reject-with icmp-port-unreachable
REJECT     udp  --  anywhere             anywhere           udp dpts:135:netbios-ssn reject-with icmp-port-unreachable
REJECT     tcp  --  anywhere             anywhere           tcp spts:135:netbios-ssn reject-with icmp-port-unreachable
REJECT     udp  --  anywhere             anywhere           udp spts:135:netbios-ssn reject-with icmp-port-unreachable
REJECT     tcp  --  anywhere             anywhere           tcp dpts:135:netbios-ssn reject-with icmp-port-unreachable
REJECT     udp  --  anywhere             anywhere           udp dpts:135:netbios-ssn reject-with icmp-port-unreachable
REJECT     tcp  --  anywhere             anywhere           tcp spts:135:netbios-ssn reject-with icmp-port-unreachable
REJECT     udp  --  anywhere             anywhere           udp spts:135:netbios-ssn reject-with icmp-port-unreachable
ACCEPT     tcp  --  anywhere             anywhere           tcp dpt:auth
ACCEPT     tcp  --  anywhere             anywhere           tcp dpt:auth
ACCEPT     tcp  --  anywhere             anywhere           tcp spt:auth
ACCEPT     tcp  --  anywhere             anywhere           tcp spt:auth
ACCEPT     tcp  --  anywhere             anywhere           tcp dpt:domain
ACCEPT     tcp  --  anywhere             anywhere           tcp dpt:domain
ACCEPT     tcp  --  anywhere             anywhere           tcp spt:domain
ACCEPT     tcp  --  anywhere             anywhere           tcp spt:domain
ACCEPT     udp  --  anywhere             anywhere           udp dpt:domain
ACCEPT     udp  --  anywhere             anywhere           udp dpt:domain
ACCEPT     udp  --  anywhere             anywhere           udp spt:domain
ACCEPT     udp  --  anywhere             anywhere           udp spt:domain
ACCEPT     tcp  --  anywhere             anywhere           tcp dpt:4661
ACCEPT     udp  --  anywhere             anywhere           udp dpt:4661
ACCEPT     udp  --  anywhere             anywhere           udp dpt:4661
ACCEPT     tcp  --  anywhere             anywhere           tcp dpt:4661
ACCEPT     tcp  --  anywhere             anywhere           tcp spt:4661
ACCEPT     udp  --  anywhere             anywhere           udp spt:4661
ACCEPT     udp  --  anywhere             anywhere           udp spt:4661
ACCEPT     tcp  --  anywhere             anywhere           tcp spt:4661
ACCEPT     tcp  --  anywhere             anywhere           tcp dpt:4662
ACCEPT     udp  --  anywhere             anywhere           udp dpt:4662
ACCEPT     udp  --  anywhere             anywhere           udp dpt:4662
ACCEPT     tcp  --  anywhere             anywhere           tcp dpt:4662
ACCEPT     tcp  --  anywhere             anywhere           tcp spt:4662
ACCEPT     udp  --  anywhere             anywhere           udp spt:4662
ACCEPT     udp  --  anywhere             anywhere           udp spt:4662
ACCEPT     tcp  --  anywhere             anywhere           tcp spt:4662
ACCEPT     tcp  --  anywhere             anywhere           tcp dpt:4665
ACCEPT     udp  --  anywhere             anywhere           udp dpt:4665
ACCEPT     udp  --  anywhere             anywhere           udp dpt:4665
ACCEPT     tcp  --  anywhere             anywhere           tcp dpt:4665
ACCEPT     tcp  --  anywhere             anywhere           tcp spt:4665
ACCEPT     udp  --  anywhere             anywhere           udp spt:4665
ACCEPT     udp  --  anywhere             anywhere           udp spt:4665
ACCEPT     tcp  --  anywhere             anywhere           tcp spt:4665
REJECT     tcp  --  anywhere             anywhere           tcp dpt:111 reject-with icmp-port-unreachable
REJECT     tcp  --  anywhere             anywhere           tcp dpt:smux reject-with icmp-port-unreachable
REJECT     tcp  --  anywhere             anywhere           tcp dpt:826 reject-with icmp-port-unreachable
REJECT     tcp  --  anywhere             anywhere           tcp dpt:953 reject-with icmp-port-unreachable
REJECT     tcp  --  anywhere             anywhere           tcp dpt:111 reject-with icmp-port-unreachable
REJECT     tcp  --  anywhere             anywhere           tcp dpt:smux reject-with icmp-port-unreachable
REJECT     tcp  --  anywhere             anywhere           tcp dpt:826 reject-with icmp-port-unreachable
REJECT     tcp  --  anywhere             anywhere           tcp dpt:953 reject-with icmp-port-unreachable

Chain FORWARD (policy ACCEPT)

target     prot opt source               destination
REJECT     tcp  --  anywhere             anywhere           tcp dpts:netbios-ns:netbios-ssn reject-with icmp-port-unreachable
REJECT     udp  --  anywhere             anywhere           udp dpts:netbios-ns:netbios-ssn reject-with icmp-port-unreachable
REJECT     tcp  --  anywhere             anywhere           tcp spts:netbios-ns:netbios-ssn reject-with icmp-port-unreachable
REJECT     udp  --  anywhere             anywhere           udp spts:netbios-ns:netbios-ssn reject-with icmp-port-unreachable
REJECT     tcp  --  anywhere             anywhere           tcp dpts:135:netbios-ssn reject-with icmp-port-unreachable
REJECT     udp  --  anywhere             anywhere           udp dpts:135:netbios-ssn reject-with icmp-port-unreachable
REJECT     tcp  --  anywhere             anywhere           tcp spts:135:netbios-ssn reject-with icmp-port-unreachable
REJECT     udp  --  anywhere             anywhere           udp spts:135:netbios-ssn reject-with icmp-port-unreachable
REJECT     tcp  --  anywhere             anywhere           tcp dpts:135:netbios-ssn reject-with icmp-port-unreachable
REJECT     tcp  --  anywhere             anywhere           tcp spts:135:netbios-ssn reject-with icmp-port-unreachable
REJECT     udp  --  anywhere             anywhere           udp spts:135:netbios-ssn reject-with icmp-port-unreachable
REJECT     udp  --  anywhere             anywhere           udp dpts:135:netbios-ssn reject-with icmp-port-unreachable
ACCEPT     tcp  --  anywhere             anywhere           tcp dpt:auth
ACCEPT     tcp  --  anywhere             anywhere           tcp spt:auth
ACCEPT     tcp  --  anywhere             anywhere           tcp dpt:auth
ACCEPT     tcp  --  anywhere             anywhere           tcp spt:auth
ACCEPT     tcp  --  anywhere             anywhere           tcp dpt:auth
ACCEPT     tcp  --  anywhere             anywhere           tcp dpt:auth
ACCEPT     tcp  --  anywhere             anywhere           tcp dpt:auth
ACCEPT     tcp  --  anywhere             anywhere           tcp dpt:auth
ACCEPT     tcp  --  anywhere             anywhere           tcp dpt:domain
ACCEPT     tcp  --  anywhere             anywhere           tcp spt:domain
ACCEPT     tcp  --  anywhere             anywhere           tcp dpt:domain
ACCEPT     tcp  --  anywhere             anywhere           tcp spt:domain
ACCEPT     tcp  --  paul.                anywhere           tcp dpt:4665 limit: avg 1/hour burst 5
ACCEPT     udp  --  paul.                anywhere           udp dpt:4665 limit: avg 1/hour burst 5
ACCEPT     udp  --  paul.                anywhere           udp spt:4665 limit: avg 1/hour burst 5
ACCEPT     tcp  --  paul.                anywhere           tcp spt:4665 limit: avg 1/hour burst 5
ACCEPT     tcp  --  anywhere             anywhere           tcp dpt:4661
ACCEPT     tcp  --  anywhere             anywhere           tcp dpt:4661
ACCEPT     udp  --  anywhere             anywhere           udp dpt:4661
ACCEPT     udp  --  anywhere             anywhere           udp dpt:4661
ACCEPT     udp  --  anywhere             anywhere           udp spt:4661
ACCEPT     udp  --  anywhere             anywhere           udp spt:4661
ACCEPT     tcp  --  anywhere             anywhere           tcp spt:4661
ACCEPT     tcp  --  anywhere             anywhere           tcp spt:4661
ACCEPT     tcp  --  anywhere             anywhere           tcp dpt:4662
ACCEPT     tcp  --  anywhere             anywhere           tcp dpt:4662
ACCEPT     udp  --  anywhere             anywhere           udp dpt:4662
ACCEPT     udp  --  anywhere             anywhere           udp dpt:4662
ACCEPT     udp  --  anywhere             anywhere           udp spt:4662
ACCEPT     udp  --  anywhere             anywhere           udp spt:4662
ACCEPT     tcp  --  anywhere             anywhere           tcp spt:4662
ACCEPT     tcp  --  anywhere             anywhere           tcp spt:4662
ACCEPT     tcp  --  anywhere             anywhere           tcp dpt:4665
ACCEPT     tcp  --  anywhere             anywhere           tcp dpt:4665
ACCEPT     udp  --  anywhere             anywhere           udp dpt:4665
ACCEPT     udp  --  anywhere             anywhere           udp dpt:4665
ACCEPT     udp  --  anywhere             anywhere           udp spt:4665
ACCEPT     udp  --  anywhere             anywhere           udp spt:4665
ACCEPT     tcp  --  anywhere             anywhere           tcp spt:4665
ACCEPT     tcp  --  anywhere             anywhere           tcp spt:4665
REJECT     tcp  --  anywhere             anywhere           tcp dpt:111 reject-with icmp-port-unreachable
REJECT     tcp  --  anywhere             anywhere           tcp dpt:smux reject-with icmp-port-unreachable
REJECT     tcp  --  anywhere             anywhere           tcp dpt:826 reject-with icmp-port-unreachable
REJECT     tcp  --  anywhere             anywhere           tcp dpt:953 reject-with icmp-port-unreachable
REJECT     tcp  --  anywhere             anywhere           tcp dpt:111 reject-with icmp-port-unreachable
REJECT     tcp  --  anywhere             anywhere           tcp dpt:smux reject-with icmp-port-unreachable
REJECT     tcp  --  anywhere             anywhere           tcp dpt:826 reject-with icmp-port-unreachable
REJECT     tcp  --  anywhere             anywhere           tcp dpt:953 reject-with icmp-port-unreachable
ACCEPT     tcp  --  anywhere             10.0.0.6           tcp dpt:4662
Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
REJECT     tcp  --  anywhere             anywhere           tcp dpts:135:netbios-ssn reject-with icmp-port-unreachable
REJECT     udp  --  anywhere             anywhere           udp dpts:135:netbios-ssn reject-with icmp-port-unreachable
REJECT     tcp  --  anywhere             anywhere           tcp spts:135:netbios-ssn reject-with icmp-port-unreachable
REJECT     udp  --  anywhere             anywhere           udp spts:135:netbios-ssn reject-with icmp-port-unreachable
REJECT     tcp  --  anywhere             anywhere           tcp dpts:135:netbios-ssn reject-with icmp-port-unreachable
REJECT     udp  --  anywhere             anywhere           udp dpts:135:netbios-ssn reject-with icmp-port-unreachable
REJECT     tcp  --  anywhere             anywhere           tcp spts:135:netbios-ssn reject-with icmp-port-unreachable
REJECT     udp  --  anywhere             anywhere           udp spts:135:netbios-ssn reject-w
#14 lore raw
In reply to mdew

it was netcat

Quoted 4 lines

apt-get install netcat

try with netcat and let us know.

Signature · 2 lines
Dharmendra.T
Linux Enthu
author
#15 lore raw
Quoted 11 lines · Dharmendra.T

it was netcat

Quoted 4 lines

apt-get install netcat

try with netcat and let us know.

Signature · 2 lines
Dharmendra.T
Linux Enthu
mdew:/bin# ls -al netcat
lrwxrwxrwx    1 root     root            2 Jan  9 19:34 netcat -> nc
mdew:~# netcat -help
[v1.10]
connect to somewhere:   nc [-options] hostname port[s] [ports] ...
listen for inbound:     nc -l -p port [-options] [hostname] [port]
options:
        -e prog                 program to exec after connect
[dangerous!!]
        -b                      allow broadcasts
        -g gateway              source-routing hop point[s], up to 8
        -G num                  source-routing pointer: 4, 8, 12, ...
        -h                      this cruft
        -i secs                 delay interval for lines sent, ports
scanned
        -l                      listen mode, for inbound connects
        -n                      numeric-only IP addresses, no DNS
        -o file                 hex dump of traffic
        -p port                 local port number
        -r                      randomize local and remote ports
        -q secs                 quit after EOF on stdin and delay of
secs
        -s addr                 local source address
        -t                      answer TELNET negotiation
        -u                      UDP mode
        -v                      verbose [use twice to be more verbose]
        -w secs                 timeout for connects and final net reads
        -z                      zero-I/O mode [used for scanning]
port numbers can be individual or ranges: lo-hi [inclusive]
mdew:~# netcat -p 4662
no destination
mdew:~# nc -l -p 4662
ã;ãÛûÇΨºUû×JüGâ°ødfg<øÁoÆmdew:~# netcat
Cmd line:
mdew:~# netcat -l -p 4662
ã;ãÛûÇΨºUû×JüGâ°ødfg<øÁoÆmdew:~# netcat -l -p 4662
ãP<H¹ogÝT'␉´\¾ä6▒http://emule-project.net<6ÁoÆmdew:~#
#16 lore raw
Quoted 8 lines · mdew
mdew:~# netcat -p 4662
no destination
mdew:~# nc -l -p 4662
??;??????????????U????J??G??????dfg<????o??mdew:~# netcat
Cmd line:
mdew:~# netcat -l -p 4662
??;??????????????U????J??G??????dfg<????o??mdew:~# netcat -l -p 4662
??P<H??og??T'?????\????6???http://emule-project.net<6??o??mdew:~#

I suspect you'll find that's other eDonkey clients connecting to the
netcat ;). Why not just make SURE you're running the client for testing this? You'll know when it's working as the eDonkey client will have clients connecting.

-Ath

Signature · 4 lines
- Athanasius = Athanasius(at)miggy.org / http://www.miggy.org/
                  Finger athan(at)fysh.org for PGP key
	   "And it's me who is my enemy. Me who beats me up.
Me who makes the monsters. Me who strips my confidence." Paula Cole - ME
#17 lore raw
In reply to mdew
Quoted 13 lines
Quoted 4 lines
# netstat -an|grep 4662
should tell you if your box is listening at all on port 4662.

If you run eDonkey server on the firewall box, open port in

the INPUT

Quoted 2 lines

chain.
If your eDonkey server is *behind* the firewall, open the

port in the

Quoted 1 line

FORWARD chain, and add a DNAT rule in the nat table ->

PREROUTING chain.

the edonkey server is behind the firewall

Quoted 7 lines

210.54.175.12--->eth0 (Router) 10.0.0.6(eth1)--->10.0.0.x

iptables -t nat -A PREROUTING -p tcp -i eth0 -d 210.54.175.12 --dport 4662 -j DNAT --to 10.0.0.6:4662
iptables -A FORWARD -p tcp -i eth0 -d 10.0.0.6 --dport 4662 -j ACCEPT

like that?

If default policy for FORWARD is ACCEPT then it should work without the FORWARD, else you need it.

For me such a setup works.

If you do a netstat -an on the eDonkey box (you don't need netcat to do that) and it doesn't report 4662 then eDonkey is not running/listening and you can never connect.

About opening ports for eDonkey, from the eDonkey website :
(http://www.edonkey2000.com/documentation/index.html)
====
2. Software Firewall
If you are running software like Norton Personal Firewall, Tiny Firewall, Zone Alarm, BlackIce or <...snip...> Alternatively, with some more advanced firewalls, or firewall settings you will need to open ports 4661 and 4662 TCP for both incoming and out going connections, as well as port 4665 UDP for both incoming and outgoing connections.

3. Hardware firewall
Setting up your hardware firewall is a tad more difficult, but if you have one chances are you know what your doing. You will need to set it to allow both incoming and outgoing connections on 4661 & 4662 TCP and port 4665 UDP.
====
So you need to open more ports than just 4662/tcp I think. And IMHO you want a statefull packetfilter, if you haven't made it already statefull.
(iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT)

Rob

author
#18 lore raw
Quoted 53 lines · Rob Sterenborg
Quoted 13 lines
Quoted 4 lines
# netstat -an|grep 4662
should tell you if your box is listening at all on port 4662.

If you run eDonkey server on the firewall box, open port in

the INPUT

Quoted 2 lines

chain.
If your eDonkey server is *behind* the firewall, open the

port in the

Quoted 1 line

FORWARD chain, and add a DNAT rule in the nat table ->

PREROUTING chain.

the edonkey server is behind the firewall

Quoted 7 lines

210.54.175.12--->eth0 (Router) 10.0.0.6(eth1)--->10.0.0.x

iptables -t nat -A PREROUTING -p tcp -i eth0 -d 210.54.175.12 --dport 4662 -j DNAT --to 10.0.0.6:4662
iptables -A FORWARD -p tcp -i eth0 -d 10.0.0.6 --dport 4662 -j ACCEPT

like that?

If default policy for FORWARD is ACCEPT then it should work without the FORWARD, else you need it.

For me such a setup works.

If you do a netstat -an on the eDonkey box (you don't need netcat to do that) and it doesn't report 4662 then eDonkey is not running/listening and you can never connect.

About opening ports for eDonkey, from the eDonkey website :
(http://www.edonkey2000.com/documentation/index.html)
====
2. Software Firewall
If you are running software like Norton Personal Firewall, Tiny Firewall, Zone Alarm, BlackIce or <...snip...> Alternatively, with some more advanced firewalls, or firewall settings you will need to open ports 4661 and 4662 TCP for both incoming and out going connections, as well as port 4665 UDP for both incoming and outgoing connections.

3. Hardware firewall
Setting up your hardware firewall is a tad more difficult, but if you have one chances are you know what your doing. You will need to set it to allow both incoming and outgoing connections on 4661 & 4662 TCP and port 4665 UDP.
====
So you need to open more ports than just 4662/tcp I think. And IMHO you want a statefull packetfilter, if you haven't made it already statefull.
(iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT)

Quoted 3 lines

Rob

ok heres my current script, yes its inefficient, but thats not the major problem.. 4662 port :/ I relise that theres more ports available for edonkey to use, but opening ONE port would be a start.

i added "iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT" without anything happening...

/sbin/modprobe ip_conntrack_ftp
/sbin/modprobe ip_conntrack_irc
/sbin/modprobe ip_nat_irc
/sbin/modprobe ip_nat_ftp

# <<<<< COMPLETE-BLOCKAGE SMB/Samba Traffic >>>>>

iptables -A FORWARD -o eth1 -p tcp --dport 135:139 -j REJECT iptables -A FORWARD -o eth1 -p udp --dport 135:139 -j REJECT iptables -A FORWARD -o eth1 -p tcp --sport 135:139 -j REJECT iptables -A FORWARD -o eth1 -p udp --sport 135:139 -j REJECT

iptables -A FORWARD -o eth0 -p tcp --dport 135:139 -j REJECT iptables -A FORWARD -o eth0 -p tcp --sport 135:139 -j REJECT iptables -A FORWARD -o eth0 -p udp --sport 135:139 -j REJECT iptables -A FORWARD -o eth0 -p udp --dport 135:139 -j REJECT iptables -A INPUT -i eth0 -p tcp --dport 135:139 -j REJECT iptables -A INPUT -i eth0 -p udp --dport 135:139 -j REJECT iptables -A INPUT -i eth0 -p tcp --sport 135:139 -j REJECT iptables -A INPUT -i eth0 -p udp --sport 135:139 -j REJECT

iptables -A INPUT -i eth1 -p tcp --dport 135:139 -j REJECT iptables -A INPUT -i eth1 -p udp --dport 135:139 -j REJECT iptables -A INPUT -i eth1 -p tcp --sport 135:139 -j REJECT iptables -A INPUT -i eth1 -p udp --sport 135:139 -j REJECT

iptables -A OUTPUT -o eth0 -p tcp --dport 135:139 -j REJECT iptables -A OUTPUT -o eth0 -p udp --dport 135:139 -j REJECT iptables -A OUTPUT -o eth0 -p tcp --sport 135:139 -j REJECT iptables -A OUTPUT -o eth0 -p udp --sport 135:139 -j REJECT

iptables -A OUTPUT -o eth1 -p tcp --dport 135:139 -j REJECT iptables -A OUTPUT -o eth1 -p udp --dport 135:139 -j REJECT iptables -A OUTPUT -o eth1 -p tcp --sport 135:139 -j REJECT

iptables -A OUTPUT -o eth1 -p udp --sport 135:139 -j REJECT

iptables -A INPUT -i eth0 -p tcp --dport 113 -j ACCEPT iptables -A INPUT -i eth1 -p tcp --dport 113 -j ACCEPT iptables -A INPUT -i eth0 -p tcp --sport 113 -j ACCEPT iptables -A INPUT -i eth1 -p tcp --sport 113 -j ACCEPT

iptables -A FORWARD -p tcp --dport auth -i eth0 -j ACCEPT iptables -A FORWARD -p tcp --sport auth -i eth0 -j ACCEPT

iptables -A FORWARD -p tcp --dport auth -i eth1 -j ACCEPT iptables -A FORWARD -p tcp --sport auth -i eth1 -j ACCEPT

iptables -A FORWARD -o eth0 -p tcp --dport 113 -j ACCEPT iptables -A FORWARD -o eth1 -p tcp --dport 113 -j ACCEPT iptables -A FORWARD -i eth0 -p tcp --dport 113 -j ACCEPT iptables -A FORWARD -i eth1 -p tcp --dport 113 -j ACCEPT

iptables -A FORWARD -p tcp -s 10.0.0.9 --dport 4665 -m limit --limit 1/hour -j ACCEPT
iptables -A FORWARD -p udp -s 10.0.0.9 --dport 4665 -m limit --limit 1/hour -j ACCEPT
iptables -A FORWARD -p udp -s 10.0.0.9 --sport 4665 -m limit --limit 1/hour -j ACCEPT
iptables -A FORWARD -p tcp -s 10.0.0.9 --sport 4665 -m limit --limit 1/hour -j ACCEPT

# Block Outside the Network
iptables -A FORWARD -o eth0 -p tcp --dport 111 -j REJECT iptables -A INPUT -i eth0 -p tcp --dport 111 -j REJECT iptables -A FORWARD -o eth0 -p tcp --dport 199 -j REJECT iptables -A INPUT -i eth0 -p tcp --dport 199 -j REJECT iptables -A FORWARD -o eth0 -p tcp --dport 826 -j REJECT iptables -A INPUT -i eth0 -p tcp --dport 826 -j REJECT iptables -A FORWARD -o eth0 -p tcp --dport 953 -j REJECT iptables -A INPUT -i eth0 -p tcp --dport 953 -j REJECT

# Block Inside the Network
iptables -A FORWARD -o eth1 -p tcp --dport 111 -j REJECT iptables -A INPUT -i eth1 -p tcp --dport 111 -j REJECT iptables -A FORWARD -o eth1 -p tcp --dport 199 -j REJECT iptables -A INPUT -i eth1 -p tcp --dport 199 -j REJECT iptables -A FORWARD -o eth1 -p tcp --dport 826 -j REJECT iptables -A INPUT -i eth1 -p tcp --dport 826 -j REJECT iptables -A INPUT -i eth1 -p tcp --dport 953 -j REJECT

iptables -A INPUT -i eth0 -p tcp --dport 4661 -j ACCEPT iptables -A INPUT -i eth0 -p udp --dport 4661 -j ACCEPT iptables -A INPUT -i eth1 -p udp --dport 4661 -j ACCEPT iptables -A INPUT -i eth1 -p tcp --dport 4661 -j ACCEPT iptables -A INPUT -i eth1 -p tcp --sport 4661 -j ACCEPT iptables -A INPUT -i eth1 -p udp --sport 4661 -j ACCEPT iptables -A INPUT -i eth0 -p udp --sport 4661 -j ACCEPT iptables -A INPUT -i eth0 -p tcp --sport 4661 -j ACCEPT

iptables -A FORWARD -o eth0 -p tcp --dport 4661 -j ACCEPT iptables -A FORWARD -o eth1 -p tcp --dport 4661 -j ACCEPT iptables -A FORWARD -o eth1 -p udp --dport 4661 -j ACCEPT iptables -A FORWARD -o eth0 -p udp --dport 4661 -j ACCEPT iptables -A FORWARD -o eth0 -p udp --sport 4661 -j ACCEPT iptables -A FORWARD -o eth1 -p udp --sport 4661 -j ACCEPT ptables -A FORWARD -o eth0 -p tcp --sport 4661 -j ACCEPT

iptables -A INPUT -i eth0 -p tcp --dport 4662 -j ACCEPT iptables -A INPUT -i eth0 -p udp --dport 4662 -j ACCEPT iptables -A INPUT -i eth1 -p udp --dport 4662 -j ACCEPT iptables -A INPUT -i eth1 -p tcp --dport 4662 -j ACCEPT iptables -A INPUT -i eth1 -p tcp --sport 4662 -j ACCEPT iptables -A INPUT -i eth1 -p udp --sport 4662 -j ACCEPT iptables -A INPUT -i eth0 -p udp --sport 4662 -j ACCEPT iptables -A INPUT -i eth0 -p tcp --sport 4662 -j ACCEPT

iptables -A FORWARD -o eth0 -p tcp --dport 4662 -j ACCEPT iptables -A FORWARD -o eth1 -p tcp --dport 4662 -j ACCEPT iptables -A FORWARD -o eth1 -p udp --dport 4662 -j ACCEPT iptables -A FORWARD -o eth0 -p udp --dport 4662 -j ACCEPT iptables -A FORWARD -o eth0 -p udp --sport 4662 -j ACCEPT iptables -A FORWARD -o eth1 -p udp --sport 4662 -j ACCEPT iptables -A FORWARD -o eth1 -p tcp --sport 4662 -j ACCEPT iptables -A FORWARD -o eth0 -p tcp --sport 4662 -j ACCEPT

iptables -A INPUT -i eth0 -p tcp --dport 4665 -j ACCEPT iptables -A INPUT -i eth0 -p udp --dport 4665 -j ACCEPT iptables -A INPUT -i eth1 -p udp --dport 4665 -j ACCEPT iptables -A INPUT -i eth1 -p tcp --dport 4665 -j ACCEPT iptables -A INPUT -i eth1 -p tcp --sport 4665 -j ACCEPT iptables -A INPUT -i eth1 -p udp --sport 4665 -j ACCEPT iptables -A INPUT -i eth0 -p udp --sport 4665 -j ACCEPT iptables -A INPUT -i eth0 -p tcp --sport 4665 -j ACCEPT

iptables -A FORWARD -o eth0 -p tcp --dport 4665 -j ACCEPT iptables -A FORWARD -o eth1 -p tcp --dport 4665 -j ACCEPT iptables -A FORWARD -o eth1 -p udp --dport 4665 -j ACCEPT iptables -A FORWARD -o eth0 -p udp --dport 4665 -j ACCEPT iptables -A FORWARD -o eth0 -p udp --sport 4665 -j ACCEPT iptables -A FORWARD -o eth1 -p udp --sport 4665 -j ACCEPT iptables -A FORWARD -o eth1 -p tcp --sport 4665 -j ACCEPT iptables -A FORWARD -o eth0 -p tcp --sport 4665 -j ACCEPT

#19 lore raw
Quoted 9 lines

ok heres my current script, yes its inefficient, but thats not the major problem.. 4662 port :/ I relise that theres more ports available for edonkey to use, but opening ONE port would be a start.

i added "iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT" without anything happening...

<snip>

Quoted 7 lines

iptables -A FORWARD -o eth1 -p udp --dport 4665 -j ACCEPT iptables -A FORWARD -o eth0 -p udp --dport 4665 -j ACCEPT iptables -A FORWARD -o eth0 -p udp --sport 4665 -j ACCEPT iptables -A FORWARD -o eth1 -p udp --sport 4665 -j ACCEPT iptables -A FORWARD -o eth1 -p tcp --sport 4665 -j ACCEPT iptables -A FORWARD -o eth0 -p tcp --sport 4665 -j ACCEPT

Okay, let's leave these rules alone for a moment.
*IS* your eDonkey server running/listening. If you do a netstat -an *on the machine that's supposed to be running eDonkey* (you don't need netcat to do this) then it must report one (or more) ports belonging to eDonkey as listening .
If not, you can try whatever you want but it won't work ; you will never connect, not even local. Forwarding is not going to help you then and AFAIK you can't test if forwarding is working (which doesn't say it's impossible ; I just don't know how).

Besides, going back to the ruleset, I don't see an "echo 1 > /proc/sys/net/ipv4/ip_forward". You may have setup the rules correctly but it's not going to forward anything untill you did the above "echo".

Rob

#20 lore raw
In reply to mdew

Hi,

I guess youre scenario is like this:

some_machine - - - Router - - - - server_maybe_not_existing(4662)

If you want to be able to get any positive respons you should do a

some_machine> telnet server_maybe_not_existing 4662

The router will not tell you the port is open.

Good Luck!

/r

Quoted 70 lines · mdew

Date: 09 Jan 2003 01:52:07 +1300
From: mdew <[email protected]>
To: Dharmendra.T <[email protected]>
Cc: netfilter <[email protected]>
Subject: Re: opening a port..

Quoted 41 lines · Dharmendra.T
Quoted 28 lines · mdew

Hi,
Just *testing* this out..

iptables -A INPUT -i eth0 -p tcp --dport 4662 -j ACCEPT iptables -A INPUT -i eth0 -p udp --dport 4662 -j ACCEPT iptables -A INPUT -i eth1 -p udp --dport 4662 -j ACCEPT iptables -A INPUT -i eth1 -p tcp --dport 4662 -j ACCEPT iptables -A INPUT -i eth1 -p tcp --sport 4662 -j ACCEPT iptables -A INPUT -i eth1 -p udp --sport 4662 -j ACCEPT iptables -A INPUT -i eth0 -p udp --sport 4662 -j ACCEPT iptables -A INPUT -i eth0 -p tcp --sport 4662 -j ACCEPT

iptables -A FORWARD -o eth0 -p tcp --dport 4662 -j ACCEPT iptables -A FORWARD -o eth1 -p tcp --dport 4662 -j ACCEPT iptables -A FORWARD -o eth1 -p udp --dport 4662 -j ACCEPT iptables -A FORWARD -o eth0 -p udp --dport 4662 -j ACCEPT iptables -A FORWARD -o eth0 -p udp --sport 4662 -j ACCEPT iptables -A FORWARD -o eth1 -p udp --sport 4662 -j ACCEPT iptables -A FORWARD -o eth1 -p tcp --sport 4662 -j ACCEPT iptables -A FORWARD -o eth0 -p tcp --sport 4662 -j ACCEPT

yet, when i try to telnet to it,

mdew:~# telnet 127.0.0.1 4662
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused
Quoted 7 lines

Yeah I know I have lots of unnessary rules, but im only testing 'em...it just seems a little strange that i cant see 4662 (Edonkey port) on the router.

-mdew

Note:
telnet 127.0.0.1 port

Quoted 11 lines

This will not go through any of the interfaces(eth*). You should allow
this through -i lo.

Here some how you are getting connected and you are getting the response connection refused. Probably you are not running the service on the router!.

Signature · 2 lines
Dharmendra.T
Linux Enthu

ok, telnet from another machine to the router.

telnet 10.0.0.6 4662
Trying 10.0.0.6...
telnet: Unable to connect to remote host: Connection refused

what "service" should I be running? I simply want 4662 open both ways.

-mdew

#21 lore raw
In reply to mdew
Quoted 55 lines · mdew
Quoted 41 lines · Dharmendra.T
Quoted 28 lines · mdew

Hi,
Just *testing* this out..

iptables -A INPUT -i eth0 -p tcp --dport 4662 -j ACCEPT iptables -A INPUT -i eth0 -p udp --dport 4662 -j ACCEPT iptables -A INPUT -i eth1 -p udp --dport 4662 -j ACCEPT iptables -A INPUT -i eth1 -p tcp --dport 4662 -j ACCEPT iptables -A INPUT -i eth1 -p tcp --sport 4662 -j ACCEPT iptables -A INPUT -i eth1 -p udp --sport 4662 -j ACCEPT iptables -A INPUT -i eth0 -p udp --sport 4662 -j ACCEPT iptables -A INPUT -i eth0 -p tcp --sport 4662 -j ACCEPT

iptables -A FORWARD -o eth0 -p tcp --dport 4662 -j ACCEPT iptables -A FORWARD -o eth1 -p tcp --dport 4662 -j ACCEPT iptables -A FORWARD -o eth1 -p udp --dport 4662 -j ACCEPT iptables -A FORWARD -o eth0 -p udp --dport 4662 -j ACCEPT iptables -A FORWARD -o eth0 -p udp --sport 4662 -j ACCEPT iptables -A FORWARD -o eth1 -p udp --sport 4662 -j ACCEPT iptables -A FORWARD -o eth1 -p tcp --sport 4662 -j ACCEPT iptables -A FORWARD -o eth0 -p tcp --sport 4662 -j ACCEPT

yet, when i try to telnet to it,

mdew:~# telnet 127.0.0.1 4662
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused
Quoted 7 lines

Yeah I know I have lots of unnessary rules, but im only testing 'em...it just seems a little strange that i cant see 4662 (Edonkey port) on the router.

-mdew

Note:
telnet 127.0.0.1 port

Quoted 11 lines

This will not go through any of the interfaces(eth*). You should allow
this through -i lo.

Here some how you are getting connected and you are getting the response connection refused. Probably you are not running the service on the router!.

Signature · 2 lines
Dharmendra.T
Linux Enthu

ok, telnet from another machine to the router.

Quoted 8 lines

telnet 10.0.0.6 4662
Trying 10.0.0.6...
telnet: Unable to connect to remote host: Connection refused

what "service" should I be running? I simply want 4662 open both ways.

-mdew

Install nc and run

#nc -l -p 4662

And then try to connect. Some service should be running on the port else you will get the same error message.

Signature · 2 lines
Dharmendra.T
Linux Enthu
#22 lore raw
In reply to Dharmendra.T

Check if the service is listening..and if it's listening on *:4662 or on a specific interface.
netstat -tupln|grep ":4662"

----- Original Message -----
From: "Dharmendra.T" <[email protected]>
To: "mdew" <[email protected]>
Cc: "netfilter" <[email protected]>
Sent: Wednesday, January 08, 2003 2:33 PM
Subject: Re: opening a port..

Quoted 56 lines · mdew
Quoted 28 lines

Hi,
Just *testing* this out..

iptables -A INPUT -i eth0 -p tcp --dport 4662 -j ACCEPT iptables -A INPUT -i eth0 -p udp --dport 4662 -j ACCEPT iptables -A INPUT -i eth1 -p udp --dport 4662 -j ACCEPT iptables -A INPUT -i eth1 -p tcp --dport 4662 -j ACCEPT iptables -A INPUT -i eth1 -p tcp --sport 4662 -j ACCEPT iptables -A INPUT -i eth1 -p udp --sport 4662 -j ACCEPT iptables -A INPUT -i eth0 -p udp --sport 4662 -j ACCEPT iptables -A INPUT -i eth0 -p tcp --sport 4662 -j ACCEPT

iptables -A FORWARD -o eth0 -p tcp --dport 4662 -j ACCEPT iptables -A FORWARD -o eth1 -p tcp --dport 4662 -j ACCEPT iptables -A FORWARD -o eth1 -p udp --dport 4662 -j ACCEPT iptables -A FORWARD -o eth0 -p udp --dport 4662 -j ACCEPT iptables -A FORWARD -o eth0 -p udp --sport 4662 -j ACCEPT iptables -A FORWARD -o eth1 -p udp --sport 4662 -j ACCEPT iptables -A FORWARD -o eth1 -p tcp --sport 4662 -j ACCEPT iptables -A FORWARD -o eth0 -p tcp --sport 4662 -j ACCEPT

yet, when i try to telnet to it,

mdew:~# telnet 127.0.0.1 4662
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused
Quoted 7 lines

Yeah I know I have lots of unnessary rules, but im only testing 'em...it just seems a little strange that i cant see 4662 (Edonkey port) on the router.

-mdew

Note:
telnet 127.0.0.1 port

This will not go through any of the interfaces(eth*). You should allow
this through -i lo.

Here some how you are getting connected and you are getting the response connection refused. Probably you are not running the service on the router!.

--
Dharmendra.T
Linux Enthu

author
#23 lore raw
In reply to mdew
Quoted 28 lines · mdew

Hi,
Just *testing* this out..

iptables -A INPUT -i eth0 -p tcp --dport 4662 -j ACCEPT iptables -A INPUT -i eth0 -p udp --dport 4662 -j ACCEPT iptables -A INPUT -i eth1 -p udp --dport 4662 -j ACCEPT iptables -A INPUT -i eth1 -p tcp --dport 4662 -j ACCEPT iptables -A INPUT -i eth1 -p tcp --sport 4662 -j ACCEPT iptables -A INPUT -i eth1 -p udp --sport 4662 -j ACCEPT iptables -A INPUT -i eth0 -p udp --sport 4662 -j ACCEPT iptables -A INPUT -i eth0 -p tcp --sport 4662 -j ACCEPT

iptables -A FORWARD -o eth0 -p tcp --dport 4662 -j ACCEPT iptables -A FORWARD -o eth1 -p tcp --dport 4662 -j ACCEPT iptables -A FORWARD -o eth1 -p udp --dport 4662 -j ACCEPT iptables -A FORWARD -o eth0 -p udp --dport 4662 -j ACCEPT iptables -A FORWARD -o eth0 -p udp --sport 4662 -j ACCEPT iptables -A FORWARD -o eth1 -p udp --sport 4662 -j ACCEPT iptables -A FORWARD -o eth1 -p tcp --sport 4662 -j ACCEPT iptables -A FORWARD -o eth0 -p tcp --sport 4662 -j ACCEPT

yet, when i try to telnet to it,

mdew:~# telnet 127.0.0.1 4662
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused
Quoted 5 lines

Yeah I know I have lots of unnessary rules, but im only testing 'em...it just seems a little strange that i cant see 4662 (Edonkey port) on the router.

-mdew

ok, from another machine->router. (same problem)

telnet 10.0.0.6 4662
Trying 10.0.0.6...
telnet: Unable to connect to remote host: Connection refused

#24 lore raw
Quoted 33 lines · mdew
Quoted 32 lines · mdew

Hi,
Just *testing* this out..

iptables -A INPUT -i eth0 -p tcp --dport 4662 -j ACCEPT iptables -A INPUT -i eth0 -p udp --dport 4662 -j ACCEPT iptables -A INPUT -i eth1 -p udp --dport 4662 -j ACCEPT iptables -A INPUT -i eth1 -p tcp --dport 4662 -j ACCEPT iptables -A INPUT -i eth1 -p tcp --sport 4662 -j ACCEPT iptables -A INPUT -i eth1 -p udp --sport 4662 -j ACCEPT iptables -A INPUT -i eth0 -p udp --sport 4662 -j ACCEPT iptables -A INPUT -i eth0 -p tcp --sport 4662 -j ACCEPT

iptables -A FORWARD -o eth0 -p tcp --dport 4662 -j ACCEPT iptables -A FORWARD -o eth1 -p tcp --dport 4662 -j ACCEPT iptables -A FORWARD -o eth1 -p udp --dport 4662 -j ACCEPT iptables -A FORWARD -o eth0 -p udp --dport 4662 -j ACCEPT iptables -A FORWARD -o eth0 -p udp --sport 4662 -j ACCEPT iptables -A FORWARD -o eth1 -p udp --sport 4662 -j ACCEPT iptables -A FORWARD -o eth1 -p tcp --sport 4662 -j ACCEPT iptables -A FORWARD -o eth0 -p tcp --sport 4662 -j ACCEPT

yet, when i try to telnet to it,

mdew:~# telnet 127.0.0.1 4662
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused

Yeah I know I have lots of unnessary rules, but im only testing 'em...it just seems a little strange that i cant see 4662 (Edonkey port) on the router.

Quoted 8 lines
Quoted 1 line

-mdew

ok, from another machine->router. (same problem)

telnet 10.0.0.6 4662
Trying 10.0.0.6...
telnet: Unable to connect to remote host: Connection refused

Connection refused means the router is not listening on that port ...

Quoted 1 line
Signature · 19 lines
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(  Raymond Leach                       )
 ) Knowledge Factory                  (
(                                      )
 ) Tel: +27 11 445 8100               (
(  Fax: +27 11 445 8101                )
 )                                    (
(  http://www.knowledgefactory.co.za/  )
 ) http://www.saptg.co.za/            (
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   o                                o
    o                              o
        .--.                  .--.
       | o_o|                |o_o |
       | \_:|                |:_/ |
      / /   \\              //   \ \
     ( |     |)            (|     | )
     /`\_   _/'\          /'\_   _/`\
     \___)=(___/          \___)=(___/