How do you join two or more Linux machines to the same ad-hoc wireless network?
I have two Ubuntu 12.04 laptops that I'd like to connect. Following the command line instructions in Ubuntu's wiki docs, I configured them to both connect to "my network". However, running iwconfig
shows they're using different cells, which apparently means that even though they're using the same ESSID, they're separate networks.
e.g. on machine 1, I ran:
user@localhost:~$ sudo service network-manager stop
user@localhost:~$ sudo ip link set eth1 down
user@localhost:~$ sudo iwconfig eth1 mode ad-hoc
user@localhost:~$ sudo iwconfig eth1 channel 4
user@localhost:~$ sudo iwconfig eth1 essid 'my network'
user@localhost:~$ sudo iwconfig eth1 key 1234567890
user@localhost:~$ sudo ip link set eth1 up
user@localhost:~$ sudo ip addr add 192.168.1.1/16 dev eth1
user@localhost:~$ iwconfig
lo no wireless extensions.
eth2 IEEE 802.11abg ESSID:"my network"
Mode:Ad-Hoc Frequency:2.412 GHz Cell: 52:9D:A0:90:28:02
Retry long limit:7 RTS thr:off Fragment thr:off
Power Management:on
and on machine 2, I ran:
user@localhost:~$ sudo service network-manager stop
user@localhost:~$ sudo ip link set eth1 down
user@localhost:~$ sudo iwconfig eth1 mode ad-hoc
user@localhost:~$ sudo iwconfig eth1 channel 4
user@localhost:~$ sudo iwconfig eth1 essid 'my network'
user@localhost:~$ sudo iwconfig eth1 key 1234567890
user@localhost:~$ sudo ip link set eth1 up
user@localhost:~$ sudo ip addr add 192.168.1.2/16 dev eth1
user@localhost:~$ iwconfig
lo no wireless extensions.
eth2 IEEE 802.11abg ESSID:"my network"
Mode:Ad-Hoc Frequency:2.412 GHz Cell: B6:D6:92:5D:E5:E4
Retry long limit:7 RTS thr:off Fragment thr:off
Power Management:on
Why didn't they resolve to the same cell number? How do I get them to use the same cell number?
Edit: Even if the use iwconfig's ap parameter to explicitly set cell number on both machines, I still don't seem to "connect" to the ad-hoc network. Attempting to ping either IP results in the error connect: Network is unreachable
.