3

I want to run an ad-hoc wireless on two laptops that both have Linux OS. I use this for creating ad-hoc network.(I have stopped Network Manager before it)

sudo ifconfig wlan0 down
sudo iwconfig wlan0 mode ad-hoc essid test-adhoc channel 3
sudo ifconfig wlan0 up
sudo ifconfig wlan0 192.168.1.1 netmask 255.255.255.0

My ifconfig:

 ifconfig 
 lo        Link encap:Local Loopback  
       inet addr:127.0.0.1  Mask:255.0.0.0
       inet6 addr: ::1/128 Scope:Host
       UP LOOPBACK RUNNING  MTU:65536  Metric:1
       RX packets:25388 errors:0 dropped:0 overruns:0 frame:0
       TX packets:25388 errors:0 dropped:0 overruns:0 carrier:0
       collisions:0 txqueuelen:0 
       RX bytes:3916018 (3.9 MB)  TX bytes:3916018 (3.9 MB)

  vmnet1    Link encap:Ethernet  HWaddr 00:50:56:c0:00:01  
        inet addr:192.168.237.1  Bcast:192.168.237.255 Mask:255.255.255.0
        inet6 addr: fe80::250:56ff:fec0:1/64 Scope:Link
        UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
        RX packets:0 errors:0 dropped:0 overruns:0 frame:0
        TX packets:505 errors:0 dropped:0 overruns:0 carrier:0
        collisions:0 txqueuelen:1000 
        RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

  vmnet8    Link encap:Ethernet  HWaddr 00:50:56:c0:00:08  
        inet addr:172.16.62.1  Bcast:172.16.62.255  Mask:255.255.255.0
        inet6 addr: fe80::250:56ff:fec0:8/64 Scope:Link
        UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
        RX packets:0 errors:0 dropped:0 overruns:0 frame:0
        TX packets:504 errors:0 dropped:0 overruns:0 carrier:0
        collisions:0 txqueuelen:1000 
        RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

  wlan0     Link encap:Ethernet  HWaddr ac:72:89:1b:19:76  
        inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
        inet6 addr: fe80::ae72:89ff:fe1b:1976/64 Scope:Link
        UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
        RX packets:1543085 errors:0 dropped:27 overruns:0 frame:0
        TX packets:19353 errors:0 dropped:0 overruns:0 carrier:0
        collisions:0 txqueuelen:1000 
        RX bytes:183406489 (183.4 MB)  TX bytes:3741745 (3.7 MB)

And iwconfig

vmnet8    no wireless extensions.

eth0      no wireless extensions.

lo        no wireless extensions.

wlan0     IEEE 802.11bgn  ESSID:"test-adhoc"  
      Mode:Ad-Hoc  Frequency:2.422 GHz  Cell: A2:A3:E3:9B:6A:FA   
      Tx-Power=15 dBm   
      Retry  long limit:7   RTS thr:off   Fragment thr:off
      Power Management:off

vmnet1    no wireless extensions.

IP for first Lop top is <192.168.1.1> and for second one is <192.168.1.2>. I checked the route:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
172.16.62.0     *               255.255.255.0   U     0      0        0 vmnet8
192.168.1.0     *               255.255.255.0   U     0      0        0 wlan0
192.168.237.0   *               255.255.255.0   U     0      0        0 vmnet1

But when i ping one from other:

ping 192.168.1.2
PING 192.168.1.2 (192.168.1.2) 56(84) bytes of data.
From 192.168.1.1 icmp_seq=1 Destination Host Unreachable
From 192.168.1.1 icmp_seq=2 Destination Host Unreachable
From 192.168.1.1 icmp_seq=3 Destination Host Unreachable
From 192.168.1.1 icmp_seq=4 Destination Host Unreachable
From 192.168.1.1 icmp_seq=5 Destination Host Unreachable
From 192.168.1.1 icmp_seq=6 Destination Host Unreachable

what should I do? My system is Ubuntu 14.04.

  • 1
    I assume 192.168.1.2 is the first computer on the network, but you have two computers. Could it be as simple as trying to ping 192.168.1.3? I doubt it, but it may help to ping -c 1 192.168.1.3. – Dooley_labs Mar 1 '16 at 16:39
  • Did you manage to figure this out? I'm having the same issue. – lightsout Oct 19 '16 at 21:29
0

my first guess would be the ufw settings. in other words, the reverse ping might be prevented by the firewall on the one that is "unreachable). You can run "sudo ufw status" to check the current rules (and also whether it's enabled).
I'm also a bit puzzled by the IP assignments. I do something similar to this, with the router hard wired to one of the laptops, and the router (netgear) always assigns the *.1.1 address to itself. If you've set the IP addresses internally, rather than via DHCP, then that might be a problem, too, if there is an IP address conflict on your mini-net. I have one of the nodes set up as 1.4, and then the others get assigned higher in the mask range. (We have up to 10 on the net, actually.) If there is a conflict, it could actually block both directions, since one way the first step would be blocked and the other way the ACK could be blocked (because it goes the wrong place). Make sure that there aren't any conflicts on the net, INCLUDING the router.

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.