曾经需要在不通过无线网络的情况下将两台计算机连接在一起吗?我之前写过关于如何使用 ad-hoc 无线网络无线连接两台计算机(connect two computers wirelessly)的文章,但它没有直接连接那么快。
如果您的计算机在有线网络上,您可以将两台计算机联网,然后共享文件和文件夹,但工作量很大!如果您运行的是Windows 7或更高版本,更简单的方法是简单地创建一个家庭组。(create a homegroup)第三种方法是使用交叉电缆连接两台计算机并传输数据。
为了使此设置正常工作,您需要确保设置或配置正确。我将尝试完成本文中的所有不同步骤。
第 1 步 – 配置 IP 地址
通常,如果您使用交叉电缆连接两台计算机,则计算机不会连接到LAN网络。在这种情况下,您需要为每台计算机配置静态 IP 地址。
您必须确保两台计算机的 IP 地址位于同一子网上。例如,如果您给一台计算机的 IP 地址为 192.168.0.1,那么您应该给第二台计算机的 IP 地址为 192.168.0.2。
如果您使用上述 IP 地址,则应使用子网掩码 255.255.255.0。如果您使用不正确的子网掩码,则连接将无法工作。
最后,默认网关的值在两台机器上应该相同。您可以选择要使用的 IP 地址,但在两台计算机上都使用它作为默认网关。以下(Below)是我的设置如何查找一台计算机:
值得注意的是,从技术上讲,您可以将默认网关(Default Gateway)和首选 DNS 服务器(Preferred DNS server)字段留空,因为您实际上不必连接到本地网络之外的任何设备。如果您需要有关静态IP(IPs)的更多信息,请务必阅读我关于如何在 Windows 和 Mac 中分配静态 IP 地址的帖子。
第 2 步 – 交叉电缆
您需要验证的第二件事是您实际上拥有合适的交叉电缆。基本上,有几种不同类型的交叉电缆,但最好使用标准交叉电缆,其中绿色和橙色对交换,棕色和蓝色对保持在同一位置。
唯一需要交叉的引脚是 1,3 和 2,6。因此,只需检查两端的电缆并确保它与图表匹配。您可以在Amazon for $5的价格购买便宜的 10 英尺交叉电缆,或者您可以购买交叉适配器(crossover adapters),这些适配器稍微多一点,但可以将任何以太网(Ethernet)电缆变成交叉电缆。
第 3 步 – 本地用户帐户
如果您在以两种方式访问文件时遇到问题,您可能必须在每台计算机上创建一个具有相同名称和相同密码的用户帐户。这有助于克服可能弹出的任何类型的访问被拒绝错误。(Access)
确保(Make)帐户也是管理员帐户!最好创建一个新帐户,而不是重命名当前帐户。
第 4 步 - 禁用防火墙
最后,您应该禁用两台计算机上的防火墙,以确保没有任何文件共享端口被阻止。您可以通过转到控制面板(Control Panel),然后转到Windows 防火墙(Windows Firewall)来执行此操作。点击(Click)关闭(Off)。_ 如果您使用任何第三方防火墙,请确保也将其关闭。
完成文件传输后,您一定要确保返回并打开防火墙。长时间关闭防火墙是很危险的,因为您基本上会将您的 PC 暴露在整个Internet中。
就是这样!如果您遵循所有这些步骤,则每台计算机都应该能够正确访问另一台计算机。您可以通过打开命令提示符(单击开始(Start)并输入cmd)并尝试 ping 另一台计算机来检查连接。只需(Just)键入单词ping后跟另一台计算机的 IP 地址。
您现在应该能够在Windows 资源管理器(Windows Explorer)中转到“网上邻居”(My Network Places)或“网络(Network)”并访问另一台计算机。如果要传输文件,您还需要设置一个共享文件夹。(setup a shared folder)另外,请查看我的另一篇文章,其中讨论了您可以在多台计算机之间共享文件(share files between multiple computers)的所有其他方式。如果您遇到问题,请在此处发表评论,我会尽力提供帮助!享受!
Connect Two Computers using a Crossover Cable
Ever needed to connect two computers together without goіng through a wіreless network? І’ve previously written about how to connect two computers wirelessly using an ad-hoc wireless network, but it’s not as fast as being directly connected.
If your computers are on a wired network, you can network two computers and then share files and folders, but it’s a lot of work! An easier way is to simply create a homegroup if you are running Windows 7 or higher. A third way is to use a crossover cable to connect two computers and transfer data.
In order for this setup to work, there are a few things you need to make sure are setup or configured properly. I will try to go through all the different steps in this article.
Step 1 – Configure IP Addresses
Usually, if you are using a crossover cable to connect two computers, the computers are not connected to a LAN network. In this case, you will need to configure static IP addresses for each computer.
You have to make sure that both computers have IP addresses that are on the same subnet. For example, if you give one computer an IP address of 192.168.0.1, then you should give the second computer an IP of 192.168.0.2.
If you used the above IP addresses, you should use a subnet mask of 255.255.255.0. If you use an incorrect subnet mask, the connection will not work.
Lastly, the value for the default gateway should be the same on both machines. You can pick which IP address you want to use, but use it on both computers for the default gateway. Below is how my setup looks for one computer:
It’s worth noting that you could technically leave the Default Gateway and Preferred DNS server fields blank as you really don’t have to connect to any device outside the local network. If you need more info about static IPs, make sure to read my post on how to assign a static IP address in Windows and Mac.
Step 2 – Crossover Cable
The second thing you need to verify is that you actually have a proper crossover cable. Basically, there are a few different types of crossover cables, but it’s best to get the standard crossover cable where the green and orange pairs are swapped and the brown and blue pairs stay in the same position.
The only pins that need to be crossed are 1,3 and 2,6. So just check your cable on both end and make sure it matches the diagram. You can get a cheap 10ft crossover cable on Amazon for $5 or you can get crossover adapters, which are a little bit more, but can turn any Ethernet cable into a crossover cable.
Step 3 – Local User Accounts
If you’re having problems accessing files both ways, you may have to create a user account on each computer that has the same name and same password. This helps get past any kind of Access is Denied errors that may pop up.
Make sure the accounts are administrator accounts also! It’s best to create a new account rather than rename a current account.
Step 4 – Disable Firewalls
Finally, you should disable the firewall on both computers to ensure that none of the file sharing ports are being blocked. You can do this by going to Control Panel and then Windows Firewall. Click on Off. If you’re using any third-party firewall, make sure to turn that off too.
You’ll want to definitely make sure that you go back and turn on the firewall once you have completed your file transfer. Leaving the firewall off for any extended period of time is dangerous as you’re basically exposing your PC to the entire Internet.
That’s about it! If you follow all these steps, each computer should be able to access the other properly. You can check the connection by opening a command prompt (click on Start and type in cmd) and trying to ping the other computer. Just type the word ping followed by the IP address of the other computer.
You should now be able to go to My Network Places or Network in Windows Explorer and access the other computer. You’ll also need to setup a shared folder if you want to transfer files. Also, check out my other post that talks about all the other ways you can share files between multiple computers. If you are having problems, post a comment here and I will try to help! Enjoy!