Source code template for External Web Portal (Business Router)
TL-R600VPN( V4 ) , ER7206 , TL-ER6120( V2 V3 ) , TL-ER6020( V2 ) , ER605 , TL-ER5120( V4 ) , TL-R480T+( V9 ) , TL-R470T+( V6 )
Recent updates may have expanded access to feature(s) discussed in this FAQ. Visit your product's support page, select the correct hardware version for your device and check either the Datasheet or the firmware section for the latest improvements added to your product.
Suitable for Authentication with external web portal on TP-Link Business Routers. If you are using the Omada Controller, please refer to FAQ2912.
Note: The keywords in Bold Italics indicate parameters that are automatically filled by the router and forwarded to the Web Portal Server.
EXTERNAL_WEB_SERVER: The IP address or Domain name (and port if necessary) of the External Web Portal Server.
GATEWAY_IP_ADD: The LAN IP address of the router.
GATEWAY_PORT: A random port by the router.
INTERFACE: The network interface of the router.
AUTH_PORT: The Portal Authentication Port.
CLIENT_IP_ADD: The IP address of the client.
CLIENT_MAC_ADD: The MAC address of the client, the format is like: AA:BB:CC:DD:EE:FF.
REDIRECT_URL: If you do not set the redirect URL after clients passing the authentication, the default redirect URL depends on the wireless clients.
This document outlines the requirements when establishing an external web portal server. Please note that External Web Portal can only be used when the authentication page is External Links.
The below picture depicts the workflow among the client, Gateway (SMB Router), External Web Portal, and the local authentication server. It will help you better understand the requirements of establishing an External Web Portal server.
1. When the clients are connected to the network and try to access the Internet, the Gateway will intercept their HTTP(S) GET requests and reply with Code 302 to redirect (Step 1 and Step 2).
3. Client sends HTTP GET request to the External Web Server with the below parameters (Step 3 and Step 4).
”http(s)://EXTERNAL_WEB_SERVER/?gw_address=GATEWAY_IP_ADD&gw_port=GATEWAY_PORT&gw_id=INTERFACE&ip=CLIENT_IP_ADD&mac=CLIENT_MAC_ADD&url= REDIRECT_URL”.
For example, “http://192.168.0.200:8080/?gw_address=192.168.0.1&gw_port=2060&gw_id=br-lan&ip=192.168.0.101&mac=94:DE:80:57:01:95&url=http://www.tp-link.com” (Step 3).
4. Client sends HTTP GET requests with the username and password to the router (Step 5).
“http://GATEWAY_IP_ADD:AUTH_PORT/ wifidog/logincheck/?user=USERNAME&pwd=PASSWORD&Submit=submit&gw_address=GATEWAY_IP_ADD&gw_port= GATEWAY_PORT &gw_id=INTERFACE&ip=CLIENT_IP_ADD&mac=CLIENT_MAC_ADD&url=REDIRECT_URL&authtype=web”.
6. Gateway communicates with the radius server (local authentication or external radius server) to verify the username and password (Step 6 and Step 7).
7. If the authentication is passed, i.e., Access-Accept is received from the radius server, the Gateway will redirect the “Success Redirect URL” or “REDIRECT_URL” decided by the clients.
Here is a simple demo for you to develop your External Web Portal working with SMB Routers. Download it.
Is this faq useful?
Your feedback helps improve this site.
What’s your concern with this article?
- Dissatisfied with product
- Too Complicated
- Confusing Title
- Does not apply to me
- Too Vague
- Other
We'd love to get your feedback, please let us know how we can improve this content.
Thank you
We appreciate your feedback.
Click here to contact TP-Link technical support.
Recommend Products
TP-Link Community
Still need help? Search for answers, ask questions, and get help from TP-Link experts and other users around the world.
We have updated our Policies. Read Privacy Policy and Terms of Use here.
This website uses cookies to improve website navigation, analyze online activities and have the best possible user experience on our website. You can object to the use of cookies at any time. You can find more information in our privacy policy .
We have updated our Policies. Read Privacy Policy and Terms of Use here.
This website uses cookies to improve website navigation, analyze online activities and have the best possible user experience on our website. You can object to the use of cookies at any time. You can find more information in our privacy policy .
Basic Cookies
These cookies are necessary for the website to function and cannot be deactivated in your systems.
TP-Link
accepted_local_switcher, tp_privacy_base, tp_privacy_marketing, tp_smb-select-product_scence, tp_smb-select-product_scenceSimple, tp_smb-select-product_userChoice, tp_smb-select-product_userChoiceSimple, tp_smb-select-product_userInfo, tp_smb-select-product_userInfoSimple, tp_top-banner, tp_popup-bottom, tp_popup-center, tp_popup-right-middle, tp_popup-right-bottom, tp_productCategoryType
Livechat
__livechat, __lc2_cid, __lc2_cst, __lc_cid, __lc_cst, CASID
Youtube
id, VISITOR_INFO1_LIVE, LOGIN_INFO, SIDCC, SAPISID, APISID, SSID, SID, YSC, __Secure-1PSID, __Secure-1PAPISID, __Secure-1PSIDCC, __Secure-3PSID, __Secure-3PAPISID, __Secure-3PSIDCC, 1P_JAR, AEC, NID, OTZ
Analysis and Marketing Cookies
Analysis cookies enable us to analyze your activities on our website in order to improve and adapt the functionality of our website.
The marketing cookies can be set through our website by our advertising partners in order to create a profile of your interests and to show you relevant advertisements on other websites.
Google Analytics & Google Tag Manager
_gid, _ga_<container-id>, _ga, _gat_gtag_<container-id>
Google Ads & DoubleClick
test_cookie, _gcl_au
Meta Pixel
_fbp
Crazy Egg
cebsp_, _ce.s, _ce.clock_data, _ce.clock_event, cebs
Hotjar
OptanonConsent, _sctr, _cs_s, _hjFirstSeen, _hjAbsoluteSessionInProgress, _hjSessionUser_14, _fbp, ajs_anonymous_id, _hjSessionUser_<hotjar-id>, _uetsid, _schn, _uetvid, NEXT_LOCALE, _hjSession_14, _hjid, _cs_c, _scid, _hjAbsoluteSessionInProgress, _cs_id, _gcl_au, _ga, _gid, _hjIncludedInPageviewSample, _hjSession_<hotjar-id>, _hjIncludedInSessionSample_<hotjar-id>
lidc, AnalyticsSyncHistory, UserMatchHistory, bcookie, li_sugr, ln_or