Results 1 to 6 of 6
Hi
In my new Centos i am not able to add iptable rule.
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3128
bash: iptables: ...
- 12-22-2010 #1Just Joined!
- Join Date
- Dec 2010
- Posts
- 16
not able to add iptable rule
Hi
In my new Centos i am not able to add iptable rule.
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3128
bash: iptables: command not found
I am getting this error. I use this rule to forward ports to squid.
Thanks and Regards
Suresh
- 12-22-2010 #2
are you running the command as root, or your regular user?
New to the internet, technical forums, or the hacker / open source community??
Read this to learn good posting habits http://www.catb.org/~esr/faqs/smart-questions.html
RHCE for RHEL version 5
RHCT for RHEL version 4
- 12-23-2010 #3Just Joined!
- Join Date
- Dec 2010
- Posts
- 16
I am running as root only. I tried installing ubuntu in another machine its working fine and i can add rules. but in centos i am not able to add these rules. Mine is centos 5.5, RHEL version 5
- 12-23-2010 #4
You say you are root when doing this. Did you log in as root, su - or sudo for root?
OK, try the following. It looks like the file is not in your path.
This should tell you where iptables is located on your system.Code:locate iptables
This will give you your current path. Look at it and ensure that the above output path is in your current path.Code:$PATH
If it is not you then have 2 choices. Either add it to your PATH statement (google for how to do this) or run the commend with FQP.
- 12-26-2010 #5Just Joined!
- Join Date
- Feb 2008
- Location
- Mauritius
- Posts
- 8
Hi bro i would say edit this file
/etc/sysconfig/iptables and add the line
-t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3128
this line should be before commit line ok
- 12-27-2010 #6New to the internet, technical forums, or the hacker / open source community??
Read this to learn good posting habits http://www.catb.org/~esr/faqs/smart-questions.html
RHCE for RHEL version 5
RHCT for RHEL version 4


Reply With Quote
