LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-15-2013, 06:09 AM   #1
jitendra.sharma
Member
 
Registered: Mar 2013
Location: ahmedabad
Distribution: CentOS, Ubuntu, Debian
Posts: 92
Blog Entries: 1

Rep: Reputation: Disabled
share internet through NAT in iptables....


i have two lan card on my pc
eth0 - 172.16.0.254 ( Private )
eth1 - 10.0.3.12 ( public, Internet )

I want to route my packets Private to Public Network Via iptables rule......... i also want to share internet to my private network ....
Thanks with Warm regards
jitendra.sharma
 
Old 03-15-2013, 11:12 PM   #2
kirukan
Senior Member
 
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,274

Rep: Reputation: 148Reputation: 148
Google will be a good friend when you ask right questions..
http://www.cyberciti.biz/tips/linux-...-line-etc.html
try this link
 
Old 03-20-2013, 12:16 AM   #3
jitendra.sharma
Member
 
Registered: Mar 2013
Location: ahmedabad
Distribution: CentOS, Ubuntu, Debian
Posts: 92
Blog Entries: 1

Original Poster
Rep: Reputation: Disabled
i solved with this Commands:-

#iptables -I INPUT -P all -j ACCEPT
#iptables -I OUTPUT -P all -j ACCEPT
#iptables -I FORWARD -P all -j ACCEPT
#iptables -t nat -I POSTROUTING -j MASQUERADE
#service iptables save
 
  


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
[SOLVED] dhcp-server + iptables: Can't share ppp internet connection viniciusmassuchetto Linux - Networking 3 08-22-2011 06:29 AM
[SOLVED] Need help with NAT (share an internet connection) vwtech Linux - Networking 3 02-04-2011 01:47 PM
iptables: can't initialize iptables table `NAT' linuxgentoo Linux - Kernel 3 01-17-2010 10:15 AM
Arno's IPTables-Firewall Script To Share Internet dalponis Linux - Software 3 10-09-2007 11:06 AM
need to share internet using iptables badall Linux - Networking 1 05-25-2007 08:49 PM


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