DHCP Server to Redirect any url to landing page

主宰稳场 提交于 2019-11-30 10:32:37

You appear to be trying to set up what's known as a captive portal.

There are several components to this, one of which is indeed a DHCP server, but that's hardly the most critical one.

A short overview

Your network will have at the very least the following components:

  • DHCP server
  • DNS server
  • Gateway
  • A login system

Clients will get an IP address from the DHCP server and will be told to use your DNS server and gateway.

Solution 1: DNS based redirection

Until users are logged in your DNS server replies with the IP address of the login web server. Take care to set a very low TTL on the DNS replies. You want to make sure the clients browser re-resolves the IP address after the login.

This will quite likely cause problems for any application other than web browsing on port 80.

Solution 2: TCP interception

This is a slightly harder solution, but is likely to work better. The DNS server always returns the correct IP address for whatever web site the client is trying to reach. The gateway will redirect the TCP sessions on port 80 to the login server. All other packets should get an ICMP error reply (network unreachable for example).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!