LinuxQuestions.org
Help answer threads with 0 replies.
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 10-02-2008, 06:08 AM   #1
saavik
Member
 
Registered: Nov 2001
Location: NRW, Germany
Distribution: SLES / FC/ OES / CentOS
Posts: 614

Rep: Reputation: 32
iptables NAT to ip pool


Hello!

I would like to NAT on net to the other net, but I can not always user the same ip as:

Quote:
iptables -t nat -A POSTROUTING -s 10.0.0.0/8 -o eth1 -j SNAT --to 188.0.0.1
would do.

So I found this

http://lists.netfilter.org/pipermail...ch/008924.html

page which says that I can use a ip pool as SNAT --to option.

When i type :

Quote:
# iptables -t nat -A POSTROUTING -s 10.0.0.0/8 -o eth1 -j SNAT --to 192.193.50.0/24
iptables v1.3.5: Bad IP address `192.193.50.0/24'
What is my mistake ?

Do both net`s have to be class "A" ? I am on RTFM .....

Last edited by saavik; 10-02-2008 at 06:20 AM.
 
Old 10-02-2008, 06:23 AM   #2
saavik
Member
 
Registered: Nov 2001
Location: NRW, Germany
Distribution: SLES / FC/ OES / CentOS
Posts: 614

Original Poster
Rep: Reputation: 32
Ok, I got it working with

Quote:
iptables -t nat -A POSTROUTING -s 10.0.0.0/8 -o eth1 -j SNAT --to 9.0.0.0-9.255.255.255
 
  


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
iptables: can't initialize iptables table `NAT' linuxgentoo Linux - Kernel 3 01-17-2010 10:15 AM
IPTABLES and NAT metallica1973 Linux - Security 7 09-07-2007 09:08 PM
NAT pool with iptables? doza Linux - Networking 1 11-24-2004 12:26 PM
NAT with Pool of valid IP persian Linux - Networking 3 07-20-2004 10:13 AM
IPTABLES : build NAT using IPTABLES joseph Linux - Networking 4 04-23-2004 05:08 AM

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

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