LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 05-15-2013, 06:48 AM   #1
sanjibgupta
Member
 
Registered: Apr 2003
Location: Kolkata
Posts: 215

Rep: Reputation: 30
Nating


Hi
Presently I am doing SNAT for my local LAN IP to global ip except for the networks 192.168.0.0/16.

I am able to do so with
-A POSTROUTING -s 172.168.5.0/24 -d ! 192.168.0.0/16 -o eth0 -j SNAT --to-source 202.xxx.xx.xx

But now i also stop SNATING to 172.168.0.0/16 along with 192.168.0.0/16 from the local LAN.

Please help me to do so.

Thanking you
Sanjib Gupta
 
Old 05-15-2013, 11:10 AM   #2
Ygrex
Member
 
Registered: Nov 2004
Location: Russia (St.Petersburg)
Distribution: Debian
Posts: 666

Rep: Reputation: 68
it is quite easy with a custom chain:
Code:
iptables -t nat -N sub-postrouting
iptables -t nat -A sub-postrouting -d 192.168.0.0/16 -j RETURN
iptables -t nat -A sub-postrouting -d 172.168.0.0/16 -j RETURN
iptables -t nat -A sub-postrouting -j SNAT --to-source 202.xxx.xx.xx
iptables -t nat -A POSTROUTING -s 172.168.5.0/24 -o eth0 -j sub-postrouting
 
1 members found this post helpful.
  


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
Nating raj47 Linux - Networking 1 05-18-2012 02:05 PM
Nating problem incoming receives from static ip outgoing goes from firewall nating ip jsaravana87 Linux - Networking 1 11-16-2011 06:12 PM
NATing arul_redhat Linux - Networking 3 02-27-2009 05:41 AM
NATing rajaguru14 Linux - Newbie 1 02-27-2009 05:11 AM
Nating ... suvajit Linux - Networking 3 05-15-2003 07:09 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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