LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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-20-2007, 05:26 PM   #1
mousi
LQ Newbie
 
Registered: Jan 2006
Distribution: Kubuntu 6.10, Debian sarge
Posts: 6

Rep: Reputation: 0
iptables - dport unknown arg


Hello, I am running shorewall 3.2.9 and iptables 1.2.11 on a debian sarge with 2.6.8 kernel. When shorewall processes the tcrules file, it stops with the following error:

Setting up TC Rules...
iptables v1.2.11: Unknown arg `--dport'
Try `iptables -h' or 'iptables --help' for more information.
ERROR: Command "/sbin/iptables -t mangle -A tcpre -s 0.0.0.0/0 -d 0.0.0.0/0 --dport 1234 -j MARK --set-mark 1" Failed
Processing /etc/shorewall/stop ...
IP Forwarding Enabled
Processing /etc/shorewall/stopped ...
/sbin/shorewall: line 2307: 7571 Terminated $SHOREWALL_SHELL ${VARDIR}/.restart $debugging restart

I tried to empty the tcrules file and set the rule by running the command:
iptables -t mangle -A tcpre -s 0.0.0.0/0 -d 0.0.0.0/0 --dport 1234 -j MARK --set-mark 1

But again the same error (iptables v1.2.11: Unknown arg `--dport').

HELP please... Thx in advance
 
Old 03-20-2007, 08:52 PM   #2
bsdunix
Senior Member
 
Registered: May 2006
Distribution: BeOS, BSD, Caldera, CTOS, Debian, LFS, Mac, Mandrake, Red Hat, Slackware, Solaris, SuSE
Posts: 1,761

Rep: Reputation: 80
Quote:
iptables v1.2.11: Unknown arg `--dport'
Try `iptables -h' or 'iptables --help' for more information.
ERROR: Command "/sbin/iptables -t mangle -A tcpre -s 0.0.0.0/0 -d 0.0.0.0/0 --dport 1234 -j MARK --set-mark 1" Failed
Your rule needs a -p protocol parameter before the --dport 1234.
 
Old 03-21-2007, 09:21 AM   #3
siadam
LQ Newbie
 
Registered: Jan 2007
Location: WV
Distribution: Slackware/Centos4
Posts: 29

Rep: Reputation: 15
A typical line would be like this

iptables -t nat -A PREROUTING -p tcp -d 75.111.x.x --dport x -j DNAT --to-destination 192.168.x.x(webserver-ip):x

iptables -t nat -A POSTROUTING -p tcp -d 192.168.x.x(lan-webserver-ip) --dport x -j SNAT --to-source 192.168.x.x(firewall-box-lan-ip)

 
Old 03-21-2007, 06:44 PM   #4
mousi
LQ Newbie
 
Registered: Jan 2006
Distribution: Kubuntu 6.10, Debian sarge
Posts: 6

Original Poster
Rep: Reputation: 0
OMG I am so stupid... That worked like a charm, thanks
 
  


Reply



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 failing to load: unknown ruleset bureado Linux - Software 3 06-19-2008 10:32 PM
iptables - "unknown arg" --dport crowhurst01 Linux - Security 7 10-16-2006 01:10 AM
iptables v1.2.9: Unknown arg `/sbin/iptables' Try `iptables -h' or 'iptables --help' Niceman2005 Linux - Security 4 12-29-2005 08:20 PM
dport 113 yoursmile Linux - Networking 2 06-23-2005 09:58 PM
iptables doesn't know what -dport 80 is... ? d33pdream Linux - Networking 6 04-04-2003 06:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:30 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
Open Source Consulting | Domain Registration