LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices



Reply
 
Search this Thread
Old 03-07-2004, 05:42 PM   #1
creznedmick
Member
 
Registered: Aug 2003
Location: Austarlia
Distribution: redhat 7.3 & 9, Mandrake
Posts: 39

Rep: Reputation: 15
no chain/target/match


Have you got any ideas, I am trying to open some ports on my gateway machine (192.168.1.2) for bittorrent to access the net from an internal machine 192.168.1.3. This is the script (bittrakerPortforwarding)I used

#!/bin/bash
#bittraker portforwarding
BTFOWARDADD=192.168.1.3
BTPORTS="6890 6891 6892 6893 6894 6895 6896 6897 6898 6899"

for pt in $BTPORTS; do
/sbin/iptables -t nat -A -PREROUTING -i pp0 -p tcp --dport $pt -j DNAT --to-destination $BTFORWARDADD:$pt
/sbin/iptables -A FORWARD -s $BTFOWARDADD -p tcp --dport $pt -j ACCEPT
done



[root@satellite bin]# ./bittrakerPortforwarding
iptables: No chain/target/match by that name
iptables: No chain/target/match by that name
iptables: No chain/target/match by that name
iptables: No chain/target/match by that name
iptables: No chain/target/match by that name
iptables: No chain/target/match by that name
iptables: No chain/target/match by that name
iptables: No chain/target/match by that name
iptables: No chain/target/match by that name
iptables: No chain/target/match by that name
[root@satellite bin]# man iptables
[root@satellite bin]#

/etc/sysconfig/iptables
# Generated by iptables-save v1.2.5 on Fri Aug 1 23:47:40 2003
*nat
:PREROUTING ACCEPT [1864:135354]
:POSTROUTING ACCEPT [1326:100324]
:OUTPUT ACCEPT [114:14454]
[1:65] -A POSTROUTING -o ppp0 -j MASQUERADE
COMMIT
# Completed on Fri Aug 1 23:47:40 2003
# Generated by iptables-save v1.2.5 on Fri Aug 1 23:47:40 2003
*mangle
:PREROUTING ACCEPT [6816:747213]
:INPUT ACCEPT [2558:445414]
:FORWARD ACCEPT [4258:301799]
:OUTPUT ACCEPT [5977:630744]
:POSTROUTING ACCEPT [10190:937836]
COMMIT
# Completed on Fri Aug 1 23:47:40 2003
# Generated by iptables-save v1.2.5 on Fri Aug 1 23:47:40 2003
*filter
:INPUT ACCEPT [2981:482487]
:FORWARD ACCEPT [4367:309436]
:OUTPUT ACCEPT [6208:655610]
[0:0] -A FORWARD -i eth0 -o ppp0 -m state --state RELATED,ESTABLISHED -j ACCEPT
[0:0] -A FORWARD -i ppp0 -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT
[29:2053] -A FORWARD -i eth0 -o ppp0 -j ACCEPT
[1:81] -A FORWARD -j LOG
COMMIT

#This input allows bittorrent to converse over ports 6881-6889 from dads(192.168.1.3) ( TRIED THIS BUT GET ERROR MESSAGE REGARDING -t)
#iptables -t nat -A PREROUTING -p tcp -dport 6881:6889 -j DNAT -to-destination 192.168.1.3

# Completed on Fri Aug 1 23:47:40 2003 tried this but gives error message regarding -t
 
Old 03-08-2004, 05:47 AM   #2
maxut
Senior Member
 
Registered: May 2003
Location: istanbul
Distribution: debian - redhat - others
Posts: 1,188

Rep: Reputation: 50
dont add "-" b4 PREROUTING.. got it?

/sbin/iptables -t nat -A PREROUTING -i pp0 -p tcp --dport $pt -j DNAT --to-destination $BTFORWARDADD:$pt
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
iptables: No chain/target/match by that name schatoor Linux - Networking 6 01-04-2009 10:10 PM
Where are boot.s and chain.s?? BlueKnight Slackware 2 02-25-2005 05:45 PM
"iptables: No chain/target/match by that name" error PennyroyalFrog Linux - Security 2 11-28-2004 02:57 PM
what is tool chain? blackzone Linux - Hardware 1 09-23-2004 05:30 AM
iptables and LD chain spawing? lode Linux - Networking 8 04-21-2004 04:30 AM


All times are GMT -5. The time now is 07:11 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration