Reputation: 1853
I have connected a Linux machine and a Windows machine via LAN cable. Both machines are not connected to any network. Is it possible to establish a socket communication between these machine? If yes, how?
Upvotes: 2
Views: 107
Reputation: 3215
For sure it's possible! Here's a checklist of what you should do:
\Strictly speaking, you don't assign an IP address to the whole machine: you assign an address to the interface where you plugged in an ethernet cable.
Upvotes: 1
Reputation: 4809
Since you have not any network, only two hosts one connected to the other (that is in fact a network, a very small network), you do not have a DHCP server. So, your hosts are automatically configured with IPs in the range 169.254.0.0 to 169.254.255.255, you do not have to configure anything at the network level. Now, you can use socket programming to exchange data between those hosts, using their IP addresses. Use ifconfig on the Linux host and ipconfig on the Windows one to get the addresses and insert them in you programs, or give them as a parameter.
Upvotes: 0