LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 03-31-2011, 12:09 AM   #1
Senthilv
Member
 
Registered: Jan 2011
Posts: 66
Blog Entries: 2

Rep: Reputation: 0
iptables Nat Configuration


Hai all,
I have configured Nat in this way , Actually i don't known meaning of this following line , can any tell me meaning of these.....


iptables --flush
iptables --delete-chain
iptables --table nat --delete-chain
iptables --table nat --append POSTROUTING --out-interface eth1 -j MASQUERADE
iptables --append FORWARD --in-interface eth2 -j ACCEPT


I am using two Ethernet card , one for getting internet from isp and another one for connecting to the Lan......

I don't how it works , tell me meaning of the above line......
 
Old 03-31-2011, 02:05 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
well firstly you can find what these mean but reading the man page or other iptables documentation. Only the last two are actively related to nat, the first three just make sure there's nothing else already configured. so line 4 says that all traffic leaving eth1 is to have it's source address changed to the address configured on that interface, and the 5th line says that all traffic trying to pass through (so *through* the box, not *to* the box) the machine by entering on eth2 should be allowed, meaning it will then potentially be subjected to the logic in line 4.
 
  


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
Another iptables nat configuration question 3a2roub Linux - Security 4 02-22-2011 04:35 PM
LINUX NAT firewall configuration using IPTables slugman92 Linux - Security 3 02-21-2011 07:45 PM
LINUX NAT firewall configuration using IPTables HELP slugman92 Linux - Newbie 1 02-21-2011 04:58 AM
iptables: can't initialize iptables table `NAT' linuxgentoo Linux - Kernel 3 01-17-2010 10:15 AM
LXer: Step-By-Step Configuration of NAT with iptables LXer Syndicated Linux News 0 11-22-2006 01:54 PM

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

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