How to connect two locally linked computers to WIFI using IPv4 addressing?

Ok, so I managed to:

  • 1) Connect RaspberryPi with laptop using crossover cable.
  • 2) SSH into RaspberryPi and get virtual terminal on my Laptop.
  • 3) Have Wifi on the virtual terminal.
  • 4) Have Wifi on my PC, Linux OS.

Here are instructions that worked for me:

From PC go to networks tab (on the top right), then click Edit Connections. In Ethernet, click on Wired connection 1 (or however the cable connection will be called on your laptop), then click Edit.... Go to IPv4 settings and set Method to be Shared to other computers.

Now go back to Network Connections tab, find your Wi-fi connection, click Edit... go to IPv4 settings again and make sure that the Method is set to Automatic (DHCP).

Then connect your RaspberryPi and Laptop with crossover cable, and boot the RaspberryPi up. A message Connected to wired connection 1 might appear briefly on the top right corner.

Finally, open the terminal, type

ssh [email protected]

and hope that the terminal asks for a password. If you succeed up to here, the most of the work is done. Enter the RaspberryPi password (try raspberry if you don't know it) and you will get a virtual shell of RaspberryPi.

Checking that Wi-Fi connection has been established one can in the SSH'ed shell type

ping 8.8.8.8

to check for arriving packets. If that succeeds type

ping [SomeWebsiteName]

to check that DNS works.

If you failed to get "enter password" request, some of the problems can be:

  • The /etc/network/interfaces files. My files are as follows.

    In Linux Laptop:

    auto lo
    iface lo inet loopback
    

    On Raspbian:

    # Note some lines might not be required
    
    auto lo
    iface lo inet loopback
    
    auto eth0
    allow-hotplug eth0
    iface eth0 inet manual
    
    auto wlan0
    allow-hotplug wlan0
    iface wlan0 inet manual
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
    
    auto wlan1
    allow-hotplug wlan1
    iface wlan1 inet manual
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
    
  • ssh program is not installed.

  • [email protected] does not detect the Pi's IP address.