Hi Guys,
I am trying to change the essid of my B.A.T.M.A.N Ad-hoc Network once I have created the network, but I cant.
I am working in a Raspberry Pi, working on Raspbian based on linux, so I have this code:
#!/bin/bash
modprobe batman-adv
ip link set wlan0 down
sleep 1
ifconfig wlan0 down; iwconfig wlan0 mode ad-hoc
ifconfig wlan0 down; ifconfig wlan0 mtu 1532
ifconfig wlan0 down; iwconfig wlan0 mode ad-hoc essid Red-Adhoc ap 02:1B:55:AD:0C:02 channel 1
sleep 1
ip link set wlan0 up
sleep 1
batctl if add wlan0
ifconfig bat0 up
sleep 5
ifconfig bat0 10.42.0.22 255.255.255.0
batctl gw_mode client
route add default gw 10.42.0.1 bat0
when I executed it, the first time works perfectly, I have connection; but If I modified the ESSID (with RED2 for example) of the script and executed it again, It doesnt work anymore, and there is not way to fix it, and I have to reboot.
I have tried eliminating the interface bat0 with
echo none > /sys/class/net/wlan0/batman_adv/mesh_iface
and execute the script again but It doesnt work neither.
Is it possible to change the essid or another parameter like the ap or the channel once the ad hoc network was created?
Thanks
I am trying to change the essid of my B.A.T.M.A.N Ad-hoc Network once I have created the network, but I cant.
I am working in a Raspberry Pi, working on Raspbian based on linux, so I have this code:
#!/bin/bash
modprobe batman-adv
ip link set wlan0 down
sleep 1
ifconfig wlan0 down; iwconfig wlan0 mode ad-hoc
ifconfig wlan0 down; ifconfig wlan0 mtu 1532
ifconfig wlan0 down; iwconfig wlan0 mode ad-hoc essid Red-Adhoc ap 02:1B:55:AD:0C:02 channel 1
sleep 1
ip link set wlan0 up
sleep 1
batctl if add wlan0
ifconfig bat0 up
sleep 5
ifconfig bat0 10.42.0.22 255.255.255.0
batctl gw_mode client
route add default gw 10.42.0.1 bat0
when I executed it, the first time works perfectly, I have connection; but If I modified the ESSID (with RED2 for example) of the script and executed it again, It doesnt work anymore, and there is not way to fix it, and I have to reboot.
I have tried eliminating the interface bat0 with
echo none > /sys/class/net/wlan0/batman_adv/mesh_iface
and execute the script again but It doesnt work neither.
Is it possible to change the essid or another parameter like the ap or the channel once the ad hoc network was created?
Thanks