NG IN Registration Setup
(صفحهای جدید حاوی 'Category:Network ==Introduction== ===Story=== When an NG-IN User Connects for the first time, IBSng will automatically creates an account fo...' ایجاد کرد) |
|||
(یک ویرایش میانی توسط یک کاربر نشان داده نشدهاست) | |||
سطر ۱: | سطر ۱: | ||
[[Category:Network]] | [[Category:Network]] | ||
+ | <div dir=rtl lang=en> | ||
+ | __TOC__ | ||
+ | </div> | ||
+ | <div dir=ltr lang=en> | ||
==Introduction== | ==Introduction== | ||
===Story=== | ===Story=== |
نسخهٔ کنونی تا ۱۸ سپتامبر ۲۰۱۱، ساعت ۱۶:۰۲
محتویات |
[ویرایش] Introduction
[ویرایش] Story
When an NG-IN User Connects for the first time, IBSng will automatically creates an account for user using his caller ID and group name mentioned in IN ras attributes. Because Account is created automatically, there's no way ISP owner knows who the customer is, and where is his address. So we created a subsystem to force users to register their information after automatic creation of user.
[ویرایش] How It Works
The idea is using failed login username feature of IBSng, to redirect user to an special registration page. So basically every NG-IN user that does not have name, address, phone or cell phone attributes filled, WILL FAIL to login. After login failure they will virtually login using failed login username and we setup network rules so they'll see our registration page on every web page they attempt to see. This feature is available with NG-IN module of B1.33 and afterwards.
[ویرایش] IBSng Configuration
As previously mentioned we need a failed user with multiple login and special ip pool, and set that as failed_login_username attribute of IN ras
[ویرایش] Network Configuration
A network rule needs to be setup, to redirect all failed user ip pool and dst port 80 traffic to IBSng server port 8000.
- Warning
- Don't forget to exclude IBSng ip address from redirection rule
A sample configuration for mikrotik, assuming IBSng ip address is 10.0.0.3 and failed user ip pool contains ip in range 192.168.20.0/24
0 chain=dstnat dst-address=10.0.0.3 protocol=tcp dst-port=80 action=return 1 chain=dstnat src-address=192.168.20.0/24 protocol=tcp dst-port=80 action=dst-nat to-addresses=10.0.0.3 to-ports=8000
[ویرایش] Apache Configuration
Apache needs to be configured to listen on port 8000 and redirect any request to registeration form
[ویرایش] Listening on an extra port
Add these lines to /etc/apache2/ports.conf
NameVirtualHost *:8000 Listen 8000
[ویرایش] Create IN Redirect Site
Create in_redirect file under /etc/apache2/sites-available. Replace x.x.x.x with a ng in user accessible ip of IBSng server.
<VirtualHost *:8000> ServerAdmin webmaster@localhost DocumentRoot /var/www/ <Directory /> Options FollowSymLinks AllowOverride All </Directory> <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory> # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog /var/log/apache2/access.log combined RewriteEngine on RewriteRule .* http://x.x.x.x/IBSng-tg/addons/ng_in/failedUser [R] </VirtualHost>
[ویرایش] Enabling Site and Modules
Run
a2ensite in_redirect a2enmod rewrite
[ویرایش] Customizing Registration Pages
There are 3 template files located under /usr/local/IBSng/interface/turbogears/IBSng/ibsng/addons/ng_in/templates/ that can be tempered as customer wants.
- register.html: Main Registertion Page
- register_error.html: Error page shows when an unknown error occurs
- register_success.html: The page that will be shown after registration has been completed successfully
- Warning
- Template files should be XHTML compliant