CPC H04L 67/563 (2022.05) [H04L 45/66 (2013.01); H04L 45/742 (2013.01); H04L 45/745 (2013.01); H04L 2212/00 (2013.01)] | 20 Claims |
1. A method for redirecting a user to a captive portal, the method comprising:
trapping, by hardware of a network device, an incoming frame originating from a host, wherein the incoming frame comprises a request directed to an external server, the request having a layer 2 (L2) header and a payload, wherein the payload specifies information associated with the external server, wherein the user of the host has not been authenticated by the captive portal at a time when the incoming frame is trapped;
extracting, by an L2 forwarder of the network device, the L2 header, an L3 header, and the payload from the incoming frame;
modifying the L3 header to replace a destination IP address of the external server with an IP address of a redirection server;
forwarding, by the L2 forwarder after the extracting, the L3 header and the payload towards the redirection server, wherein the redirection server is configured to generate a redirection response based on the payload;
encapsulating the redirection response to obtain an L3 response packet having a second L3 header;
modifying the second L3 header to specify the IP address of the external server as a source IP address and a host IP as the destination IP address;
encapsulating the L3 response packet using information from the L2 header to obtain an output frame comprising the second L3 header and wherein the redirection response specifies a URL for the captive portal; and
transmitting the output frame towards the host.
|