LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 06-01-2006, 09:58 AM   #1
huanvnn
LQ Newbie
 
Registered: May 2006
Posts: 20

Rep: Reputation: 0

hi everybody i am a new member of forums. I have a question,please help me :
i have a static public IP 212.40.41.34 (eth1) and private ip 192.168.0.1 and i want to share this internet connection with eth1 with some computers in my rooms,in my /etc/sysconfig/iptables i wrote
*mangle
:PREROUTING ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
COMMIT
*nat
:PREROUTING ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A POSTROUTING -d ! 192.168.0.1 -j SNAT --to-source 212.40.41.34
COMMIT

*filter
:PREROUTING ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
COMMIT

and everything is terrible can anyone tell me why ? thanks thanks
 
Old 06-01-2006, 09:50 PM   #2
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 69
Please start a new thread for your questions unless you are directly responding to the existing thread. I'm moving your question to it's own thread.
 
Old 06-02-2006, 01:31 AM   #3
jayakrishnan
Member
 
Registered: Feb 2002
Location: India
Distribution: Slacky 12.1, XP
Posts: 992

Rep: Reputation: 30
What distro are u using?
 
Old 06-02-2006, 02:39 AM   #4
huanvnn
LQ Newbie
 
Registered: May 2006
Posts: 20

Original Poster
Rep: Reputation: 0
in the first post i didnt exactly wrote at the line
-A POSTROUTING -d ! 192.168.0.1 -j SNAT --to-source 212.40.41.34
and should substitute with
-A POSTROUTING -d ! 192.168.0.0/24 -o eth1 -j SNAT --to-source 212.40.41.34
eth1 : public ip connected to isp
*mangle
:PREROUTING ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
COMMIT
*nat
:PREROUTING ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A POSTROUTING -d ! 192.168.0.0/24 -j SNAT --to-source 212.40.41.34
COMMIT

*filter
:PREROUTING ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
COMMIT
but it still doesnt work , now i use fedora core2 .
thanks for every consult
 
Old 06-02-2006, 09:05 PM   #5
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 69
Do you have more than 1 interface?

Have you enabled packet forwarding in the kernel yet
(echo 1 > /proc/sys/net/ipv4/ip_forward)?
 
  


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
Question about IPtables/firewall rules ilan1 Linux - Security 3 02-20-2006 11:58 PM
IPTABLES - rules in /etc/sysconfig/iptables The_JinJ Linux - Newbie 6 11-20-2004 01:40 AM
iptables rules puding Linux - Networking 2 08-09-2004 10:46 PM
IPTables rules dkny01 Linux - Networking 6 10-23-2003 12:52 AM
Full iptables rules flush question NetScripter Linux - General 7 09-17-2003 01:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

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