You technically juts have to cut'n paste the config if you get the same hardware and operating system.
But if you pay attention, we did not cover one particular aspect of the hardware: integrated WIFI
In this article we will pursue the SOHO network appliance installation and enable the integrated module so that all mobile host @ home can benefit from connectivity offered by SOHO router. In this basic example I'll show you basic WIFI implementation
- WIFI is b/g/n module (therefore no 5Ghz wifi)
- WIFI won't be directly under RARE/freeRouter control
[ SOHO #007 ] - "I'm not wired ... I need connectivity too !"
Log into linux appliance via management interface using previously configured veth1a IPv4 address: 192.168.128.1
My google-fu indicated me that the lunux driver should be ath9k
So it seems that Debian kernel has detected and loaded the proper module
wlan0 interface appeared !
- When freshly configured, wlan0 is disabled. You can enable it:
- However, note that in SOHO #002, all is set during startup script (/rtr/hwdet-all.sh) via systemd
- Last observation is that in SOHO #002 we also disabled Linux systemd networking
- systemd use to name linux interface based on their pcie id: wlp9s0
- after disabling it, WIFI interface name appears to become: wlan0
Now that the hardware and corresponding linux driver is loaded we can proceed to Linux access point software installation
hostapd configuration is Debian is in /etc/hostapd/hostapd.conf. But remember this is no more under systemd startup control as we disabled entirely systemd networking.
You can check that hostapd is correctly configured by launching it manually
From that point from your mobile phone or laptop:
- you should be able to see YOUR_HOME_WIFI_SSID appearing in the list of available wireless network
- you should be able to connect to YOUR_HOME_WIFI_SSID
- But your mobile device might say: "Internet might not be available or Cannot retrieve IP from YOUR_HOME_WIFI_SSID"
- hostapd id triggered when SOHO router is booting up (described in rtr-hw.txt)
- Remember wlan0 is visible from the Linux kernel and managed by hostapd
- we created a veth pair (veth2a@linux side and veth2b@sdn998 SOHO router side)
- we bind wlan0 to veth2a (Cf. rtr-hw.txt →
.bin wlan0 veth2a)
- and then veth2a is bound to sdn998 which is interface veth2b controlled by DPDK (Cf. SOHO #002 and SOHO #003)
So at that point all traffic coming from wlan0 will also make its way to sdn998
Now we need to make wireless traffic visible through VRF inet as we need to enable IPv4 (or IPv6) connectivity for mobile device.
So this is done in 2 steps.
Step - 1 - Create a bridge for wireless
Creating a bridge will also create interface bvi.
Step - 2 - Add veth2b to the wireless bridge
Make sure that bridge 1, sdn998, hairpin11 and hairpin12 are in declared into p4lang server
The trick is to use hairpin interfaces. For experienced Junos user, this corresponds to Junos logical tunnel lt interface
Step - 1 - Create a hairpin pair in order to redirect wireless traffic into VRF inet
Creating a hairpin 1 will also create interface hairpin11 and hairpin12.
Step - 2 - Add hairpin11 to the wireless bridge
Step - 3 - Add hairpin12 into VRF inet
At that point all traffic from/to wireless will transit via hairpin12 and reach VRF inet
Now, DHCP request coming from mobile client can reach SOHO router VRF inet via hairpin12.
Step - 1 - Create DHCP server for Wireless client in VRF inet
Creating hairpin 1 will also create interface hairpin11 and hairpin12.
Connect to WIFI via laptop wifi
So based on the debug output:
- DHCP allocated 192.168.129.83
- Primary DNS (dns1) is 192.168.254.1
- Network has /24 CIDR
Pay attention to the server that answered ! At the present moment it should not be fd00:2200::1. It is simply because I had a setup with IPv6 fully enabled.
In this article we enabled the appliance WIFI integrated hardware:
- We ensured that wifi hardware was detected by Linux kernel
- We also ensured that Linux loaded the right wifi driver kernel module
- hostapd would control wireless interface
- we create a veth pair (veth2a Linux side - veth2b / DPDK side)
- wlan0 traffic is bound to veth2a using pcap2pcap utility (in freeRouter binaries bundle)
- veth2b is bound to sdn998 (and declalred in p4lang server)
- we create a hairpin 1 (hairpin11 , hairpin12) interface
- bridge 1 has also been created
- sdn998 and hairpin11 have been added to the bridge
- hairpin12 is a routed interface declared in VRF inet and has an IP 192.168.129.1 inside wireless subnet 192.168.129.0/24
RARE validated design: [ SOHO #006 ] - key take-away
In this example the key take-away are:
- The above action lead to bridge wireless traffic and pour it into VRF inet
- From that point all defined previously will apply (NAT, DHCP) but now with wireless subnetwork
This example cover the case of a basic bridge in which we included a basic interface sdn998 and a hairpin interfaces pouring traffic from/to VRF inet. freeRouter is acting as a wireless controller local to the integrated WIFI. We will see in further article another typical WIFI implementation more flexible. Pleas note that we could have directly applied routing at sdn998 (so without the use of the bridge and hairpin). The usage of bridge and hairpin setup will be described in a next article describing alternate wifi implementation. In short we will add an OpenWRT Access point behind sdn6 and SOHO router will act as WIFI controller for both the integrated WIFI hotspot and the newly added OpenWRT.