setting_up_a_captive_portal_from_scratch_using_debian
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
setting_up_a_captive_portal_from_scratch_using_debian [2018/12/06 20:12] – abeverley | setting_up_a_captive_portal_from_scratch_using_debian [2018/12/06 20:13] – abeverley | ||
---|---|---|---|
Line 1: | Line 1: | ||
=====Setting up a captive portal from scratch using Debian===== | =====Setting up a captive portal from scratch using Debian===== | ||
- | |||
===== Introduction ===== | ===== Introduction ===== | ||
Line 61: | Line 60: | ||
* Install PPP using the command | * Install PPP using the command | ||
- | < | + | < |
apt-get install ppp | apt-get install ppp | ||
+ | </ | ||
- | < | ||
* Create file / | * Create file / | ||
Line 77: | Line 75: | ||
< | < | ||
+ | < | ||
noipdefault | noipdefault | ||
defaultroute | defaultroute | ||
Line 85: | Line 84: | ||
plugin pppoatm.so | plugin pppoatm.so | ||
0.0.38 | 0.0.38 | ||
+ | </ | ||
< | < | ||
Line 103: | Line 103: | ||
< | < | ||
+ | < | ||
apt-get install ppp | apt-get install ppp | ||
+ | </ | ||
< | < | ||
Line 116: | Line 118: | ||
< | < | ||
+ | < | ||
noipdefault | noipdefault | ||
defaultroute | defaultroute | ||
Line 124: | Line 127: | ||
plugin pppoatm.so | plugin pppoatm.so | ||
0.38 | 0.38 | ||
+ | </ | ||
< | < | ||
Line 142: | Line 146: | ||
< | < | ||
+ | < | ||
echo deb http:// | echo deb http:// | ||
apt-get update | apt-get update | ||
+ | </ | ||
< | < | ||
Line 150: | Line 156: | ||
< | < | ||
+ | < | ||
apt-get install netselect-apt | apt-get install netselect-apt | ||
+ | </ | ||
< | < | ||
Line 157: | Line 165: | ||
< | < | ||
+ | < | ||
cd /etc/apt | cd /etc/apt | ||
netselect-apt squeeze | netselect-apt squeeze | ||
apt-get update | apt-get update | ||
+ | </ | ||
< | < | ||
Line 181: | Line 191: | ||
< | < | ||
+ | < | ||
auto eth0 | auto eth0 | ||
iface eth0 inet static | iface eth0 inet static | ||
address 10.0.0.1 | address 10.0.0.1 | ||
netmask 255.255.0.0 | netmask 255.255.0.0 | ||
+ | </ | ||
< | < | ||
Line 191: | Line 203: | ||
< | < | ||
+ | < | ||
auto eth1 | auto eth1 | ||
iface eth1 inet static | iface eth1 inet static | ||
address 192.168.0.1 | address 192.168.0.1 | ||
netmask 255.255.255.0 | netmask 255.255.255.0 | ||
+ | </ | ||
< | < | ||
Line 201: | Line 215: | ||
< | < | ||
+ | < | ||
/ | / | ||
+ | </ | ||
< | < | ||
Line 212: | Line 228: | ||
< | < | ||
+ | < | ||
cd /var/ | cd /var/ | ||
wget files.andybev.com/ | wget files.andybev.com/ | ||
tar -zxvf portalshaper-www.tar.gz | tar -zxvf portalshaper-www.tar.gz | ||
rm portalshaper-www.tar.gz | rm portalshaper-www.tar.gz | ||
+ | </ | ||
< | < | ||
Line 231: | Line 249: | ||
< | < | ||
+ | < | ||
cd / | cd / | ||
ln -s ../ | ln -s ../ | ||
+ | </ | ||
< | < | ||
Line 239: | Line 259: | ||
< | < | ||
+ | < | ||
Options +FollowSymlinks | Options +FollowSymlinks | ||
RewriteEngine On | RewriteEngine On | ||
Line 244: | Line 265: | ||
RewriteCond %{HTTP_HOST} !^earth [NC] | RewriteCond %{HTTP_HOST} !^earth [NC] | ||
RewriteRule . http:// | RewriteRule . http:// | ||
+ | </ | ||
< | < | ||
Line 257: | Line 279: | ||
< | < | ||
+ | < | ||
zone " | zone " | ||
type master; | type master; | ||
file "/ | file "/ | ||
}; | }; | ||
+ | </ | ||
< | < | ||
Line 270: | Line 294: | ||
< | < | ||
+ | < | ||
qualso | qualso | ||
earth | earth | ||
mail A 10.0.0.1 | mail A 10.0.0.1 | ||
+ | </ | ||
< | < | ||
Line 288: | Line 314: | ||
< | < | ||
+ | < | ||
subnet 10.0.0.0 netmask 255.255.0.0 { | subnet 10.0.0.0 netmask 255.255.0.0 { | ||
option subnet-mask 255.255.0.0; | option subnet-mask 255.255.0.0; | ||
Line 297: | Line 324: | ||
next-server 10.0.0.1; | next-server 10.0.0.1; | ||
} | } | ||
+ | </ | ||
< | < | ||
Line 303: | Line 331: | ||
Restart the DHCP server: < | Restart the DHCP server: < | ||
+ | < | ||
/ | / | ||
+ | </ | ||
< | < | ||
Line 312: | Line 342: | ||
< | < | ||
+ | < | ||
aptitude install ipset ipset-source module-assistant | aptitude install ipset ipset-source module-assistant | ||
module-assistant auto-install ipset-source | module-assistant auto-install ipset-source | ||
+ | </ | ||
< | < | ||
Line 324: | Line 356: | ||
< | < | ||
+ | < | ||
cd / | cd / | ||
wget http:// | wget http:// | ||
chmod +x rmtrack | chmod +x rmtrack | ||
+ | </ | ||
< | < | ||
Line 333: | Line 367: | ||
< | < | ||
+ | < | ||
cd / | cd / | ||
wget http:// | wget http:// | ||
Line 340: | Line 375: | ||
chmod +x test-ppp.init | chmod +x test-ppp.init | ||
insserv test-ppp.init | insserv test-ppp.init | ||
+ | </ | ||
< | < | ||
Line 346: | Line 382: | ||
< | < | ||
+ | < | ||
cd / | cd / | ||
wget http:// | wget http:// | ||
Line 353: | Line 390: | ||
wget http:// | wget http:// | ||
chmod +x tc-viewer | chmod +x tc-viewer | ||
+ | </ | ||
< | < | ||
Line 359: | Line 397: | ||
< | < | ||
+ | < | ||
cd /usr/local/ | cd /usr/local/ | ||
wget http:// | wget http:// | ||
tar -zxvf portalshaper-sh.tar.gz | tar -zxvf portalshaper-sh.tar.gz | ||
rm portalshaper-sh.tar.gz | rm portalshaper-sh.tar.gz | ||
+ | </ | ||
< | < | ||
Line 400: | Line 440: | ||
< | < | ||
+ | < | ||
auto ppp0 | auto ppp0 | ||
iface ppp0 inet ppp | iface ppp0 inet ppp | ||
Line 405: | Line 446: | ||
provider isp0 | provider isp0 | ||
post-up / | post-up / | ||
+ | </ | ||
< | < | ||
Line 411: | Line 453: | ||
< | < | ||
+ | < | ||
auto ppp1 | auto ppp1 | ||
iface ppp1 inet ppp | iface ppp1 inet ppp | ||
Line 416: | Line 459: | ||
provider isp1 | provider isp1 | ||
post-up / | post-up / | ||
+ | </ | ||
< | < | ||
Line 422: | Line 466: | ||
< | < | ||
+ | < | ||
cd / | cd / | ||
wget http:// | wget http:// | ||
chmod +x solos-preload | chmod +x solos-preload | ||
+ | </ | ||
< | < | ||
Line 441: | Line 487: | ||
< | < | ||
+ | < | ||
www-data ALL = NOPASSWD: / | www-data ALL = NOPASSWD: / | ||
www-data ALL = NOPASSWD: / | www-data ALL = NOPASSWD: / | ||
www-data ALL = NOPASSWD: / | www-data ALL = NOPASSWD: / | ||
www-data ALL = (proxy) NOPASSWD: / | www-data ALL = (proxy) NOPASSWD: / | ||
+ | </ | ||
< | < | ||
Line 460: | Line 508: | ||
< | < | ||
+ | < | ||
# We don't want persistent connections, | # We don't want persistent connections, | ||
# of requests to the same server will look like a bulk download | # of requests to the same server will look like a bulk download | ||
Line 468: | Line 517: | ||
# properly routed at the re-route stage. | # properly routed at the re-route stage. | ||
qos_flows mark miss=0x1000000/ | qos_flows mark miss=0x1000000/ | ||
+ | </ | ||
< | < | ||
Line 481: | Line 531: | ||
< | < | ||
+ | < | ||
acl our_networks src 10.0.0.0/16 | acl our_networks src 10.0.0.0/16 | ||
Line 497: | Line 548: | ||
http_access allow our_networks | http_access allow our_networks | ||
+ | </ | ||
< | < | ||
Line 503: | Line 555: | ||
< | < | ||
+ | < | ||
mkdir -p / | mkdir -p / | ||
chown proxy:proxy / | chown proxy:proxy / | ||
+ | </ | ||
< | < | ||
Line 575: | Line 629: | ||
< | < | ||
+ | < | ||
isp.server.name USERNAME: | isp.server.name USERNAME: | ||
+ | </ | ||
< | < | ||
Line 582: | Line 638: | ||
< | < | ||
+ | < | ||
chown root:root / | chown root:root / | ||
chmod 600 / | chmod 600 / | ||
+ | </ | ||
< | < | ||
Line 590: | Line 648: | ||
< | < | ||
+ | < | ||
postmap / | postmap / | ||
+ | </ | ||
< | < | ||
Line 597: | Line 657: | ||
< | < | ||
+ | < | ||
smtp_sasl_auth_enable = yes | smtp_sasl_auth_enable = yes | ||
smtp_sasl_password_maps = hash:/ | smtp_sasl_password_maps = hash:/ | ||
smtp_sasl_security_options = | smtp_sasl_security_options = | ||
+ | </ | ||
< | < | ||
Line 612: | Line 674: | ||
< | < | ||
+ | < | ||
useradd -g users mailuser | useradd -g users mailuser | ||
passwd mailuser | passwd mailuser | ||
+ | </ | ||
< | < | ||
setting_up_a_captive_portal_from_scratch_using_debian.txt · Last modified: 2018/12/06 20:16 by abeverley