LinuxQuestions.org
Review your favorite Linux distribution.
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 07-13-2004, 02:49 AM   #1
CobaltFire
LQ Newbie
 
Registered: Jul 2004
Posts: 1

Rep: Reputation: 0
Question Suse 9.1 iptables


I am using linux for the first time, and I am having problems setting up Suse 9.1 to perform NAT. I have the machine accessing the internet, but cannot get it to find iptables. Every tutorial I have read deals with RH or Debian, and Suse seems to be rather unique. Can someone help me with this, or is it perhaps better to use Slackware 10.0, which I also have? Keep in mind that I am learning as I go, so slackware may be a little above my curve right now, but I am willing to give it a try. Anyhow, the specific problem I am having is getting the iptables module to load. Does it need to load, or is it already compiled into the kernal, and if it is, where are the files I need to reference to run my firewall (e.g. /sbin/iptables)? Any help or suggestions would be greatly appreciated. currently, this is the script I have running (from this site's Wiki):

#!/bin/sh

ipt=/sbin/iptables
lan=192.168.0.0/24 # your LAN


# start firewall
start_firwall {

echo "Enabling IP forwarding."
echo 1 > /proc/sys/net/ipv4/ip_forward

echo "Enabling iptables firewall."
# default policies
$ipt -P INPUT DROP
$ipt -P FORWARD DROP

# NAT
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE


# INPUT chain
$ipt -A INPUT -i lo -j ACCEPT
$ipt -A INPUT -i eth0 -s $lan -j ACCEPT
$ipt -A INPUT -i eth1 -m state --state ESTABLISHED,RELATED -j ACCEPT
$ipt -A INPUT -p tcp --destination-port 22 -j ACCEPT

# FORWARD chain
$ipt -A FORWARD -i eth0 -s $lan -j ACCEPT
$ipt -A FORWARD -i eth1 -m state --state ESTABLISHED,RELATED -j ACCEPT
}
# stop firewall
stop_firwall {

$ipt -P INPUT DROP
$ipt -P OUTPUT DROP
$ipt -P FORWARD DROP
# allow internal traffic
$ipt -A INPUT -i eth0 -j ACCEPT
$ipt -A OUTPUT -o eth0 -j ACCEPT
}
# flushing, removing and zeroing tables
reset_firwall {

chains=`cat /proc/net/ip_tables_names`
for i in $chains; do
$debug $ipt -t $i -F
$debug $ipt -t $i -X
$debug $ipt -t $i -Z
done
}
case "$1" in

start|restart|reload)
reset_firewall
start_firewall
;;
stop)
reset_firewall
stop_firewall
;;
*)
echo "Usage: $0 {start|stop|restart|reload}"
exit 1
;;
esac exit 0

Now, I don't understand everything here, but I think this should work (yes, eth0 is my local, eth1 is my net). Once again, any help would be appreciated.
 
  


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
Is anything beyond iptables v1.2.11 compatible with SuSE 9.2??? mikfig SUSE / openSUSE 1 11-02-2005 11:36 PM
Iptables in Suse Sles 9.0 Mishra100 Linux - Newbie 1 01-01-2005 09:22 AM
Suse 9.1 and iptables Osiris123d Linux - Networking 5 08-19-2004 02:21 PM
iptables on Suse 8.0 Loke Linux - Distributions 2 01-23-2003 04:46 PM
iptables on Suse 8.0 Sigmund Gudvang Linux - Distributions 1 10-02-2002 01:01 PM

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

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