I have seen people connect two computers with an Ethernet cable, but the instructions I've seen were for Windows to Windows or Mac to Mac or Windows to Mac. I never came across any for connecting Windows to Linux. Is it possible to connect a Windows system to a Linux system via Ethernet cable?
6 Answers
Yes, as I have done this before, but with Ubuntu-based distros connected to Windows Vista. However this should still work with Windows 10. This is called a direct ethernet connection. There are a few steps to this:
Windows, p1
- check current IP for example Start,
cmd
to open a terminal, runipconfig
- write down the current IP(s) to compare later
Both
- attach the Ethernet cable to both machines so they are now physically connected to each other
Windows, p2
- get the new IP: Start,
cmd
to open a command prompt, runipconfig
- comparing with your previously copied IPs, see which new IP appears, and copy it down for example it may resemble:
169.254.123.101
.
Ubuntu
- get to the network manager, for example click status bar network icon
- Edit Connections
- choose Wired type
- create a new wired connection, naming it something you'll recognize such as
direct-ether
under
iPv4
, use these settings- Method:
Manual
. Otherwise default Automatic (DHCP) does not let you set an IP - address:
169.254.123.105
. The point is to use same IP except for last segment to be on the same subnet so if one isa.b.c.101
then you should bea.b.c.105
for example - netmask:
255.255.0.0
- gateway: leave blank
- Method:
It is at this point, on Lubuntu for example there is weirdness where, when typing address numbers, values "disappear" when typing. Just keep typing and when you Save, it seems the values just appear.
- Save
- Now choose your new
direct-ether
network, for example status bar click it
Test
So now you should have, for example:
- Windows: 169.254.123.101
- Ubuntu: 169.254.123.105
Test the connectivity for example using software that you can access by IP. For example on Windows I had Xampp Portable running which runs an Apache web server. So to test whether Ubuntu could see that web server, I simply opened a browser to http://169.254.123.101
which is the Windows's IP in this example, and could see the Windows' Xampp Portable default page, thus confirming the connectivity.
-
4IIRC Ubuntu's
network-manager
also has a 'Link Local Only' IPv4 option that will automatically choose an available 169.254.x.x address Commented Dec 23, 2015 at 10:36
user454038 pretty much sums it well, but there is the issue of the type of Ethernet cable you need.
When connecting 2 computers together using a direct connection you must use a crossover cable.
And all you have let is to configure each computer's IP, don't forget to use a different IP for each computer :-)
It is custom to use a curtain pattern for internal IP use, for ex.: 192.168.1.???
-
3Modern network equipment should be able to detect and switch itself with no need for a crossover cable.– EL_DONCommented Dec 21, 2016 at 16:16
-
1I know modern switches and routers can. I didn't know that the PC's adapter can do this as well. Commented Dec 25, 2016 at 12:25
Yes, this is possible. They talk same protocol - TCP/IP. You just set static addresses on them being in same subnet and they should see themselves.
I used a direct ethernet connection between Fedora 25 and Windows 7 to copy files to a new computer.
Hardware:
Standard ethernet cable (the ethernet cards can detect the direct connection and switch themselves, so a crossover cable is not needed) connecting ethernet ports of both machines.
Windows setup:
- Open network connection settings and manually set a static IP
- Set up network file sharing so that appropriate folders are shared. Some folders have encryption or security settings that may need to be modified
Fedora:
As in user454038's answer, create a new IPv4 connection (or edit your normal one, but then you'll have to edit it back)
- Settings
- Network
- Wired
- Add Profile...
- Set static IP with same subnet mask as windows but a different IP.
With that done, you should see the windows machine appear in Files / Other Locations and be able to copy files across.
- When finished, reconnect ethernet cables to connect to the internet and switch network profiles by clicking on the original one.
You can also simply connect linux with Windows over ethernet cable by taking these steps.
Linux Steps:
PCI Ethernet Connection > Wired Settings > ipv4
then select Link local only from drop down in ipv4 section , like this
Windows Configuration:
On Linux, using a graphical manager, create an Ethernet connection. Select your LAN card interface for that connection (run the command "ifconfig" in a terminal and to the left you will see interface names like enp0s18f2u6 or enp2s0). Set firewall zone to "trusted". In IPv4 settings, mark that IPv4 is necessary for the connection (IPv6 can be ignored). Set manual address: 192.168.1.1 (this type of address is called a private address) and net mask 255.255.255.0. Set gateway to 192.168.1.2 (this will be the address of your second PC with Windows [but not necessarily, these steps are generally OS independent]). Turn on the connection (you might want to set the connection to automatic at boot time, set as not metered, and all users can connect).
Now on Windows: set the LAN interface address (the one for the network card, that is in your LAN): 192.168.1.2, net mask 255.255.255.0 and default gateway of the Linux PC: 192.168.1.1. (You do this by going to "Network and Sharing Center"->"change adapter settings", and pick your network interface here, that corresponds to your LAN card that is connected to the other PC. Right click on that interface icon and select "Properties", unselect Internet Protocol Version 6, and double click "Internet Protocol Version 4". Now you enter the address 192.168.1.2 - this will be the address of your Windows PC on that interface (on that [LAN/Ethernet] connection)). Tab down so netmask is filled out automatically (255.255.255.0). Now as the gateway address provide the other PC address: 192.168.1.1).
So putting it short, both PC's must have static addresses and point to each other's addresses as the gateways: computer1 is gateway for computer2, computer2 is gateway for computer1.