@@ -430,7 +430,9 @@ Now, assign an IP address to both interfaces using the following commands:
430
430
$ sudo ip netns exec ns3 ip addr add 10.0.0.4/24 dev vw3
431
431
$ sudo ip netns exec ns4 ip addr add 10.0.0.5/24 dev vw4
432
432
```
433
- #### Switch to IBSS mode
433
+ There are two methods to configure an IBSS network: manual configuration or using WPA.
434
+ #### Option1 : Manual configuration
435
+ ##### Switch to IBSS mode
434
436
Switch device to IBSS mode using the following command :
435
437
436
438
*** iw dev [ interface] set type ibss***
@@ -454,7 +456,7 @@ Interface vw3
454
456
wiphy 4
455
457
txpower 0.00 dBm
456
458
```
457
- #### Join IBSS network
459
+ ##### Join IBSS network
458
460
``` shell
459
461
$ sudo ip netns exec ns3 ip link set vw3 up
460
462
$ sudo ip netns exec ns4 ip link set vw4 up
@@ -485,6 +487,44 @@ Interface vw3
485
487
wiphy 4
486
488
txpower 0.00 dBm
487
489
```
490
+ #### Option2 : Using WPA
491
+ ``` shell
492
+ $ sudo ip netns exec ns3 ip link set vw3 up
493
+ $ sudo ip netns exec ns4 ip link set vw4 up
494
+ ```
495
+ Prepare the following script ` wpa_supplicant_ibss.conf ` (you can modify the script based on your needs):
496
+ ``` shell
497
+ network={
498
+ ssid=" ibss1"
499
+ mode=1
500
+ frequency=2412
501
+ key_mgmt=WPA-PSK
502
+ proto=RSN
503
+ pairwise=CCMP
504
+ group=CCMP
505
+ psk=" 12345678"
506
+ }
507
+ ```
508
+ Using the command ** wpa_supplicant** , configure ` vw3 ` and ` vw4 ` to join ` ibss1 ` .
509
+ ``` shell
510
+ $ sudo ip netns exec ns3 wpa_supplicant -i vw3 -B -c scripts/wpa_supplicant_ibss.conf
511
+ $ sudo ip netns exec ns4 wpa_supplicant -i vw4 -B -c scripts/wpa_supplicant_ibss.conf
512
+ ```
513
+ Check the information of ` vw3 ` .
514
+ ``` shell
515
+ $ sudo ip netns exec ns3 iw dev vw3 info
516
+ ```
517
+ You should see output similar to the following:
518
+ ```
519
+ Interface vw3
520
+ ifindex 6
521
+ wdev 0x400000001
522
+ addr 00:76:77:33:00:00
523
+ ssid ibss1
524
+ type IBSS
525
+ wiphy 4
526
+ txpower 0.00 dBm
527
+ ```
488
528
#### Transmission/Receivement test
489
529
To perform a ping test between two IBSS devices (` vw3 ` and ` vw4 ` ) in the same ibss cell (` ibss1 ` ), use the following command:
490
530
``` shell
0 commit comments