|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
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 |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > Linux Help > Syntax error in iptables. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|