Linux Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsLinux Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 19th, 2003, 02:12 AM
ads ads is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2001
Location: India
Posts: 192 ads User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 12 m 27 sec
Reputation Power: 8
Syntax error in iptables.

Hi,
I want to add following line in iptables in nat file (Redhat 8.0) server.
"
*nat

-A RH-Lokkit-0-50-PREROUTING -p TCP --dport 80 -j REDIRECT --to-port 3128
COMMIT

When I restart iptables it gives me following error at command prompt..
[root@localhost root]# /etc/init.d/iptables restart
Flushing all current rules and user defined chains: [ OK ]
Clearing all current rules and user defined chains: [ OK ]
Applying iptables firewall rules: iptables-restore v1.2.6a: Unknown arg `--dport'
Try `iptables-restore -h' or 'iptables-restore --help' for more information.
[FAILED]

I tried to use "--destination-port" instead "--dport" still error.

Any idea what is correct syntax.
Thanks

Reply With Quote
  #2  
Old May 22nd, 2003, 08:59 AM
JonLed JonLed is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Aug 2000
Location: Indiana
Posts: 614 JonLed User rank is Corporal (100 - 500 Reputation Level)JonLed User rank is Corporal (100 - 500 Reputation Level)JonLed User rank is Corporal (100 - 500 Reputation Level)JonLed User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 h 49 m 49 sec
Reputation Power: 10
Try removing it from the file, restarting it again, then add the rule manually (iptables -t nat -A ....) Adding the rule at 'runtime' (so-to-speak) allows quicker validation of the rule working anyway. Once you have it loaded like that, you can use iptables-save to dump the contents to the nat file yourself (iptables-save > /path/to/natfile) This is how you should really do it anyway, since the format of the output can vary. You should always use iptables-save and iptables-restore to save and load-saved settings. The iptables 'start' script just flushes all the tables and uses iptables-restore.
__________________
Jon Coulter
ledjon@ledjon.com

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsLinux Help > Syntax error in iptables.


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway