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 12-18-2009, 12:05 AM   #1
sanjibgupta
Member
 
Registered: Apr 2003
Location: Kolkata
Posts: 215

Rep: Reputation: 30
MASQUERADE problem


I have a network with 3 NIC
1. (eth0-> 203.197.xxx.9) Global IP directly connected to the Internet
2. (eth1->202.142.xxx.34 gateway of the network is 202.142.xxx.33)Global IP connected to the Internet through a router with LOCAL LAN (192.168.20.0/24) running on that network
3. (eth2)Local LAN

My server runs ok when all NIC are up. My script is written that when eth0 fails to communicate the Local Lan is masqueraded to eth1.

-A POSTROUTING -s 192.168.50.0/24 -o eth1 -j MASQUERADE

This works fine for INTENET browsing and even lets me to telnet to computers that the connection to the LOCAL LAN of the eth1 from machines of eth2 network.

But the problem lies is that my IP of eth2 masquerade to the GLOBAL IP restricting me to perform some specific jobs which are based from the eth2 (192.168.50.0/24) where the some machines are given permission depending on the their IP.

Please can any one help me to say how I can perform this operation or how I can move in my Local Lan (i.e eth0->203.197.xx.0/27, eth1->202.142.0.xx/24 and 192.168.20.0/24) without getting masqueraded.

Sanjib Gupta

File -> /etc/rc.local

echo "1" > /proc/sys/net/ipv4/ip_forward
route add -net 172.168.10.0 netmask 255.255.255.0 gw 192.168.50.99
route add -net 202.142.xxx.0 netmask 255.255.255.0 gw 202.142.xxx.33
route add -net 192.168.20.0 netmask 255.255.255.0 gw 202.142.xxx.33
route add -net 192.168.10.0 netmask 255.255.255.0 gw 202.142.xxx.33
route add -net 192.168.60.0 netmask 255.255.255.0 gw 202.142.xxx.33
route add -net 192.168.65.0 netmask 255.255.255.0 gw 202.142.xxx.33
route add -net 192.168.70.0 netmask 255.255.255.0 gw 202.142.xxx.33
 
Old 12-18-2009, 05:01 PM   #2
nimnull22
Senior Member
 
Registered: Jul 2009
Distribution: OpenSuse 11.1, Fedora 14, Ubuntu 12.04/12.10, FreeBSD 9.0
Posts: 1,571

Rep: Reputation: 92
Have you try to use:

IPTABLES -t nat -A POSTROUTING -o eth<X> -j SNAT --to-source <IP>
 
  


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 masquerade nat portforwarding problem borborygmis Linux - Networking 5 08-14-2008 01:51 AM
little problem with Masquerade and samba zeroboys Linux - Networking 0 10-07-2004 05:55 PM
masquerade problem (internet sharing) Pres Linux - Networking 4 04-27-2004 09:24 AM
Route/Masquerade problem spony Linux - Networking 5 01-06-2004 09:59 AM
very weird ip-masquerade problem. saturn_vk Linux - Networking 3 11-10-2003 12:42 PM

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

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