Dynamically Connect Two Windows PCs via Direct Ethernet Cable?

Havenost

Reputable
Aug 16, 2014
84
0
4,660
So I am wondering whether it is possible to dynamically connect two Windows PCs via an ethernet cable.

I know how to connect two PCs already via ethernet cable by changing the ip address to the same subnet by using static ip address... with the most popular example of 192.168.1.1 and 192.168.1.2.

Though is it possible to setup this connection via something like DHCP so that I don't have to manually configure the ip address every time?

Because I am using one PC as a NAS/HTPC which will frequently need to connect random PCs who will not always be using static IP addresses. So is it possible to configure NAS/HTPC as a DHCP server so that other devices can simply plug in and automatically connect?

I know some of you would suggest just getting a router, or switch to get this behavior... but I am in a situation where I am trying to avoid any more external devices.
 
And why can't you connect both PCs to a router like everybody else would normally do?

Well, if you really must have such an inconvenient setup, you can do that using internet connection sharing feature (ICS).
PC, you're connecting to, will require 2 network interfaces for that.
 

Havenost

Reputable
Aug 16, 2014
84
0
4,660


Because the NAS/HTPC is also currently my Pfsense router in this situation... the NAS/HTPC is running Pfsense through Hyper-V. It has five NICs, so I have a couple left over NICs so I just want to use them for direct connections.
 

Havenost

Reputable
Aug 16, 2014
84
0
4,660


I am not quite understanding how that works.

Cause If I took the first PC, the NAS/HTPC Desktop I have. Set the IPv4 to use automatically receive IP... then plug in a second pc, a laptop via ethernet with IPv4 who is also using automatically receive IP, they usually fail to talk until I set them up both to have an assigned static ip address.
 

With this setup (PCs already connected, both set to DHCP) - have you tried checking IP configuration, and whether they are PING-able?
 

That's some crazy setup.
And how is that exactly configured to work? And you did that yourself?

Well - I can't quite believe it, if you're having trouble setting up a basic ICS.
 

Havenost

Reputable
Aug 16, 2014
84
0
4,660


Ah never mind I got it working the way you said it would. Apparently some of my NICs were bugged when I was messing around with them with Virtualbox, even though I had set them to auto acquire ip address they kept retaining the 10.0.10.x address, thus the APIPA that you mentioned didn't kick in. I got that resolved now.



Well I can see your skepticism and its pretty justified. But yeah I really have no deep understanding of how most of these things work. For the Hyper-V Pfsense installation it was pretty straight forward follow a guide on how to setup the Virtual Switches and Adapters. The installation and configuration of PFsense itself is pretty straight forward. And of course I am sure you're probably having a red flag going off about the router / firewall running on a vm on the same host computer and how that isn't secure. Well there is a guide on how to force all internet traffic to go to the vm first by disabling the IPv4 stack on the main WLAN nic in windows.

http://timita.org/wordpress/2011/07/29/protect-your-windows-laptop-with-pfsense-and-virtualbox-part-1-preamble/

As for the NAS configuration... not sure if I am using the term properly since I am not actually running a RAID NAS OS like Freenas or anything. I am just using the built in windows file sharing system... which is simply right click a directory and press share.

While it has not been an easy road for me (wasted lots of time monkeying around, and googling and experimenting with a lot of stuff), the setup I have is actually pretty simple once I found the information for it, and properly undid all those undocumented changes I did to my system.

Though the one thing I don't think I will ever get working is the Wifi for Pfsense working since its already known problem that Pfsense has crap Wifi adapter support even with supported cards... add that on with having to figure out how to get pfsense to detect a wifi card through a hyper visor.
 

Havenost

Reputable
Aug 16, 2014
84
0
4,660


Well in this case Free is actually better than a $15 switch since we're not using Windows XP anymore. Apparently Automatic Private IP Addressing (APIPA) got invented sometime in past two decades, and Winows 7 and above apparently can auto connect with just straight through cables.

It was just that I had problems with my NICs since they had a bug where they were retaining IP Address that I set statically instead of dynamically acquiring a new address from the APIPA protocol.
 

USAFRet

Titan
Moderator
Well, yes. You can do it the way you've done it.

But your pfSense is doing router duties, and you apparently have multiple LAN ports on that system.

Why not just connect the second system to one of those unused LAN ports? Instead of pushing everything through the first PC?

Everyones network is a little bit different. It is pretty hard for anyone out here to diagnsose or suggest, especially when you have a pretty odd setup.

But, you apparently have it figured out. Good deal.
 

Havenost

Reputable
Aug 16, 2014
84
0
4,660


That was what I was doing. You see the confusion I was having was that when I connected a second computer to the first computer (the NAS/HTPC/Router), they wouldn't talk unless I had set up static routes on both computers due to the unused LAN ports being bugged.

APIPA would usually assign other computer to a 169.254.x.x address with the subnet of 255.255.0.0. My unused ports were bugged and stuck with static ip addresses of 10.0.1x.x with a subnet of 255.255.255.0 that I had previously assigned them before when I was testing something with virtualbox despite the fact that I disabled the static option and told them to dynamically get ip address.

So when I had plugged in the second computer(s) into the unused LAN ports, the first computer's extra ports and the other computers would be on completely different subnets, thus refused to talk. Because the first computer was stuck on the 10.0.1x.x address, while all the other computers I plugged in were on 169.254.x.x addresses.

So in theory, all I had to do was plug in the two computers via ethernet computer and it should of automatically worked as Alabalcho pointed out. But it didn't due to my adapters being bugged, and what added into my confusion is that all the google searches I did kept telling me outdated info about needing crossover cables and having to set up ip address statically. So when I had changed the ip addresses manually to different static address, it worked since I had force them to be in the same subnet. Thus re-enforcing the misinformation / outdated information I had read earlier in my mind about needing static ip address... which then led me to ask about trying to force dynamically acquire ip address on the same subnet (which technically happens by default when not bugged).