LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-23-2007, 03:23 AM   #1
Wynd
Member
 
Registered: Jul 2001
Distribution: Slackware 12
Posts: 511

Rep: Reputation: 32
2.4->2.6: Firewall problems


I upgraded my kernel to 2.6.20.3 today. My firewall, which previously worked fine with my 2.4.33.3 kernel, now does not allow any traffic at all. Can someone look at the script and help me out?

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

IPT=/usr/sbin/iptables

###############################
# Load modules
#

echo "Loading kernel modules..."
modprobe ip_tables
modprobe ip_conntrack
modprobe iptable_filter
modprobe ipt_state
modprobe ip_conntrack_ftp

echo "Flushing rules..."
$IPT -F INPUT
$IPT -F OUTPUT

if [ "$1" == "stop" ]; then
	$IPT -P INPUT ACCEPT
	$IPT -P OUTPUT ACCEPT
	echo
	echo "*** Rules flushed - now running with no firewall!"
	echo
	exit
fi

###############################
# Rules for incoming packets
#

echo "Applying INPUT rules..."

# Default policy: Deny everything there isn't a rule for
$IPT -P INPUT DROP

# Allow computer to access itself via loopback interface
$IPT -A INPUT -i lo -j ACCEPT

# Allow "related" packets
$IPT -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

# Allow inbound SSH
$IPT -A INPUT -p tcp --destination-port 22 -j ACCEPT

# Allow inbound Samba
$IPT -A INPUT -p udp --dport 137:138 -j ACCEPT
$IPT -A INPUT -p tcp -m multiport --dports 139,445 -j ACCEPT

###############################
# Rules for outgoing packets
#

echo "Applying OUTPUT rules..."

# Default policy: Allow everything there isn't a rule for
$IPT -P OUTPUT ACCEPT

echo "Firewall up."
 
Old 03-23-2007, 12:21 PM   #2
Wynd
Member
 
Registered: Jul 2001
Distribution: Slackware 12
Posts: 511

Original Poster
Rep: Reputation: 32
Well, I fixed it. Turns out I missed some of the netfilter modules in the kernel compile.
 
  


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
Firewall Problems Hambone_20003 Linux - Software 1 08-27-2006 06:33 PM
Firewall Problems Rick069 Linux - Security 2 08-16-2005 10:20 AM
Firewall problems Dummy-in-Linux Linux - Newbie 5 06-17-2004 02:36 AM
Firewall Problems susesarus Linux - Newbie 5 08-04-2003 05:30 AM
Firewall problems lcadwell Linux - Networking 5 08-07-2001 04:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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