LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 06-03-2003, 09:03 AM   #1
acpi
LQ Newbie
 
Registered: May 2003
Distribution: Slack 8.1, RH 8.0
Posts: 13

Rep: Reputation: 0
Masquerading between two Local Networks


Hello,

I'm trying to set up masquerading between two local networks, infact I've only three computers one of which is the gateway. I could set the ip-forwarding but how can I set up AND DETERMINE that there is a MASQUERADING running?
The clients are linux machines and are congured properly(gateway, dns).
The packet forwarding is working.
At the gateway side i try the following rules:
iptables -t nat -POSTROUTING -SNAT -s 192.168.2.0/24 --to 192.168.9.1
iptables -t nat -POSTROUTING -SNAT -s 192.168.9.0/24 --to 192.168.2.1
I'm using the netsniffer tcpdump to determine if there occurs masquerading, but it seems that it intercepts all the traffic in the networks ingnoring if there is masqerading or not.
Any help would be appreciated.

acpi
 
Old 06-03-2003, 09:29 AM   #2
manthram
Member
 
Registered: Feb 2002
Location: Fairfax, VA
Distribution: RedHat 8, Mandrake9.1, Slack9
Posts: 456

Rep: Reputation: 31
if you are sharing the internet connection and if you can ping out side network form the internal macines then you have ip masq
 
Old 06-03-2003, 09:40 AM   #3
jharris
Senior Member
 
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243

Rep: Reputation: 47
Re: Masquerading between two Local Networks

Quote:
Originally posted by acpi
iptables -t nat -POSTROUTING -SNAT -s 192.168.2.0/24 --to 192.168.9.1
iptables -t nat -POSTROUTING -SNAT -s 192.168.9.0/24 --to 192.168.2.1
Shouldn't this be
Code:
iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to 192.168.9.1
iptables -t nat -A POSTROUTING -o eth1 -j SNAT --to 192.168.2.1
Where eth0 is 192.168.9.1 and eth1 is 192.168.2.1.

But - as these are both subnets with valid IPs whey are you using NAT instead of just forwarding the packets?

cheers

Jamie...
 
Old 06-04-2003, 03:40 AM   #4
acpi
LQ Newbie
 
Registered: May 2003
Distribution: Slack 8.1, RH 8.0
Posts: 13

Original Poster
Rep: Reputation: 0
The exact rules are:
iptables -t nat -A POSTROUTING -j SNAT -s 192.168.2.0/24 --to 192.168.9.1
iptables -t nat -A POSTROUTING -j SNAT -s 192.168.9.0/24 --to 192.168.2.1
My goal ist to SHOW that MASQUERADING is actually taking place, otherwise masquerading is used for dialup and leased line connections, but once again I wanted to show the technology in action.

acpi
 
Old 06-04-2003, 03:56 AM   #5
jharris
Senior Member
 
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243

Rep: Reputation: 47
And if you use the lines I supplied what happens?

cheers

Jamie...
 
Old 06-05-2003, 07:09 AM   #6
acpi
LQ Newbie
 
Registered: May 2003
Distribution: Slack 8.1, RH 8.0
Posts: 13

Original Poster
Rep: Reputation: 0
Well the strange thing is that I've masquerading up at home, but at the Uni with analogous configuration(2 end-compis and 1 GW), I can't make it to work.
And also at home, when the masquerading is in action i can ping only in the one direction, namely from the source(to be masqueraded) network to the destination(receiving masqueraded packets) network.

Best regards
acpi
 
Old 06-05-2003, 08:35 AM   #7
jharris
Senior Member
 
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243

Rep: Reputation: 47
Quote:
Originally posted by jharris
And if you use the lines I supplied what happens?
Quote:
Originally posted by acpi
And also at home, when the masquerading is in action i can ping only in the one direction, namely from the source(to be masqueraded) network to the destination(receiving masqueraded packets) network.
Thats correct. You can't ping the other was as whatever is behing the masquerader is hidden, and in most cases doesn't have a public IP address so there is no direct route to it anyway.

cheers

Jamie...
 
  


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
Setup local machine to allow lan machines to retrieve its local user mail. Brian1 Linux - Networking 3 03-30-2006 05:04 AM
Local webserver -- How to deny all client install their local web server--Please help b:z Linux - Networking 13 04-16-2005 07:11 PM
Cannot resolve local addresses on local network danielgrenyer Linux - Networking 6 01-14-2004 11:03 AM
Does samba only work on local networks? VirtueTech Linux - Networking 4 07-13-2003 01:25 PM
Does samba only work on local networks? VirtueTech Linux - Security 0 07-12-2003 11:37 PM

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

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