LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 03-21-2008, 06:57 AM   #1
em21701
Member
 
Registered: Feb 2008
Location: Rhode Island, USA
Distribution: Slackware12.2 & Slackware64-current
Posts: 265

Rep: Reputation: 40
Quick Firewall help needed


I have used Alien Bobs script generator to finally get the firewall on my laptop going. I KMyFirewall wouldn't work at all, it threw out all kinds of errors. GuardDog wouldn't let me get on the internet at all, a little too well guarded for my tastes. Anyhow, I used the script here and I am now up and running. My question is, since I am using a laptop I switch between a wired connection (eth0) and a wireless (wlan0), how do I put them both in the script? When I ran the generator I used eth0 in the Internet Interface field just to get it going. Can I even use the generator for more than one interface or do I have to edit the resulting script manually?

Thanks in advance,
Eric
 
Old 03-22-2008, 03:16 AM   #2
agentc0re
Member
 
Registered: Apr 2007
Location: SLC, UTAH
Distribution: Slackware
Posts: 200

Rep: Reputation: 34
I could be wrong about this BUT, i am almost positive that any iptables you add are permanent. Not sure how the script inputs them but they should always stay there, even if you run the script once. So you could create another script to just add wlan0 to those rules aswell. might just be easy enough to replace eth0 with wlan0
 
Old 03-22-2008, 04:08 AM   #3
sparker
Member
 
Registered: Aug 2007
Location: Canada
Distribution: OpenBSD 4.6, Debian Lenny
Posts: 64

Rep: Reputation: 16
You will most likely need to edit the script if you plan on using two different interfaces. But, if you plan on using the same rules for both interfaces you could remove the interface specification all together. This would then apply the rule to any interface I think.
 
Old 03-22-2008, 01:16 PM   #4
acummings
Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 615

Rep: Reputation: 50
Good idea, sparker, about interface.

Quick idea here only and my knowledge on iptables script is rather limited to say the least.

So do not use this until/unless you have already tried ways recommended by others.

If you do not get it working without both interface names in there:

(a possibility?): make another iptables script for your wlan0 interface.

Have the two (the eth0 and the wlan0) generated scripts saved as filename1 and filename2 on your hard drive.

Then diff those two (man diff; diff in bash; is it "kdiff" in KDE which is graphical)

copy/paste (combine) the two files based on the differences so that the result includes both what's common between the two and what's different (non repeat the common but include the common stuff once) *and* add in the difference from one file, add it to the other file.

But if one interface is not always active, at such time it is not active then (if you do my idea) errors might show during bootup when the firewall is activated (or thereabouts, I might have it slightly out of order since firewall likely is first then activate interface for use).
--
Alan.
 
Old 03-23-2008, 06:09 AM   #5
em21701
Member
 
Registered: Feb 2008
Location: Rhode Island, USA
Distribution: Slackware12.2 & Slackware64-current
Posts: 265

Original Poster
Rep: Reputation: 40
Thank you all, I haven't been home long enough in the last few days to give the wireless a try. Hopefully today I'll get a little while to play.
 
Old 03-24-2008, 07:28 AM   #6
em21701
Member
 
Registered: Feb 2008
Location: Rhode Island, USA
Distribution: Slackware12.2 & Slackware64-current
Posts: 265

Original Poster
Rep: Reputation: 40
OK I have tried the following and so far no wireless:

Comment out INET_IFACE="eth0" with the theory that it will apply to all connections -> no such luck.

Uncomment INET_IFACE="eth0" and add INET_IFACE="wlan0" -> also no luck

Comment out INET_IFACE="eth0" but leave INET_IFACE="wlan0" -> I though for sure that this would disable the wired connection and enable wireless. No wireless, didn't test wired.

I'm going to do some serious reading on IPTables today and see if I can find an answer.
 
Old 03-24-2008, 08:44 AM   #7
tsg
Member
 
Registered: Mar 2008
Posts: 155

Rep: Reputation: 30
Quote:
Originally Posted by em21701 View Post
OK I have tried the following and so far no wireless:

Comment out INET_IFACE="eth0" with the theory that it will apply to all connections -> no such luck.

Uncomment INET_IFACE="eth0" and add INET_IFACE="wlan0" -> also no luck

Comment out INET_IFACE="eth0" but leave INET_IFACE="wlan0" -> I though for sure that this would disable the wired connection and enable wireless. No wireless, didn't test wired.

I'm going to do some serious reading on IPTables today and see if I can find an answer.
I did a quick scan through the script. Commenting out INET_IFACE="eth0" will only serve to leave a bunch of "-i" parameters without an argument which will give you an error.

Find the commands with "-i INET_IFACE" and remove that portion from the command and it should apply to all interfaces.

But, if it didn't work on the wireless interface by adding INET_IFACE="wlan0", my guess is that it probably won't solve your problem.
 
Old 03-24-2008, 02:16 PM   #8
acummings
Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 615

Rep: Reputation: 50
Also once edit rc.firewall

After edit, you need to then get the actual (live) firewall itself re-implemented

To do so, as root

root # /etc/rc.d/rc.firewall stop

then

root # /etc/rc.d/rc.firewall start

or there may be option of restart that would do the job all in one step instead of using/doing two steps via the use of stop and then start

--
Alan.
 
Old 03-24-2008, 04:11 PM   #9
em21701
Member
 
Registered: Feb 2008
Location: Rhode Island, USA
Distribution: Slackware12.2 & Slackware64-current
Posts: 265

Original Poster
Rep: Reputation: 40
I restarted the computer to be sure the script was run after each time I changed it. I think tonight I am going to try turning off the firewall completely and see what happens. I just want to be sure I am actually attacking the problem or is there something else causing the trouble. There is a section of the script that removes the firewall completely each time it is run, I'm going to copy out that section and put it into it's own script to hopefully return the computer to normal. From there I'll put stuff back and see where it breaks.
 
  


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
Quick Response needed syedjanu Linux - General 3 06-15-2006 04:21 AM
Command needed to do a quick check if a diskette is in the drive thnkrh Programming 1 03-19-2006 06:49 PM
Quick recomendation needed benrose111488 Linux - Hardware 1 06-24-2005 08:25 PM
quick cron reminder needed jedimastermopar Linux - General 1 05-26-2005 04:09 PM
quick help needed starting up, please nenglish Linux - Software 1 07-11-2004 10:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 05:03 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