This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
сервис_captive_portal [2014/04/22 13:21] val |
сервис_captive_portal [2014/06/17 13:34] val |
||
---|---|---|---|
Line 4: | Line 4: | ||
* Using iptables and PHP to create a captive portal ([[http://www.andybev.com/index.php/Using_iptables_and_PHP_to_create_a_captive_portal]]) | * Using iptables and PHP to create a captive portal ([[http://www.andybev.com/index.php/Using_iptables_and_PHP_to_create_a_captive_portal]]) | ||
+ | ===== Linux(Ubuntu) ===== | ||
<code> | <code> | ||
root@gate:~# cat nat.sh | root@gate:~# cat nat.sh | ||
Line 16: | Line 17: | ||
conntrack -F | conntrack -F | ||
+ | </code> | ||
+ | |||
+ | ===== FreeBSD ===== | ||
+ | <code> | ||
+ | gate# cat /etc/pf.conf | ||
+ | </code><code> | ||
+ | rdr on em0 proto tcp from 192.168.X/24 to any port 80 -> 127.0.0.1 port 80 | ||
+ | |||
+ | nat on em1 from 192.168.X/24 to any -> 172.16.1.X | ||
+ | </code> | ||
+ | |||
+ | ===== Apache ===== | ||
+ | |||
+ | <code> | ||
+ | # cat index.php | ||
</code><code> | </code><code> | ||
- | root@gate:~# cat /var/www/index.php | ||
<HTML> | <HTML> | ||
<HEAD> | <HEAD> | ||
Line 23: | Line 38: | ||
</HEAD> | </HEAD> | ||
<BODY> | <BODY> | ||
- | Адрес вашего компьютера: <?php echo $_SERVER['REMOTE_ADDR']; ?><br> | + | Address of your computer: <?php echo $_SERVER['REMOTE_ADDR']; ?><br> |
</BODY> | </BODY> | ||
</HTML> | </HTML> | ||
+ | </code> |