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 04-21-2004, 08:21 AM   #1
palanisaravanan
Member
 
Registered: Oct 2003
Location: India
Distribution: Debian
Posts: 95

Rep: Reputation: 15
One interesting question


I have a machine called A with IP address 192.168.1.1/netmask 255.255.255.0

Another machine B with 192.168.1.2/netmask 255.255.255.0

There is no gateway entry specified in routing.
Their routing table is
For A
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
For B
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0


Now I am able to ping A to B as well as B to A

Now i want to put these two machines in a Separate network without changing the IP ADDRESS&netmask.How to do that?.(if machines are in physically sepated network they should not excahnge packets using dev as my case.They can use only gateway).
Simply speaking I shud not be able to ping form A to B or vice versa if they are separate network) . Without using gateway I want to achieve the goal.
Any ideas.Thanks in advance

Last edited by palanisaravanan; 04-21-2004 at 08:23 AM.
 
Old 04-21-2004, 08:42 AM   #2
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,215

Rep: Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849
Machines belong to the same network for more than one reason. There is the physical connection. If they are not separated by a router function, then they are onthe same network. The second item to consider is the ip addresses. 192.168.1.x is a private ip network. class C. The addresses you are using belong to the same network. To change them to different networks, you will have to change the ip address of one. You could leave A as 192.168.1.1 and change B to 192.168.2.X.

If you change ip addresses you will have to do routing between the machines, assuming you do want them to talk.

Hope this helps.
 
Old 04-21-2004, 09:39 AM   #3
palanisaravanan
Member
 
Registered: Oct 2003
Location: India
Distribution: Debian
Posts: 95

Original Poster
Rep: Reputation: 15
Let me get U a clear picture.
If u want to connect from one network to another u can do routing by two ways.
one is
route add -net 192.168.0.0 netmask 255.255.255.0 dev eth0

another one is

route add -net 192.168.0.0 netamask 255.255.255.0 gw 192.168.1.1
(ip_forward is enabled)
MY QUESTION IS
packets should be sent to another network only if routing is done using gateway.
Packets should not be sent to another network if the routing is done using dev.
how to do that?
in my case if the routing is done using dev they are not a physically sepated network.I can call them physically separate one only if they are talking using a gateway

Last edited by palanisaravanan; 04-21-2004 at 11:57 AM.
 
  


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
Interesting C Question ar1 Programming 2 05-07-2005 10:24 AM
Interesting (My)SQL question rjlee Programming 9 03-07-2005 08:23 AM
Interesting Java question deveraux83 Programming 6 07-08-2004 01:06 PM
An Interesting question about a fresh install gamehack Debian 5 01-27-2004 02:04 PM
Interesting Network/Internet question ChaosX2 Linux - Networking 9 10-03-2001 10:51 AM

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

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