LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices



Reply
 
Search this Thread
Old 12-20-2007, 02:53 AM   #1
kenwong
LQ Newbie
 
Registered: Nov 2006
Posts: 13

Rep: Reputation: 0
iptables on SUSE


Dear All

SUSE server IP is 192.168.0.25,because my firewall just can do 1 to 1 NAT, I want to 1 WAN IP can use in 2 different LAN

I would like to ask if I want to set NAT function, is it must have 2 lan card?
Can I just configure it with 1 lan card??

because I just want to redirect port 80 to my web server

I have write a script but it is not work? where do I wrong?


Please advice

Thanks


here is my script

#! /bin/bash

modprobe ip_nat_ftp
modprobe ip_tables

iptables -F
iptables -X
iptables -Z

iptables -t nat -F
iptables -t nat -X
iptables -t nat -Z

iptables -t mangle -F
iptables -t mangle -X
iptables -t mangle -Z

iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT

iptables -t nat -P INPUT ACCEPT
iptables -t nat -P OUTPUT ACCEPT
iptables -t nat -P FORWARD ACCEPT

iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to 192.168.0.5
 
Old 12-21-2007, 01:29 PM   #2
polar_bear
LQ Newbie
 
Registered: Nov 2007
Posts: 10

Rep: Reputation: 0
Try Shorewall

Not sure if it will help in this instance, but I have used Shorewall http://www.shorewall.net/index.htm with great success and can say it definitely makes setting up iptables easy, just like their tagline says. It works these things out for you by setting up simples rules, definitely worth checking into. Good luck!
 
  


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
iptables and suse 10.1 alaios Suse/Novell 0 02-06-2007 05:39 PM
iptables v1.2.9: Unknown arg `/sbin/iptables' Try `iptables -h' or 'iptables --help' Niceman2005 Linux - Security 4 12-29-2005 09:20 PM
Suse 9.1 and iptables Osiris123d Linux - Networking 5 08-19-2004 03:21 PM
Suse 9.1 iptables CobaltFire Linux - Networking 0 07-13-2004 03:49 AM
iptables on Suse 8.0 Loke Linux - Distributions 2 01-23-2003 05:46 PM


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