I am trying to configure a Compex 865 (based on Qualcomm AP161) using Chaos Calmer based QSDK to use relayd to relay traffic from my laptop to and from the Internet. My desired configuration is Laptop->wired interface->Compex->Wi-Fi->Guest Access on Wi-Fi router->Internet. I know WDS is easier (almost trivial, in fact) but that doesn't work if I don't have access to the Wi-Fi router and neither does gretap.
I have looked at Configure OpenWRT for relayd using LUCI and Configure OpenWRT for relayd using command line. They both say the same thing and following the instructions of one led me to the same configuration as following the instructions in the other.
In both cases, I ended up with changes to four configuration files. Here are the germane portions of each file:
/etc/config/wireless
config wifi-device wifi0
option type qcawifi
option channel auto
option macaddr xx:xx:xx:xx:xx:xx
option hwmode 11ac
# REMOVE THIS LINE TO ENABLE WIFI:
option disabled 0
config wifi-iface
option device wifi0
option network wwan
option mode sta
option ssid Wingo
option encryption psk2
option key "xxxxxxxxxxxxxx"
/etc/config/network
config interface 'lan'
option ifname 'eth1 eth2'
option force_link '1'
option type 'bridge'
option proto 'static'
option ipaddr '10.0.1.1'
option netmask '255.255.255.0'
option ip6assign '60'
option multicast_querier '0'
option igmp_snooping '0'
option gateway '10.0.0.1'
option dns '10.0.0.1'
config interface 'wwan'
option proto 'dhcp'
option ifname 'ath0'
config interface relay
option proto relay
option ipaddr 10.0.0.43
option network 'lan wwan'
/etc/config/dhcp
config dhcp 'lan'
option ignore '1'
/etc/config/firewall
config zone
option name 'lan'
list network 'lan wwan'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'ACCEPT'
IMPORTANT NOTE: I did run /etc/init.d/relayd enable && /etc/init.d/relayd start
since that seems to be required on my older OpenWRT distro.
NOTE: I could not get the Wi-Fi working without adding the extra option interface ath0
line in the network
file.
NOTE: This post is using a different IP address for the relay than what the Wi-Fi connection is using. Not sure if that's of interest.
Also, set up my Ubuntu laptop to alternatively login to the Compex or to the "relay" network:
relay:
ip a add 10.0.0.195/24 dev eth1
Compex:
ip a add 10.0.1.195/24 dev eth1
With these settings, from my laptop I can login to the Compex but cannot reach the router or internet.
I tried running relayd from the command line with debugging enabled. The debug didn't help me as it made me realize quickly that I don't understand what relayd is doing under the covers:
/usr/sbin/relayd -I br-lan -I ath0 -B -D -L 10.0.0.43 -d
ath0: Found ARP cache entry for host 10.0.0.40 (xx:xx:xx:xx:xx:xx)
ath0: adding host 10.0.0.40 (xx:xx:xx:xx:xx:xx)
ath0: Found ARP cache entry for host 10.0.0.194 (xx:xx:xx:xx:xx:xx)
ath0: adding host 10.0.0.194 (xx:xx:xx:xx:xx:xx)
ath0: Found ARP cache entry for host 10.0.0.170 (xx:xx:xx:xx:xx:xx)
ath0: adding host 10.0.0.170 (xx:xx:xx:xx:xx:xx)
ath0: Found ARP cache entry for host 10.0.0.206 (xx:xx:xx:xx:xx:xx)
ath0: adding host 10.0.0.206 (xx:xx:xx:xx:xx:xx)
br-lan: Found ARP cache entry for host 10.0.1.255 (ff:ff:ff:ff:ff:ff)
br-lan: adding host 10.0.1.255 (ff:ff:ff:ff:ff:ff)
ath0: Found ARP cache entry for host 10.0.0.214 (xx:xx:xx:xx:xx:xx)
ath0: adding host 10.0.0.214 (xx:xx:xx:xx:xx:xx)
br-lan: Found ARP cache entry for host 239.255.255.250 (xx:xx:xx:xx:xx:xx)
br-lan: adding host 239.255.255.250 (xx:xx:xx:xx:xx:xx)
br-lan: Found ARP cache entry for host 224.0.0.22 (xx:xx:xx:xx:xx:xx)
br-lan: adding host 224.0.0.22 (xx:xx:xx:xx:xx:xx)
ath0: Found ARP cache entry for host 10.0.0.199 (xx:xx:xx:xx:xx:xx)
ath0: adding host 10.0.0.199 (xx:xx:xx:xx:xx:xx)
br-lan: Found ARP cache entry for host 10.0.0.206 (xx:xx:xx:xx:xx:xx)
br-lan: Found ARP cache entry for host 10.0.1.199 (xx:xx:xx:xx:xx:xx)
br-lan: adding host 10.0.1.199 (xx:xx:xx:xx:xx:xx)
ath0: Found ARP cache entry for host 10.0.0.195 (xx:xx:xx:xx:xx:xx)
ath0: adding host 10.0.0.195 (xx:xx:xx:xx:xx:xx)
br-lan: Found ARP cache entry for host 10.0.0.199 (xx:xx:xx:xx:xx:xx)
br-lan: Found ARP cache entry for host 224.0.0.1 (xx:xx:xx:xx:xx:xx)
br-lan: adding host 224.0.0.1 (xx:xx:xx:xx:xx:xx)
br-lan: Found ARP cache entry for host 10.0.1.195 (xx:xx:xx:xx:xx:xx)
br-lan: adding host 10.0.1.195 (xx:xx:xx:xx:xx:xx)
br-lan: Found ARP cache entry for host 10.0.0.195 (xx:xx:xx:xx:xx:xx)
ath0: Found ARP cache entry for host 10.0.0.198 (xx:xx:xx:xx:xx:xx)
ath0: adding host 10.0.0.198 (xx:xx:xx:xx:xx:xx)
ath0: Found ARP cache entry for host 10.0.0.1 (xx:xx:xx:xx:xx:xx)
ath0: adding host 10.0.0.1 (xx:xx:xx:xx:xx:xx)
ath0: deleting host 10.0.0.199 (xx:xx:xx:xx:xx:xx)
ath0: deleting host 10.0.0.195 (xx:xx:xx:xx:xx:xx)