User Tools

Site Tools


using_iptables_and_php_to_create_a_captive_portal

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
using_iptables_and_php_to_create_a_captive_portal [2018/12/06 19:58]
abeverley
using_iptables_and_php_to_create_a_captive_portal [2018/12/06 19:59]
abeverley
Line 47: Line 47:
 <​html><​code></​html>​ <​html><​code></​html>​
  
-<​code>​ 
 IPTABLES=/​sbin/​iptables IPTABLES=/​sbin/​iptables
  
Line 89: Line 88:
 $IPTABLES -A FORWARD -i eth0 -o ppp0 -j ACCEPT $IPTABLES -A FORWARD -i eth0 -o ppp0 -j ACCEPT
 $IPTABLES -t nat -A POSTROUTING -o ppp0 -j MASQUERADE $IPTABLES -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
-</​code>​+
 <​html></​code></​html>​ <​html></​code></​html>​
  
Line 100: Line 99:
 <​html><​code></​html>​ <​html><​code></​html>​
  
-<​code>​ 
 /​usr/​sbin/​conntrack -L \ /​usr/​sbin/​conntrack -L \
     |grep $1 \     |grep $1 \
Line 109: Line 107:
             substr(\$6,​5) \" -p tcp --orig-port-src \" substr(\$7,​7) \" \             substr(\$6,​5) \" -p tcp --orig-port-src \" substr(\$7,​7) \" \
             --orig-port-dst 80\"); }"             --orig-port-dst 80\"); }"
-</​code>​ 
 <​html></​code></​html>​ <​html></​code></​html>​
  
Line 120: Line 117:
 <​html><​code></​html>​ <​html><​code></​html>​
  
-<​code>​ 
 www-data ALL = NOPASSWD: /​sbin/​iptables -I internet 1 -t mangle -m mac --mac-source ??​\:??​\:??​\:??​\:??​\:??​ -j RETURN www-data ALL = NOPASSWD: /​sbin/​iptables -I internet 1 -t mangle -m mac --mac-source ??​\:??​\:??​\:??​\:??​\:??​ -j RETURN
 www-data ALL = NOPASSWD: /​sbin/​iptables -D internet -t mangle -m mac --mac-source ??​\:??​\:??​\:??​\:??​\:??​ -j RETURN www-data ALL = NOPASSWD: /​sbin/​iptables -D internet -t mangle -m mac --mac-source ??​\:??​\:??​\:??​\:??​\:??​ -j RETURN
 www-data ALL = NOPASSWD: /​usr/​bin/​rmtrack [0-9]*.[0-9]*.[0-9]*.[0-9]* www-data ALL = NOPASSWD: /​usr/​bin/​rmtrack [0-9]*.[0-9]*.[0-9]*.[0-9]*
-</​code>​ 
 <​html></​code></​html>​ <​html></​code></​html>​
  
Line 137: Line 132:
 <​html><​code></​html>​ <​html><​code></​html>​
  
-<​code>​ 
 <?php <?php
  
Line 227: Line 221:
  
 ?> ?>
-</​code>​ 
 <​html></​code></​html>​ <​html></​code></​html>​
  
using_iptables_and_php_to_create_a_captive_portal.txt ยท Last modified: 2020/05/29 10:49 by abeverley