3

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 aWindows 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:

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

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

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

  4. 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).

    1. 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).
    2. 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 Nov 3 '17 at 9:19
1

I had a new #1 Dell Windows 10 PC without ethernet port (so I used USB->Ethernet adapter) and #2 an old Lenovo T60 with Xubuntu 18.04 LTS installed.

On #1 machine:

  • Connected my #1 to wifi, and connected cable to adapter to USB; moved to Control Panel->Network and Internet->Network and Sharing Center->Change adapter settings (in left sidebar);
  • here was the list of interfaces, among them my wifi interface and my use ethernet interface (saying "Unidentified connection").
  • Right-clicked on wifi interface, Properties, Sharing tab (on top);
  • allowed other network users to do everything, in "Home networking connection" have selected my ethernet interface, and clicked ok.
  • with ipconfig in PowerShell I checked my address on the ethernet interface. There was already one, let's call it #IP1, and subnet mask #MASK1. Maybe you should set it manually if it is not set.

On machine #2:

  • checked name of linux ethernet interface name #LINUX_ETH_NAME using ip l (should start with letter e);
  • if #MASK1 on #1 is 255.255.255.0 then #SUBNET_MASK_DIGITS is 24;
  • set #IP2 (should be in subnet of #IP1 and #MASK1) - if #MASK1 is 255.255.255.0, then be sure to change last digit from #IP1 in the range (1,253) (e.g., if #IP1=192.168.1.1 then #IP2 can be 192.168.1.2);
  • added IP with sudo ip a a #IP2/#SUBNET_MASK_DIGITS dev #LINUX_ETH_NAME
  • added default gateway for #2 to be #IP1 with sudo ip route add default via #IP1

and it worked!

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.