How to connect raspberry to WEP encrypted and dhcp enabled Ad-Hoc network

1.3k views Asked by At

I have Three Rasbperry Pi3 and I have configured 2 of them as dhcp enabled ad-hoc network server they are working fine and I can connect to them using Windows PC and Linux PC as well as from Mobile. The dhcp also assigns the 'Laptop, PC and Mobile' the dynamic IP within specified range but when I try to connect from other Raspberry Pi with wpa_supplicant it can't connect to Raspberry Pi hosting ad-hoc network. I am using WEP encryption. My Raspberry Pi are equiped with internal wifi card.

Network Model

#1 Raspberry Pi3 with dhcp enabled ad-hoc

#2 Raspberry Pi3 with dhcp enabled ad-hoc

#3 Raspberry Pi3 is a moving node with managed network mode wpa_supplicant configurations which will connect to the either of those Raspberry Pi's based on which one has good signal strength and quality.

#1 Raspberry Pi with dhcp enabled ad-hoc

I have the following

interface configuration

my /etc/network/interfaces file looks like this

auto wlan0
iface wlan0 inet static
      address 192.168.1.1
      netmask 255.255.255.0
      wireless-channel 1
      wireless-essid Node1
      wireless-key 6172736869
      wireless-mode ad-hoc

dhcp configuration

and my Configuration for /etc/dhcp/dhcpd.conf is

    ddns-update-style interim;
    default-lease-time 600;
    max-lease-time 7200;
    authoritative;
    log-facility local7;
    subnet 192.168.1.0 netmask 255.255.255.0 {
           range 192.168.1.5 192.168.1.150;
    }

#2 Raspberry Pi with dhcp enabled ad-hoc

I have the following

interface configuration

my /etc/network/interfaces file looks like this

auto wlan0
iface wlan0 inet static
      address 192.168.2.1
      netmask 255.255.255.0
      wireless-channel 1
      wireless-essid Node2
      wireless-key 6172736869
      wireless-mode ad-hoc

dhcp configuration

and my Configuration for /etc/dhcp/dhcpd.conf is

    ddns-update-style interim;
    default-lease-time 600;
    max-lease-time 7200;
    authoritative;
    log-facility local7;
    subnet 192.168.2.0 netmask 255.255.255.0 {
           range 192.168.2.5 192.168.2.150;
    }

It is working fine. I can connect anything other than raspberry Pi with wpa_supplicant configuration. I have been working on it from almost 12 days and I tried almost every solution regarding WEP connection with wpa_supplicant and still no chance of connection.

I have the following configuration for

#3 Raspberry Pi3 with wpa_supplicant configuration

wpa_supplicant configuration

my /etc/wpa_supplicant/wpa_supplicant.conf looks like this

    ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
    update_config=1
    country=GB

    network={
             ssid="IoT-Lab"
             psk="12323233"
             key_mgmt=WPA-PSK
    }


    network={
            ssid="Node1"
            wep_key0="6172736869"
            #wep_key0=6172736869
            key_mgmt=NONE
    }

When I connect to the Node1 it doesn't establish connection but create the the entry in wpa_supplicant.

Then read about removing the wep_key0 quotes and I did that but didn't work I also read about a lots of tweaks to play with but nothing worked and did each of them but nothing seems to be work.

interface configuration

# interfaces(5) file used by ifup(8) and ifdown(8)

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

auto lo
iface lo inet loopback

iface eth0 inet manual

allow-hotplug wlan0
iface wlan0 inet manual
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

I also check with interface configuration for wlan0 from manual to dhcp and but it doesn't work. I'll be thankful if you help me out.

0

There are 0 answers