Solved

interesting question - no gateway

Posted on 2010-08-21
21
283 Views
Last Modified: 2012-05-10
Ok may sound weird , but here it goes...


Can i access and communicate with a machine in a different network if I have a router in my network , BUT my machine doesn't have a gateway ?

Is that possible ?
0
Comment
Question by:its_ns_04
  • 9
  • 8
  • 3
  • +1
21 Comments
 
LVL 13

Expert Comment

by:Surone1
ID: 33492814
yes. the gateway setting just determines how you reach the internet
0
 
LVL 24

Accepted Solution

by:
B H earned 250 total points
ID: 33492843
if your machines are on the same subnet, yes... they'll arp eachother and find eachother.

but if one is on the opposite side of a router, you need either a gateway entry on both machines, or a static route on both machines.

the gateway setting just says "and everything else goes to here"
a static route entry would say "for this guy, go to [some gateway]"
0
 
LVL 1

Author Comment

by:its_ns_04
ID: 33492881
In this scenario, there are two machines A and B, but on different subnets... B is well configured with its gateway, however, there is no static route or gateway configured in A.

There is a router D which connects both LANS of A & B . Now how about in this case, will A be able to communicate with B ?
0
 
LVL 1

Author Comment

by:its_ns_04
ID: 33492885
is there any way which makes A be able to communicate with B (without configuring static route and gateway in A)
0
 
LVL 24

Expert Comment

by:B H
ID: 33492932
we need ip addresses to say for sure... but...

if A is 192.168.0.5, 255.255.255.0
if D is 192.168.0.1, 255.255.255.0
if B is 192.168.1.5, 255.255.255.0
if the router for machine B is 192.168.1.1, 255.255.255.0

then you'll need a static route on both machines, like:
for machine A:  route add 192.168.1.0 MASK 255.255.255.0 192.168.0.1 METRIC 2
for machine B:  route add 192.168.0.0 MASK 255.255.255.0 192.168.1.1 METRIC 2

add a -p switch in there to make it stick forever

0
 
LVL 24

Expert Comment

by:B H
ID: 33492934
this is assuming there's a vpn tunnel handled by the routers as you seemed to indicate
0
 
LVL 1

Author Comment

by:its_ns_04
ID: 33493214
ok it goes like this
A is 192.168.1.2, 255.255.255.0
 B is 192.168.2.2, 255.255.255.0
D is a router with two interfaces 192.168.1.5/32 and 192.168.2.5/32

A's gateway is not defined and there is no static route in A either. Can A still communicate with B somehow via D ?
0
 
LVL 24

Expert Comment

by:B H
ID: 33493516
If they are different interfaces in the router, you'll need to create a firewall rule to allow them to talk, then set both subnets to 255.255.0.0
0
 
LVL 1

Author Comment

by:its_ns_04
ID: 33494803
where is again "firewall" coming here into the picture ?
0
 
LVL 1

Author Comment

by:its_ns_04
ID: 33494808
ok. I think still I can make A talk with B without configuring gateway of A.

I can enable "proxy ARP" in the router D and with this feature, I will be able to talk with B from A, even though A's gateway is not configured. This is what I was looking for.

0
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 
LVL 24

Expert Comment

by:B H
ID: 33495732
the router D ....  i mentioned firewall because you mentioned multiple lan interfaces...

usually, a router would have one wan interface and one lan interface (with 4 physical ports)

however, if your router has for example two different lan interfaces like lan1 and lan2 ... then that router would need to be configured to allow traffic between lan1 and lan2.  by default, lan1 could access wan1... lan2 could access wan1...but lan1 and lan2 wouldn't be able to see each other.

proxy arp would allow them to see eachother, but you might still need a firewall rule in the router to allow the actual traffic.

gateways still wouldn't be required on the network cards, as long as the router can handle the two interfaces properly
0
 
LVL 1

Author Comment

by:its_ns_04
ID: 33496267
router's job is to route traffic :)
0
 
LVL 24

Assisted Solution

by:B H
B H earned 250 total points
ID: 33496288
yeah but it's job is also to police the interfaces that it manages.

if your two lan networks are connected via a switch, OR the same interface of the router, then the router doesn't care.

but - if your networks have to traverse two different interfaces on the router, then the router has to be configured to allow or deny that
0
 
LVL 25

Expert Comment

by:Fred Marshall
ID: 33496723
It seems that nobody asked: Why no gateway entry on A?
0
 
LVL 1

Author Comment

by:its_ns_04
ID: 33510608
well, this is just a test scenario. And the main question here is, is it possible not to have gateway defined in A and still make things work
0
 
LVL 24

Expert Comment

by:B H
ID: 33514603
router's job is to route traffic - across interfaces that ARP cannot traverse.

so - same subnet, same switch/interfce things will work without a gateway (locally).  but if they are on different interfaces in the router, the router needs to route (or allow ARP between the interfaces)
0
 
LVL 25

Expert Comment

by:Fred Marshall
ID: 33515599
The fundamental question to your original post and to this clarification "the main question here is, is it possible not to have gateway defined in A and still make things work" the answer is "no".
That's because in the original post you say:
"Can i access and communicate with a machine in a *different* network .. "
Not only does this require a router but it requires a gateway entry at both ends.

The details of how the router is interconnected with the computers, how the routers routing table is configured goes beyond this.

Or, you might put routes in all the computers that need to communicate so that the packets go out on the wire even though they aren't on the same subnet.

route -p add
[destination network IP] mask [destination network subnet mask] [gateway ip address]

The gateway IP address can be the NIC address and then the packets will just hit the wire as if there would be a destination connected to the wire.  You add this route at both ends....

0
 
LVL 1

Author Comment

by:its_ns_04
ID: 33555068
i can make it work without gateway defined in A and I have recently made it work :)
0
 
LVL 24

Expert Comment

by:B H
ID: 33555376
thats great - did any of our comments help?
0
 
LVL 25

Expert Comment

by:Fred Marshall
ID: 33555417
*How* did you make it work?
0
 
LVL 1

Author Closing Comment

by:its_ns_04
ID: 33567038
to some extent, it was correct
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

The article explains the protocols and technology which is involved when two computers on different TCP/IP networks communicate with each other. In the diagram, a router is used to segregate two networks. The networks are 192.168.1.0/24 and 192…
SSL is a very common protocol used these days when browsing the web.  The purpose is to provide security to communication, but how does it do it?  There are several pieces at work that have to be setup before SSL will even work and it requires both …
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now