-2

This is an interview question:

There are two servers on Rank A, setup the network on the two hosts by following configuration:

Server A: ifconfig eth0 10.10.15.129 netmask 255.255.255.0 up route add default gw 10.10.15.2

Server B: ifconfig eth0 10.10.15.6 netmask 255.255.255.192 up route add default gw 10.10.15.2

Assuming the configuration is effective, now can the two servers talk via TCP?

I think they can talk to each other via TCP because they are on the same network and it just needs a switch to connect to each other, is that correct?

J JIA
  • 1
  • 1

1 Answers1

0

Depends on whether they are on the same l2 subnet.

If they are - they can. Although the second host, the one with /26 mask will think that they are on different physical network and will send the packets via the router 10.10.15.2 (so the ethernet frames, incapsulating IP frames, incapsulating TCP frames, will have the 10.10.15.2 mac address), and 10.10.15.2 will resend them to 10.10.15.129, which will answer directly to 10.10.15.6.

In case they really are on different physical subnetworks - the 10.10.15.129 is set up incorrectly, so they won't be able to.

drookie
  • 8,625
  • 1
  • 19
  • 29
  • I don't understand why the one with /26 mask will think that they are on different physical network, the network address for both the first and the second is 10.10.15.0 after calculation so they are on the same subnet. – J JIA Sep 30 '22 at 13:14
  • And the gateway with IP 10.10.15.2 is also on the same subnet with server A and B. – J JIA Sep 30 '22 at 13:24
  • Gateway cannot be of different subnet. Firstly I thought that you want to clarify some tricky moments, but it seesm like you have absolutely no idea how the IP network functions; so take the advice you was given earlier - just go and read some book, like Stevens, "TCP/IP Illustrated". – drookie Sep 30 '22 at 13:55
  • > "the network address for both the first and the second is 10.10.15.0 after calculation so they are on the same subnet." **NO**. Just "no". – drookie Sep 30 '22 at 13:55
  • The subnet mask puts them on different L3 networks. .129 would have no problem initiating communication with .6 but .6 would send it's return communication to it's DG and not directly to .129. – joeqwerty Sep 30 '22 at 14:03