LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   bad argument 'iptables' (https://www.linuxquestions.org/questions/linux-newbie-8/bad-argument-iptables-248716/)

gpamkenny 10-29-2004 07:49 AM

bad argument 'iptables'
 
I have just installed RH9 with medium firewall protection
I want to work with iptables a bit, and open the telnet port and port 5555.

/etc/init.d/iptables stop
I copied the original iptables to iptables.good
then rempved all lines from the original file and added

#Polices
iptables -P INPUT drop
iptables -P OUTPUT drop
iptables -P FORWARD drop
# in and out
iptables -A OUTPUT -p ALL -s 192.168.1.103
iptables -A INPUT -p ALL -i eth0 -s 192.168.1.03 -j ACCEPT

COMMIT

/etc/init.d/iptables start

et the error bad argument iptables
Basicly took the above from examples I found

Thanks

mAineAc 10-29-2004 08:16 AM

try iptables --help at the command line to see if it comes up. Make sure you have the iptables module modprobed. Are you in root when doing this?

gpamkenny 10-29-2004 08:38 AM

yes I am in root, what is module modprobed is that an package I should load?

Thanks

mAineAc 10-29-2004 09:41 AM

do lsmod and see what you have for modules installed. If I remember right RH has the iptables in as modules. there are a few different ones depending on what you want to do with your firewall. When you type 'which iptables' what do you get? Look at the old firewall script you moved and see what it has for commands for loading modules. It would have a command like insmod or modprobe.

gpamkenny 10-29-2004 10:25 AM

Hi

lsmod
iptables_filter
ip_tables

which iptables
/sbin/iptables

iptables file
# Firewall configuration written by lokkit
# Manual customization of this file is not recommended.

# Note: ifup-post will punch the current nameservers through the

#firewall; such entries will *not* be listed here.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:RH-Lokkit-0-50-INPUT - [0:0]
-A INPUT -j RH-Lokkit-0-50-INPUT
-A FORWARD -j RH-Lokkit-0-50-INPUT
-A RH-Lokkit-0-50-INPUT -i lo -j ACCEPT
-A RH-Lokkit-0-50-INPUT -p tcp -m tcp --dport 0:1023 --syn -j REJECT
-A RH-Lokkit-0-50-INPUT -p tcp -m tcp --dport 2049 --syn -j REJECT
-A RH-Lokkit-0-50-INPUT -p udp -m udp --dport 0:1023 -j REJECT
-A RH-Lokkit-0-50-INPUT -p udp -m udp --dport 2049 -j REJECT
-A RH-Lokkit-0-50-INPUT -p tcp -m tcp --dport 6000:6009 --syn -j REJECT
-A RH-Lokkit-0-50-INPUT -p tcp -m tcp --dport 7100 --syn -j REJECT
COMMIT

I tried edit telnet port 23 to this file with no luck


All times are GMT -5. The time now is 05:41 AM.