This is a Better Approach To Mobile Adhoc Networking (B.A.T.M.A.N.).
/' '\ / \__^..^__/ \ / / _ \vv/ _ \ \ / \/ \ / \ B.A.T.M.A.N.
With BATMAN, WLAN-enabled computers can be linked to a large, widely distributed network via the WLAN interface. The necessary optimizations, such as establishing the fastest packet path, run automatically in the background.
Outdated
modprobe batman-adv
; To relaod after reboot put batman-adv
into /etc/modules
.Edit /etc/network/interfaces:
auto wlan0 iface wlan0 inet static address <IP> netmask <Network-Mask> network <Network> broadcast <Network-Broadcast> mtu 1527 wireless-mode ad-hoc wireless-essid LimeJACK-Batman wireless-ap 02:12:34:56:78:9A wireless-ch 2 post-up batctl if add wlan0 pre-down batctl if del wlan0 auto bat0 iface bat0 inet static address 192.168.123.<IP> netmask 255.255.255.0 network 192.168.123.0 broadcast 192.168.123.255
A computer can route into the LAN via its second interface by adjusting the file /etc/sysctl.conf
:
net.ipv4.ip_forward=1/g
Furthermore the file /etc/network/interfaces
must be edited for LAN routing of a computer by appending the following to the bat0 section:
post-up /usr/share/<your dir>/batman.iptables
The file /usr/share/<your dir>/batman.iptables
looks like this:
#!/bin/bash /sbin/iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.123.0/24
Alternatively, for all other computers that do not use the second interface to route, change the bat0 section in the file /etc/network/interfaces
by appending the following to the bat0 section:
gateway 192.168.123.1
Do not forget to fix the name server:
echo 'nameserver 192.168.1.1' > /etc/resolv.conf