LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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, 01: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, 12: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



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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