Link to home
Start Free TrialLog in
Avatar of palanisaravanan
palanisaravanan

asked on

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

SOLUTION
Avatar of jlevie
jlevie

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of palanisaravanan
palanisaravanan

ASKER

Let me get U a clear picture.
If u want to connect for 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?
If u want to connect for one network to another u can do routing by tw0
       READ THIS LINE AS
If u want to connect from one network to another u can do routing by two

     
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial