2
This is a bit of an embarrassing question: on one hand one would assume it's straightforward (lot's of similar hits in google, I haven't found it asked here before...), on the other hand all purported solutions I have found have failed.
The gist of my problem: I have 2 computers. #1 is a
Windows 10machine. #2 is an arbitrary os (i.e., any of *nix, OS X, windows). I want to ssh from #1 to #2
.
The context: #2 is running an ssh daemon. I know that #2 needs to get an IP address somehow from #1. In that respect, #1 has an additional feature that should help find a solution, namely, #1 is connected to the internet via wifi. I'm also aware I need to find the IP address of #2, once it gets one, before I can ssh to it. Let's say #1's IP (wireless adapter) is 192.168.10.62
.
Side note: I have Nmap for windows installed, with its Npcap library. Having it running requires some unusual/unexpected arcane tweaking (resetting network w/ "netsh int ip reset c:\resetlog.txt")...in case this might be of relevance.
What I tried:
Sharing
: In the windows10 machine (#1). Went to Network Connections -> Wireless Network Connection -> Properties -> Sharing -> Enable "Allow other network users to connect through this computer's Internet connection", and select my "Local Area Connection" (ethernet) in the "Home networking connection" menu of that Sharing tab.Running 'ifconfig' in windows shows the Ethernet adapter with an IP of 192.168.137.1
However, the pc#2 doesn't seem to have gotten an IP address: running
nmap -sS 192.168.137.1/24
yields only machine #1. If I nmap against the wireless interface (map -sS 192.168.10.0/24
) instead, I get #1 plus other machines, but not pc#2.This last negative result I could understand if it happens that both adapters need to be bridged. However, shouldn't that be taken care of by the "Sharing" feature of windows10? In OSX (in the role of pc#1) that's exactly what is done behind the scenes and I have no problem.
Sharing+Bridging
: I first set up sharing as above. At this point, some purported solutions say one needs to set up a bridge between the Ethernet adapter and the Wireless one (all in pc#1). However, when I try that I get the error message:To create a Network Bridge, you must select at least two LAN or High-Speed Internet connections that are not being used by Internet Connection Sharing.
Dead end.
Bridging
: Within Network Connections, ctrl+select both the Ethernet adapter and Wireless one and then right-click on one of them and enable a bridge between both. Notice, no sharing enabled in this method.I've had some students trying this before and they managed somehow to get an IP address for pc#2, but results haven't been neither systematic nor stable: they lost the wireless IP address in #1 and with that the connection to #2; furthermore, they couldn't replicate it.
My results have been negative right from the start, i.e., just bridging both adapters (with the wireless in pc#1 having a working IP) leads to the wireless one losing internet connection, but #2 still being inaccessible. This is exactly what the student saw after their purported initial success.
Dhcpserver
: Having failed these three options, I figured I could set up my windows10 machine (#1) as a dhcp server listening on the Ethernet adapter. I would not get internet access for pc#2 this way, but at least I would expect it getting an IP address from pc#1 and thus being able to ssh to it.For that purpose, I downloaded Dhcpserver for Windows (http://www.dhcpserver.de) version 2.5.2 (latest free one as of Fri Nov 3 2017).
- Dhcpserver w/o enabling sharing of Wireless adapter: Manually I assign the ethernet adapter the IP 192.168.123.1/24 and the Dhcpserver wizard sets the dhcp pool within that network range, yet nothing happens, pc#2 connected but doesn't get an IP address (does not show up with map, nor in the status page of Dhcpserver).
- Dhcpserver w/ enabling sharing of Wireless adapter: the ethernet one shows up with IP 192.168.137.69/24 after enabling sharing. Again, however, pc#2 doesn't get any IP assigned.
When using Dhcpserver I've seen at times a sporadic notification saying something like "Dhcpserver assigned IP 192.168.137.2 to mac address ...", but A) it doesn't show up systematically, and when it does, it happens after quite a long time after starting the Dhcpserver, and B) neither map nor ssh (putty) can access pc#2.
The same negative results when running the Dhcpserver as service in windows or as application. Also, I ran the app's automatic configuration of the firewall.
Status:
I'm shaking my head at the time I wasted here. I can't believe this can be that complicated, so I guess I'm missing some otherwise obvious step/setup.
Sorry for the long question, but I'm too tired to figure out how to summarize it in any shorter way.
Solution 1 finally worked, but with a little detail: I shutdown pc#2 and reset all adapters in pc#1 to default state (no sharing/bridging/dhcpd). Then I set up sharing Wifi over Ethernet as mentioned in 1 above. Finally I connected pc#2 via ethernet to pc#1 and brought it up. It got the IP address in the subnet 192.168.137.0/24 and I could ssh. That still doesn't explain why it wasn't working when I was just connecting and disconnecting the ethernet cable (on my Mac, no problems doing so). #2 is running Linux and I'd expect the dhcp service to pick up the cable connecting and getting a new IP. – MASL – 2017-11-03T09:19:52.857