Skip to content
This repository has been archived by the owner on May 22, 2020. It is now read-only.

vitalvas/captive_redirect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

Captive redirect

ENV Config

  • CAPTIVE_5555 - Where 5555 - port. Value - redirect path.
  • CAPTIVE_NOORIGIN - see code :)

Usage

Build and run

GOOS=linux GOARCH=amd64 go build -o /usr/local/sbin/captive_redirect main.go

Add to rc.local:

CAPTIVE_5555=http://my.example.com/no_money.cgi CAPTIVE_5556=http://acs.example.com/register.cgi /usr/local/sbin/captive_redirect &

IPTables

iptables -t nat -A PREROUTING -m set --match-set no_money src -p tcp --dport 80 -j REDIRECT --to-port 5555
iptables -t nat -A PREROUTING -m set --match-set guest src -p tcp --dport 80 -j REDIRECT --to-port 5556

About

Redirect to captive portal

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages