Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm trying to create a ad-hoc wifi, after some readings here is what I did:

I changed /etc/network/interfaces on computer A like this:

auto lo
iface lo inet loopback

## WIFI AD-HOC
auto wlan0
iface wlan0 inet static
        address 192.168.0.1
        netmask 255.255.255.0
        wireless-mode ad-hoc
        wireless-essid test

on computer B:

auto lo
iface lo inet loopback

## WIFI AD-HOC
auto wlan0
iface wlan0 inet static 
        address 192.168.0.2
        netmask 255.255.255.0 
        wireless-mode ad-hoc
        wireless-essid test

Then check wlan0 configuration with ifconfig everything seems OK, but I cannot ping each others (host unreachable stuff).

Any idea, what am I missing here?

share|improve this question
    
What's the output of iwconfig and ifconfig on both hosts? –  Gilles Aug 12 '13 at 22:51
    
thanks, but I finally found the solution just by adding a WEP key (as shown in my answer), even if WEP key is weak, it fits my needs. FIY your can see the iwconfig and ifconfig outputs here: gist.github.com/xseignard/6214454 –  xavier.seignard Aug 13 '13 at 9:56

1 Answer 1

If finally found a solution, I just added a WEP key on my /etc/network/interfaces configuration and everything works now.

So on computer A (ubuntu 12.04)

~ % more /etc/network/interfaces
auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
auto wlan0
iface wlan0 inet static
    address 192.168.0.1
    netmask 255.255.255.0
    wireless-channel 1
    wireless-essid mirroir
    wireless-mode ad-hoc
    wireless-key 967136deac

On computer B (raspberry pi):

~ % more /etc/network/interfaces 
auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
auto wlan0
iface wlan0 inet static
    address 192.168.0.2
    netmask 255.255.255.0
    wireless-channel 1
    wireless-essid mirroir
    wireless-mode ad-hoc
    wireless-key 967136deac

And everything is ok. I just need to ifdown/ifup my interfaces, on the ubuntu computer :

~ % sudo service network-manager stop
~ % sudo ifdown lo eth0 wlan0
~ % sudo ifup lo eth0 wlan0

(I don't know if its necessary, but I stop the network-manager service on ubuntu in order not to mess with my interfaces configuration)

And on the raspberry pi

~ % sudo ifdown lo eth0 wlan0
~ % sudo ifup lo eth0 wlan0

That's all!

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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