CentOS Godaddy VDS Firewall setup

I recently purchased a godaddy Virtual Dedicated Server with CentOS. I need to get the firewall up and running. does anyone have any sudgestions?
iptables is installed
%service iptables start
bash: service: command not found

any ideas?
Who is Participating?
Kerem ERSOYPresidentCommented:
just run
it seems that you are not root..
nole_jesse11Author Commented:
i was root. i just had to find the iptable binary and reference it directly. i got now, thanks!
nole_jesse11Author Commented:
merry christmas!
On-Demand: Securing Your Wi-Fi for Summer Travel

Traveling this summer?Check out our on-demand webinar to learn about the importance of Wi-Fi security and 3 easy measures you can start taking immediately to protect your private data while using public Wi-Fi. Follow us today to learn more!

Kerem ERSOYPresidentCommented:
oh :) I'd thought is was an error abour service not found but as you told service script has an error since it did not find the error.

Thanks for the stocking stuffer :)
Kerem ERSOYPresidentCommented:
But there's something fishy here. Because "service iptables start" will start iptbales if it can not the iptables script will display an error before script stops with error.

If iptables exits with such an error it seems that there is a problem. It means that it will not start automatically during system start.

Normally iptables must be in /sbin/iptablaes. Will you check if it is located there ?
If it is there there must be problem with the service.

chkconfig --list iptables

must display something like this
iptables        0:off   1:off   2:on    3:on    4:on    5:on    6:off

But instead if it says that there's a service but it is not included among services then yuou need to register it first.
nole_jesse11Author Commented:
The service is running. i know because i have been effectively blocking off ports.
chkconfig does not work either. i think the bash shell is missing a path or two. I can go in to rc.d and use the start up script to control it.
Kerem ERSOYPresidentCommented:
I understand that it works now but. Do you have a custom script for iptbales ?  Because default sstem config is in /etc/sysyconfig/iptables and the script which interprets the config is in /etc/init.d/iptables. I dont think it is possible to run thme without service script (in fact it is possible but you should do it manually)

Both service and chkconfig are normally in /sbin. This path is only included in root user. This is why I had thought you were not root in the beginning.
nole_jesse11Author Commented:
i went into /sbin and i could use
./chkconfig --list iptables

it matched
iptables        0:off   1:off   2:on    3:on    4:on    5:on    6:off
do you think anything else is wrong?
Kerem ERSOYPresidentCommented:
it seems that somehow /sbin is not in your path.
display path with:
echo $PATH
checik if /sbin is there.

If not edit /etc/profile for:

# Path manipulation
if [ `id -u` = 0 ]; then
        pathmunge /sbin
        pathmunge /usr/sbin
        pathmunge /usr/local/sbin
        pathmunge /scripts

Kerem ERSOYPresidentCommented:
I think I've found the killer. It is the butler as usual :)

Did you chance your .bash_profile? If you've added something you need to include the former path too such as:

path .:$PATH

this will add . bedore the existing path. But if you don't include it then it will be only . ans wiil tun only some executable in the current directory. Could it be the case ?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.