mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-10-29 17:42:41 +00:00
Added check when parsing ssid info retrieved from iwinfo. Program will exit if expected interface count and iwinfo entry count mismatch. Fixes: WIFI-14564 Signed-off-by: alex18_huang <alex18_huang@accton.com>
DHCP Option82 injector
inject DHCP option 82 transparently on TIP AP
Format
Option 82: (82) Agent Information
Option: (1) Agent Circuit ID
Agent Circuit ID: BSSID:ESSID
Option: (2) Agent Remote ID
Agent Remote ID: AP Hostname
Usage
add "dhcpinject" under ssid->services
{
"interfaces": [
{
"ethernet": [
{
"select-ports": [
"WAN*"
]
}
],
"ipv4": {
"addressing": "dynamic"
},
"name": "WAN",
"role": "upstream",
"services": [
"ssh",
"lldp",
"dhcp-snooping",
"http"
],
"ssids": [
{
"bss-mode": "ap",
"encryption": {
"ieee80211w": "optional",
"key": "ERC981206",
"proto": "psk2"
},
"name": "EAP101-ERICHI",
"services": [
"wifi-frames",
"dhcpinject" <-- devices connected to this ssid will trigger this application
],
"wifi-bands": [
"2G",
"5G"
]
},
{
"bss-mode": "ap",
"encryption": {
"ieee80211w": "optional",
"key": "AKH981016",
"proto": "psk2"
},
"name": "EAP101-AKIHO",
"services": [
"wifi-frames", <-- devices connected to this ssid will NOT trigger this application
],
"wifi-bands": [
"2G",
"5G"
]
},
{
"bss-mode": "ap",
"encryption": {
"ieee80211w": "optional",
"key": "DMY971128",
"proto": "psk2"
},
"name": "EAP101-DAMAYU",
"services": [
"wifi-frames",
"dhcpinject" <-- devices connected to this ssid will trigger this application
],
"wifi-bands": [
"2G"
]
}
]
}
],
"services": {
"dhcp-inject": {
"select-ports": [
"WAN*" <-- Will fallback to eth0 if no ports are provided
]
}
}
}
Workflow
Suppose SSID EAP101-ERICHI binds to iface wlan0
- Application read SSIDs and uplink ports from env variable
$SSIDsand$PORTs(generated by script/etc/init.d/udhcpinject) - Apply
tconwlan0to redirect DHCP Discover/Request to ifaceifb-inject - Application listen on interface
ifb-injectfor incoming DHCP packets - On packets arrive, application identify the src interface by vlan tag and insert corresponding attribute
- Forward packet to up0v0