LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE
User Name
Password
SUSE / openSUSE This Forum is for the discussion of Suse Linux.

Notices


Reply
  Search this Thread
Old 08-21-2011, 12:09 PM   #1
Tactful
LQ Newbie
 
Registered: Aug 2011
Posts: 10

Rep: Reputation: Disabled
Suse Studio Firewall


Hi, I need help with my firewall settings, and I prospected using the script option.





#!/bin/bash
#
# This script is executed whenever your appliance boots. Here you can add
# commands to be executed before the system enters the first runlevel. This
# could include loading kernel modules, starting daemons that aren't managed
# by init files, asking questions at the console, etc.
#
# The 'kiwi_type' variable will contain the format of the appliance (oem =
# disk image, vmx = VMware, iso = CD/DVD, xen = Xen).
#

# read in some variables
. /studio/profile

if [ -f /etc/init.d/suse_studio_firstboot ]
then

echo "Running SUSE Studio first boot script..."
iptables -I INPUT -p tcp --dport 113 -j DROP
iptables -I INPUT -p icmp -j DROP
fi





As you can see I need to use the terminal commands of "iptables -I INPUT -p tcp --dport 113 -j DROP" and "iptables -I INPUT -p icmp -j DROP." Is there anything wrong with my script or should I even be using script in the first place?
 
Old 08-23-2011, 09:50 AM   #2
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 4,070

Rep: Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897
I'm by no means a SUSE studio expert, but

Quote:
Originally Posted by Tactful View Post
#!/bin/bash
#
# This script is executed whenever your appliance boots. Here you can add
# commands to be executed before the system enters the first runlevel. This
# could include loading kernel modules, starting daemons that aren't managed
# by init files, asking questions at the console, etc.
#
# The 'kiwi_type' variable will contain the format of the appliance (oem =
# disk image, vmx = VMware, iso = CD/DVD, xen = Xen).
#

# read in some variables
. /studio/profile

if [ -f /etc/init.d/suse_studio_firstboot ]
then

echo "Running SUSE Studio first boot script..."
iptables -I INPUT -p tcp --dport 113 -j DROP
iptables -I INPUT -p icmp -j DROP
fi
That's a bit difficult to read: using code tags helps

Code:
#!/bin/bash
#
# This script is executed whenever your appliance boots. Here you can add
# commands to be executed before the system enters the first runlevel. This
# could include loading kernel modules, starting daemons that aren't managed
# by init files, asking questions at the console, etc.
#
# The 'kiwi_type' variable will contain the format of the appliance (oem =
# disk image, vmx = VMware, iso = CD/DVD, xen = Xen).
#

# read in some variables
. /studio/profile

if [ -f /etc/init.d/suse_studio_firstboot ]
then

echo "Running SUSE Studio first boot script..."
iptables -I INPUT -p tcp --dport 113 -j DROP
iptables -I INPUT -p icmp -j DROP
fi
is rather easier.

Quote:
Originally Posted by Tactful View Post
Hi, I need help with my firewall settings, and I prospected using the script option.


if [ -f /etc/init.d/suse_studio_firstboot ]
then

echo "Running SUSE Studio first boot script..."
iptables -I INPUT -p tcp --dport 113 -j DROP
iptables -I INPUT -p icmp -j DROP
fi
I never really like using -I for iptables; it would only take a change to what went on previously for the end result to be rather different. However, having said that, have you tried listing your iptables ruleset to check that the end result is what you expected? Presumably, you did check that /etc/init.d/suse_studio_firstboot exists?

Quote:
Originally Posted by Tactful View Post

if [ -f /etc/init.d/suse_studio_firstboot ]
then

echo "Running SUSE Studio first boot script..."
iptables -I INPUT -p tcp --dport 113 -j DROP
iptables -I INPUT -p icmp -j DROP
fi

As you can see I need to use the terminal commands of "iptables -I INPUT -p tcp --dport 113 -j DROP" and "iptables -I INPUT -p icmp -j DROP." Is there anything wrong with my script or should I even be using script in the first place?
Terminal commands? bash commands, really (there are shells other than bash). I can't see what other options there are other than a script, but maybe there is some other way of setting stuff up in Studio - there is in plain openSUSE (Yast), but I'm not sure about Studio.

By the way, in earlier versions of Suse, 'going behind Yast's back' was a recipe for confusion, as Yast had a habit of thinking that it knew best, and overwriting your changes. Oh, and Suse starts up its firewall in two stages, and if you make your changes while 'early' (whatever the first part is called) is in place, they'll get overwritten when 'final' is put in place.
 
Old 08-23-2011, 01:25 PM   #3
Tactful
LQ Newbie
 
Registered: Aug 2011
Posts: 10

Original Poster
Rep: Reputation: Disabled
I guess I might just try something else then. Anyways, thanks for making a contribution.
 
Old 08-24-2011, 01:39 AM   #4
Tactful
LQ Newbie
 
Registered: Aug 2011
Posts: 10

Original Poster
Rep: Reputation: Disabled
Talking

Nice, I got the predicament fixed. I could not have done it without you Salasi.
 
Old 08-24-2011, 02:42 AM   #5
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 4,070

Rep: Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897
Good news! Please mark the thread as solved.

You might also want to add a quick note on what the problem actually was, to help others who come across the thread from, eg, a network search.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: SUSE Studio 1.2 ships, SUSE Linux chief to roll out full cloud strategy soon LXer Syndicated Linux News 0 07-20-2011 07:41 PM
what exactly is suse studio? kdelover SUSE / openSUSE 2 09-05-2009 07:42 AM
LXer: SUSE Studio: Testdrive LXer Syndicated Linux News 0 07-31-2009 02:50 AM
LXer: First Look at SUSE Studio LXer Syndicated Linux News 0 04-05-2009 11:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE

All times are GMT -5. The time now is 11:10 PM.

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