LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 01-17-2004, 02:57 AM   #1
moger
Member
 
Registered: Sep 2002
Distribution: Fedora Core 3
Posts: 247

Rep: Reputation: 30
iptables slackware questions


When I make iptable rules, I run "iptables-save" but when I log back on all the rules are gone. How do you save your iptables entry so it's there on startup?

Also, I remember RedHat having a file with all the rules in it. Does slackware have something like this? What if I want to delete a rule? Is there a way I can go into a file and delete it?
 
Old 01-17-2004, 03:23 AM   #2
ugenn
Member
 
Registered: Apr 2002
Posts: 549

Rep: Reputation: 30
Somewhere along your initscripts, you have to run iptables-restore. I'm not sure how Slack handles this, there should be a firewall specific initscript that you can add that line to, otherwise, add the command to your rc.local (or equivalent) file.
 
Old 01-17-2004, 03:23 AM   #3
spurious
Member
 
Registered: Apr 2003
Location: Vancouver, BC
Distribution: Slackware, Ubuntu
Posts: 558

Rep: Reputation: 31
You save your iptables script in /etc/rc.d/rc.firewall. Search this site for 'Slackware' and 'rc.firewall'
 
Old 01-17-2004, 03:33 AM   #4
moger
Member
 
Registered: Sep 2002
Distribution: Fedora Core 3
Posts: 247

Original Poster
Rep: Reputation: 30
Thanks

Last edited by moger; 01-17-2004 at 03:36 AM.
 
Old 01-17-2004, 08:07 AM   #5
dirstyGuy
Member
 
Registered: Jan 2004
Posts: 67

Rep: Reputation: 15
Bettter were to write functions (start, stop, restart) in the /etc/rc.d/rc.firewall script, so u can delete those rules in the function stop. This is the slackware way of doing thing ?!

Code:
#!/bin/sh
# /etc/rc.d/rc.firewall

IPT=/usr/sbin/iptables

# Reset all previous iptables rules
firewall_stop() {
  $IPT -F
  $IPT -t nat -F
  $IPT -t mangle -F
  $IPT --delete-chain
  $IPT -t nat --delete-chain
  echo "All tables, rules are reset"
}

firewall_start() {
  echo "firewall start"
}

case "$1" in
'start')
  firewall_start
  ;;
'stop')
  firewall_stop
  ;;
'restart')
  firewall_restart
  ;;
'reload')
  firewall_reload
  ;;
'status')
  firewall_status
  $IPT -nL ;;
*)
  echo "usage $0 start|stop|restart|reload|status"
esac
 
  


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
Lots of questions (help with iptables and ssh) stormrider_may Linux - Security 13 11-18-2005 09:27 PM
questions about iptables Paxmaster Linux - Security 1 07-13-2005 03:01 AM
iptables good practice - 2 questions ddaas Linux - Security 1 05-31-2005 08:09 AM
iptables questions AZDAVE Linux - Security 2 03-25-2004 02:26 PM
questions on sendmail and iptables aetengoku Linux - Software 4 01-27-2004 10:14 PM


All times are GMT -5. The time now is 03:45 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration