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 [2026/05/04 10:23] (current) val [Services/Captive Portal] |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Сервис Captive Portal ====== | ====== Сервис Captive Portal ====== | ||
| + | |||
| + | ===== pfSense ===== | ||
| + | |||
| + | * [[https://www.pfsense.org/]] | ||
| + | * [[https://ftp.fagskolen.gjovik.no/pub/pfSense/]] | ||
| + | * [[https://simplificandoredes.com/en/install-pfsense-on-virtualbox/]] | ||
| + | |||
| + | ==== Базовая настройка ==== | ||
| + | |||
| + | * По умолчанию, em0 WAN, em1 LAN | ||
| + | <code> | ||
| + | Username: admin | ||
| + | Password: pfsense | ||
| + | Default IP: 192.168.1.1 | ||
| + | |||
| + | Через консоль назначаем LAN IP: 192.168.X.1/24 | ||
| + | </code> | ||
| + | |||
| + | * Подключаемся через Web и отвечаем на вопросы Визарда: | ||
| + | <code> | ||
| + | Hostname: gate | ||
| + | Domain: corpX.un | ||
| + | Primary DNS Server: 192.168.X.10 | ||
| + | Override DNS: No | ||
| + | |||
| + | Timezone: Europe/Moscow | ||
| + | |||
| + | Configure WAN Interface | ||
| + | SelectedType: static | ||
| + | IP Address: 172.16.1.X | ||
| + | Subnet Mask: 24 | ||
| + | Add a new gateway ... | ||
| + | |||
| + | Admin Password: Pa$$w0rd | ||
| + | |||
| + | Services/DNS Resolver/General Settings/Enable: false | ||
| + | </code> | ||
| + | |||
| + | ==== Services/DHCP Server/LAN ==== | ||
| + | |||
| + | <code> | ||
| + | Address Pool Range: 192.168.13.101 - 192.168.13.109 | ||
| + | DNS Servers: 192.168.13.10 | ||
| + | </code> | ||
| + | |||
| + | ==== System/Certificates/Certificates ==== | ||
| + | |||
| + | * [[Пакет OpenSSL#Создание самоподписанного сертификата]] wild | ||
| + | |||
| + | ==== System/Advanced/Admin Access ==== | ||
| + | |||
| + | * SSL/TLS Certificate: wild | ||
| + | |||
| + | ==== System/User Manager/Authentication Servers ==== | ||
| + | |||
| + | * [[Сервис FreeRADIUS]] | ||
| + | |||
| + | <code> | ||
| + | Descriptive name: radius server | ||
| + | Type: RADIUS | ||
| + | Hostname or IP address: server | ||
| + | Shared Secret: testing123 | ||
| + | RADIUS NAS IP Attribute: LAN... | ||
| + | </code> | ||
| + | |||
| + | ==== Services/Captive Portal ==== | ||
| + | |||
| + | <code> | ||
| + | Interfaces: LAN | ||
| + | |||
| + | Authentication Method: Authentication backend !!! По умолчанию | ||
| + | Authentication Server: radius server | ||
| + | NAS Identifier: gate | ||
| + | |||
| + | Enable HTTPS login: yes | ||
| + | HTTPS server name: gate.corpX.un | ||
| + | SSL/TLS Certificate: wild | ||
| + | |||
| + | Services/Captive Portal/corpX/Allowed IP Addresses | ||
| + | 192.168.X.10 | ||
| + | </code> | ||
| + | ===== Самописный вариант ===== | ||
| * Captive Portal Using PHP and iptables Firewall on Linux ([[http://aryo.info/labs/captive-portal-using-php-and-iptables.html]]) | * Captive Portal Using PHP and iptables Firewall on Linux ([[http://aryo.info/labs/captive-portal-using-php-and-iptables.html]]) | ||
| * 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) ===== | + | ==== Linux(Ubuntu) ==== |
| <code> | <code> | ||
| root@gate:~# cat nat.sh | root@gate:~# cat nat.sh | ||
| Line 17: | Line 99: | ||
| 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 24: | Line 120: | ||
| </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> | </code> | ||