LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-22-2004, 02:59 PM   #1
dominant
Member
 
Registered: Jan 2004
Posts: 409

Rep: Reputation: 30
iptables coont start in the beginning


I have made a script containing the following

Code:
iptables -F INPUT
iptables -P INPUT DROP
iptables -A INPUT -s myip -p tcp --dport 110 -j ACCEPT
This cannot be start if i put the name of the script in the boot.local (SUSE 9.0)

every other command in boot.local works great.

What is wrong?
 
Old 02-22-2004, 03:45 PM   #2
Mathieu
Senior Member
 
Registered: Feb 2001
Location: Montreal, Quebec, Canada
Distribution: RedHat, Fedora, CentOS, SUSE
Posts: 1,403

Rep: Reputation: 46
You need to use the full path.

For example, you have a script called initFirewall.sh
In the /etc/rc.d/boot.local file, you would add the full path to the script
/usr/local/bin/initFirewall.sh

Do the same for your script.
Code:
#!/bin/bash

IPTABLES="/usr/sbin/iptables"

$IPTABLES -F INPUT
$IPTABLES -P INPUT DROP
$IPTABLES -A INPUT -s myip -p tcp --dport 110 -j ACCEPT
Also, does your script have the #!/bin/bash at the top.
 
Old 02-23-2004, 09:10 AM   #3
dominant
Member
 
Registered: Jan 2004
Posts: 409

Original Poster
Rep: Reputation: 30
This solution doen't seem to work.

Nothing changes at the beginning.
 
Old 02-24-2004, 03:50 PM   #4
Mathieu
Senior Member
 
Registered: Feb 2001
Location: Montreal, Quebec, Canada
Distribution: RedHat, Fedora, CentOS, SUSE
Posts: 1,403

Rep: Reputation: 46


The only other thing I can think of is permissions and owner (root). Is your script set to executable ?
Check your error logs (/var/log/messages), maybe it can tell you something I can't.
 
Old 02-25-2004, 08:37 AM   #5
dominant
Member
 
Registered: Jan 2004
Posts: 409

Original Poster
Rep: Reputation: 30
It's ok now.

Suse firewall applies its rules after my script execution.
I disabled the SuSE firewall and now i am ok!

Thanks for your help
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Beginning Kernel Programming -- where to start? koodoo Programming 7 11-17-2005 02:08 PM
can not start my iptables xudingding Linux - Security 6 10-13-2005 03:30 PM
Iptables ate start-up martincho Linux - Networking 1 09-28-2005 03:14 PM
Beginning iptables, suggestions. microsoft/linux Linux - Security 8 07-10-2005 12:34 PM
Absolute Basics, I need to start at the beginning ffilc7373 Linux - Newbie 58 03-23-2004 05:49 PM


All times are GMT -5. The time now is 08:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration