LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-08-2004, 12:21 PM   #1
Kendo1979
Member
 
Registered: Aug 2004
Location: Bandung, Indonesia
Distribution: Red Hat 9
Posts: 51

Rep: Reputation: 15
running start up script


i have 2 script i wanna run at start up


first script is for blocking destination and port,

#!/bin/sh
/sbin/iptables -I FORWARD -d xxx.xxx.xxx.xxx -p tcp --dport 5000 -j DROP
...
/sbin/iptables -I FORWARD -d xxx.xxx.xxx.xxx -p tcp --dport 5000 -j DROP

and second script
for different games
/sbin/iptables -I FORWARD -s xxx.xxx.xxx.xxx -p tcp --dport 8363 -j DROP

i put both scirpt at /sources naming them gb.sh and ro.sh respectively
when i run manually
/sources/gb.sh
/sources/ro.sh

the script is working fine
the port and destinantion is blocked

but when i try to put it in rc.local so that it can be started at startup, it wouldn't function

using command iptables -L
it shows that the script is not working.

what must i do?
 
Old 11-08-2004, 12:37 PM   #2
amfoster
Member
 
Registered: Aug 2004
Distribution: debian, SuSE
Posts: 365

Rep: Reputation: 36
Sounds like a Red Hat box since you have a /etc/rc.d/rc.local file. That should absolutely work.
Your other choice might be to edit the run level directory and stick them there.

Example...

Create a file named S99mytables
write your script in there and make it executable.
Put this script file in the appropirate rc.d directory. I always boot into run level 3, so I would put the S99 script in the /etc/rc.d/rc3.d directory.

I am a little at a loss as why it does not run from rc.local. On my RH box, I start the named and dhcp daemon from there.

If you are not clearing the firewall, I do not understand why it isn't staying as valid entries anyway.
 
Old 11-08-2004, 12:48 PM   #3
Kendo1979
Member
 
Registered: Aug 2004
Location: Bandung, Indonesia
Distribution: Red Hat 9
Posts: 51

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by amfoster

If you are not clearing the firewall, I do not understand why it isn't staying as valid entries anyway.
i must say that this hits the button
i wrongfully placed it before my nat.sh which have iptables -F in the first line of it
thank you
this is embarrassing
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Start Up script for wireless running with Ndiswrapper mckinlsm Linux - Wireless Networking 3 10-20-2008 11:11 PM
Running a script to start WiFi on boot nanodano Linux - Hardware 3 11-06-2005 09:00 PM
Script to see if a process ir running, if not start it ncsuapex Programming 4 07-03-2005 01:27 PM
How to start a Tcl/Tk script by simply invoking the script file itself ? cyu021 Programming 2 10-10-2004 11:00 AM
Running a script spacemonk Linux - Newbie 4 07-30-2004 04:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:42 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
Open Source Consulting | Domain Registration