Files
wlan-ap/feeds/ucentral/udhcpinject
Kumiko18 4704fe6ae4 WIFI-15125: Support multiple upstream
Support multiple ssid <-> upstream bindings

Signed-off-by: Kumiko18 <alex18_huang@accton.com>
2025-09-15 07:34:57 +00:00
..
2025-09-15 07:34:57 +00:00
2025-09-15 07:34:57 +00:00

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 $SSIDs and $PORTs (generated by script /etc/init.d/udhcpinject)
  • Apply tc on wlan0 to redirect DHCP Discover/Request to iface ifb-inject
  • Application listen on interface ifb-inject for incoming DHCP packets
  • On packets arrive, application identify the src interface by vlan tag and insert corresponding attribute
  • Forward packet to up0v0