LinuxQuestions.org
Help answer threads with 0 replies.
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 10-23-2008, 01:12 AM   #1
jnreddy
Member
 
Registered: May 2008
Location: INDIA
Distribution: RHEL
Posts: 171

Rep: Reputation: 15
netfilter/NAT


Hi everyone


Am using rhel5, i confused and want to clarify one thing am planning to implement iptables and natting. First thing what i want to know is Nat,DNS DHCP,HTTP,NFS,ftp and iptables should be in the same Box, or natting and iptables should be in separate boxes.I have a public IP for natting. i know i require two lan cards one for public and one for private,after assigning IP addresses to each what to do for natting, do i need to install any rpms plz guide me how to do?

Thanks in Advance
jnreddy
 
Old 10-23-2008, 01:50 AM   #2
shahz
Member
 
Registered: Sep 2006
Location: Quetta, Pakistan
Distribution: RHEL, Ubuntu, Fedora
Posts: 368

Rep: Reputation: 29
you can check if the rpm is installed with the command.

rpm -q iptables

if it list the iptables rpm then its already installed.

for other things try googling.

thanks
shahz
 
Old 10-23-2008, 03:12 AM   #3
jnreddy
Member
 
Registered: May 2008
Location: INDIA
Distribution: RHEL
Posts: 171

Original Poster
Rep: Reputation: 15
Its alredy installed

thanq shahz
iptables rpm is installed, do i need to install any rpm for NATTing?
is iptables rpm is enough for Natting.

Thanks In Adavnce
jnreddy
 
Old 10-23-2008, 06:39 AM   #4
Yaniv-Fer
Member
 
Registered: Feb 2006
Distribution: Fedora,Solaris
Posts: 46

Rep: Reputation: 15
Hi,


if i remember right...

the minimum you need to do is:


enable ip forwarding on your linux server(you gateway for the other users)


sysctl -w net.ipv4.ip_forward=1"

if you would like to make this changes permanent edit

vi /etc/sysctl.conf

and change the zero to 1

# Controls IP packet forwarding
net.ipv4.ip_forward = 0



and create a NAT rule via iptables....



here is what i did.... but you should read about iptables to understand what you are doing... i guess your host is exposed to the internet... so the "flush" part would delete all your rules... take care...



[root@m~]# iptables --flush
[root@m~]# iptables --table nat --flush
[root@m~]# iptables --table nat --delete-chain
[root@m~]# iptables --table nat --append POSTROUTING
--out-interface eth0 -j MASQUERADE
[root@m~]# iptables --append FORWARD --in-interface eth1 -j ACCEPT



eth0 is the external interface 1.2.3.4

eth1 is the internal interface 10.10.x.x (to masquerade)


good luck
 
Old 10-23-2008, 07:20 AM   #5
jnreddy
Member
 
Registered: May 2008
Location: INDIA
Distribution: RHEL
Posts: 171

Original Poster
Rep: Reputation: 15
Thanq so much

Thanks Yanic Fer
Tomorrow i implement the same what you said and get back to you

Thanks In Advance
jnreddy
 
  


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
LXer: Designing and Implementing Linux Firewalls and QoS using netfilter, iproute2, NAT, and L7-filter LXer Syndicated Linux News 0 02-15-2007 09:46 PM
H.323 NAT Netfilter conntrack 2.6 Kernel core support avtechs Linux - Networking 0 05-24-2006 01:12 PM
What's the difference between Linux-NAT and Sygate-NAT? yuzuohong Linux - Networking 0 08-07-2002 04:07 AM
Redhat 7.2 and Redhat 7.3 NAT,Netfilter and Iptsable guanyu Linux - Networking 1 06-21-2002 07:38 AM
netfilter + nat + sshd on localhost r3b00t Linux - Security 2 05-24-2001 10:33 AM

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

All times are GMT -5. The time now is 05:11 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
Open Source Consulting | Domain Registration