LinuxQuestions.org
Visit Jeremy's Blog.
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-03-2013, 02:17 AM   #1
crspy
LQ Newbie
 
Registered: Apr 2013
Posts: 4

Rep: Reputation: Disabled
iptables nat rules


Quote:
iptables -t nat -A POSTROUTING -s 10.0.0.0/24 -j SNAT --to-source 1.1.1.1
iptables -t nat -A POSTROUTING -m iprange --src-range 10.0.0.0-80 -j SNAT --to-source 1.1.1.1

I understand that the top line will route ip address from 10.0.0.0-256 through 1.1.1.1, I'm attempting to limit only the first 80 to go through 1.1.1.1 and 81-125 go through 1.1.1.2, is the command correct?


I understand that the top line will route ip address from 10.0.0.0-256 through 1.1.1.1, I'm attempting to limit only the first 80 to go through 1.1.1.1 and 81-125 go through 1.1.1.2, is the command correct?

I keep getting the error no chain/target/match by that name when I run the 2nd command.

Last edited by crspy; 05-03-2013 at 02:24 AM.
 
Old 05-03-2013, 04:44 AM   #2
cociugcristina
LQ Newbie
 
Registered: Aug 2003
Location: romania
Posts: 8

Rep: Reputation: 0
iptables nat rules

You have to check source range source IP range because that one mentioned: 10.0.0.0-80 is taken like 10.0.0.0-80.0.0.0
 
  


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
iptables rules to limit nat forwarding sleepylight Linux - Security 1 07-19-2012 07:06 PM
Programming iptables rules for 1:1 NAT jacques83 Linux - Security 18 09-21-2010 06:07 PM
IPTABLES rules for NAT of machines through the PPP interface MarkEHansen Linux - Networking 6 06-15-2007 02:19 PM
iptables rules for emule in nat box eantoranz Linux - Networking 3 08-08-2005 10:37 PM
iptables -t nat -L not showing all rules alpha-wolf Linux - Networking 0 08-14-2001 07:36 AM


All times are GMT -5. The time now is 11:43 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration