First, set up DHCP on "router" device:
Give eth0 an IP address (forget command, I gave it 192.168.2.1)
Give DNSMASQ a config file with these lines:
NOTE:
- Doubt all lines necessary
- ADDED to defaults, and taken from here:
domain-needed
bogus-priv
dhcp-authoritative
local=/MyDevice.lan/
interface=eth0
server=8.8.8.8
server=8.8.4.4
expand-hosts
domain=MyDevice.lan
dhcp-range=eth0,192.168.2.50,192.168.2.200,255.255.255.0,12h
From the same source as above (and as root):
echo 1 > /proc/sys/net/ipv4/conf/eth0/proxy_arp
echo 1 > /proc/sys/net/ipv4/conf/wlan0/proxy_arp
echo 1 > /proc/sys/net/ipv4/ip_forward
Then, from here (with modification wlan1-->eth0):
iptables -A FORWARD -i eth0 -o wlan0 -j ACCEPT
iptables -A FORWARD -i wlan0 -o eth0 -m state --state ESTABLISHED,RELATED \
-j ACCEPT
iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
NOW, on the device that had already been connected to the BB (router), I had to set the default gateway:
ip route add default via 192.168.2.1
It works.