24

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 6

31

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

  1. check current IP for example Start, cmd to open a terminal, run ipconfig
  2. write down the current IP(s) to compare later

Both

  1. attach the Ethernet cable to both machines so they are now physically connected to each other

Windows, p2

  1. get the new IP: Start, cmd to open a command prompt, run ipconfig
  2. 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

  1. get to the network manager, for example click status bar network icon
  2. Edit Connections
  3. choose Wired type
  4. create a new wired connection, naming it something you'll recognize such as direct-ether
  5. 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 is a.b.c.101 then you should be a.b.c.105 for example
    • netmask: 255.255.0.0
    • gateway: leave blank

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.

  1. Save
  2. 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.

1
  • 4
    IIRC 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
4

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.???

2
  • 3
    Modern network equipment should be able to detect and switch itself with no need for a crossover cable.
    – EL_DON
    Commented Dec 21, 2016 at 16:16
  • 1
    I know modern switches and routers can. I didn't know that the PC's adapter can do this as well.
    – user148564
    Commented Dec 25, 2016 at 12:25
3

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.

1

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.
0

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

enter image description here enter image description here enter image description here

Windows Configuration:

Simply set obtain automatic ip. enter image description here

0

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .