I have started (for some time now, to be honest) to transfer my router’s function to my ODROID-c1
that runs Archlinux arm so I have my favorite distribution on this beautiful development board.
# uname -a Linux myodroid 3.10.80-13-ARCH #1 SMP PREEMPT Tue Sep 15 15:43:38 MDT 2015 armv7l GNU/Linux
for specs you can click here
The board has an Gigabit Ethernet port but no Wireless Card.
I had a spare USB Wireless Network card, so I’ve used it on one of the four USB slots of the board.
Bus 001 Device 003: ID 148f:3370 Ralink Technology, Corp. RT3370 Wireless Adapter
Reading through the internet (mostly on archlinux wiki) I had, first, to create a Bridge with my Ethernet card and then hostapd will add my Wireless Card to the same bridge.
Although I use systemd for a while sometime, I wasnt able to create the bridge interface via systemd. I’ve tested my confs/files to a secondary linux machine and I know for a fact that my notes are correct. Somehow it seems that there is a problem with systemd on ODROID-c1 regarding this or perhaps I havent found the problem with my setup!
So I’ve created a shell script that runs after boot: net.sh
#!/bin/sh ip link add br0 type bridge ip link set br0 up ip link set eth0 up ip link set eth0 master br0 ip addr add 192.168.1.2/24 dev br0 ip route add default via 192.168.1.1 dev br0 sysctl -w net.ipv4.ip_forward=1 iptables -t nat -A POSTROUTING -o br0 -j MASQUERADE iptables -A FORWARD -j ACCEPT systemctl restart hostapd.service
a basic setup of hostapd is below. I’ve used TEST as the ssid and TESTTESTTEST as the password:
/etc/hostapd/hostapd.conf
interface=wlan0 bridge=br0 driver=nl80211 ctrl_interface=/var/run/hostapd ctrl_interface_group=0 ssid=TEST hw_mode=g channel=3 own_ip_addr=127.0.0.1 wpa=2 wpa_passphrase=TESTTESTTEST wpa_key_mgmt=WPA-PSK
On this ODROID-C1 board, I run my own DNS Cache/DHCP server with dnsmasq.
/etc/dnsmasq.conf
listen-address=192.168.1.1 addn-hosts=/etc/hosts.txt dhcp-range=192.168.1.16,192.168.1.32,12h dhcp-option=option:router,192.168.1.1 dhcp-option=option:dns-server,192.168.1.2 dhcp-option=option:ntp-server,193.93.167.241