This shows you the differences between two versions of the page.
Next revision Both sides next revision | |||
setting_up_a_captive_portal_from_scratch_using_debian [2018/12/06 20:09] abeverley created |
setting_up_a_captive_portal_from_scratch_using_debian [2018/12/06 20:12] abeverley |
||
---|---|---|---|
Line 63: | Line 63: | ||
<html><code></html> | <html><code></html> | ||
- | <code> | ||
apt-get install ppp | apt-get install ppp | ||
- | </code> | + | |
<html></code></html> | <html></code></html> | ||
Line 78: | Line 77: | ||
<html><code></html> | <html><code></html> | ||
- | <code> | ||
noipdefault | noipdefault | ||
defaultroute | defaultroute | ||
Line 87: | Line 85: | ||
plugin pppoatm.so | plugin pppoatm.so | ||
0.0.38 | 0.0.38 | ||
- | </code> | ||
<html></code></html> | <html></code></html> | ||
Line 106: | Line 103: | ||
<html><code></html> | <html><code></html> | ||
- | <code> | ||
apt-get install ppp | apt-get install ppp | ||
- | </code> | ||
<html></code></html> | <html></code></html> | ||
Line 121: | Line 116: | ||
<html><code></html> | <html><code></html> | ||
- | <code> | ||
noipdefault | noipdefault | ||
defaultroute | defaultroute | ||
Line 130: | Line 124: | ||
plugin pppoatm.so | plugin pppoatm.so | ||
0.38 | 0.38 | ||
- | </code> | ||
<html></code></html> | <html></code></html> | ||
Line 149: | Line 142: | ||
<html><code></html> | <html><code></html> | ||
- | <code> | ||
echo deb http://ftp.debian.org/debian squeeze main > /etc/apt/sources.list | echo deb http://ftp.debian.org/debian squeeze main > /etc/apt/sources.list | ||
apt-get update | apt-get update | ||
- | </code> | ||
<html></code></html> | <html></code></html> | ||
Line 159: | Line 150: | ||
<html><code></html> | <html><code></html> | ||
- | <code> | ||
apt-get install netselect-apt | apt-get install netselect-apt | ||
- | </code> | ||
<html></code></html> | <html></code></html> | ||
Line 168: | Line 157: | ||
<html><code></html> | <html><code></html> | ||
- | <code> | ||
cd /etc/apt | cd /etc/apt | ||
netselect-apt squeeze | netselect-apt squeeze | ||
apt-get update | apt-get update | ||
- | </code> | ||
<html></code></html> | <html></code></html> | ||
Line 194: | Line 181: | ||
<html><code></html> | <html><code></html> | ||
- | <code> | ||
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 | ||
- | </code> | ||
<html></code></html> | <html></code></html> | ||
Line 206: | Line 191: | ||
<html><code></html> | <html><code></html> | ||
- | <code> | ||
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 | ||
- | </code> | ||
<html></code></html> | <html></code></html> | ||
Line 218: | Line 201: | ||
<html><code></html> | <html><code></html> | ||
- | <code> | ||
/etc/init.d/networking restart | /etc/init.d/networking restart | ||
- | </code> | ||
<html></code></html> | <html></code></html> | ||
Line 231: | Line 212: | ||
<html><code></html> | <html><code></html> | ||
- | <code> | ||
cd /var/ | cd /var/ | ||
wget files.andybev.com/web-portal/portalshaper-www.tar.gz | wget files.andybev.com/web-portal/portalshaper-www.tar.gz | ||
tar -zxvf portalshaper-www.tar.gz | tar -zxvf portalshaper-www.tar.gz | ||
rm portalshaper-www.tar.gz | rm portalshaper-www.tar.gz | ||
- | </code> | ||
<html></code></html> | <html></code></html> | ||
Line 252: | Line 231: | ||
<html><code></html> | <html><code></html> | ||
- | <code> | ||
cd /etc/apache2/mods-enabled | cd /etc/apache2/mods-enabled | ||
ln -s ../mods-available/rewrite.load | ln -s ../mods-available/rewrite.load | ||
- | </code> | ||
<html></code></html> | <html></code></html> | ||
Line 262: | Line 239: | ||
<html><code></html> | <html><code></html> | ||
- | <code> | ||
Options +FollowSymlinks | Options +FollowSymlinks | ||
RewriteEngine On | RewriteEngine On | ||
Line 268: | Line 244: | ||
RewriteCond %{HTTP_HOST} !^earth [NC] | RewriteCond %{HTTP_HOST} !^earth [NC] | ||
RewriteRule . http://qualso.wardroom/index.php/%{HTTP_HOST}%{REQUEST_URI}?%{QUERY_STRING} [L,R] | RewriteRule . http://qualso.wardroom/index.php/%{HTTP_HOST}%{REQUEST_URI}?%{QUERY_STRING} [L,R] | ||
- | </code> | ||
<html></code></html> | <html></code></html> | ||
Line 282: | Line 257: | ||
<html><code></html> | <html><code></html> | ||
- | <code> | ||
zone "wardroom" { | zone "wardroom" { | ||
type master; | type master; | ||
file "/etc/bind/db.wardroom"; | file "/etc/bind/db.wardroom"; | ||
}; | }; | ||
- | </code> | ||
<html></code></html> | <html></code></html> | ||
Line 297: | Line 270: | ||
<html><code></html> | <html><code></html> | ||
- | <code> | ||
qualso A 10.0.0.1 | qualso A 10.0.0.1 | ||
earth A 10.0.0.1 | earth A 10.0.0.1 | ||
mail A 10.0.0.1 | mail A 10.0.0.1 | ||
- | </code> | ||
<html></code></html> | <html></code></html> | ||
Line 317: | Line 288: | ||
<html><code></html> | <html><code></html> | ||
- | <code> | ||
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 327: | Line 297: | ||
next-server 10.0.0.1; | next-server 10.0.0.1; | ||
} | } | ||
- | </code> | ||
<html></code></html> | <html></code></html> | ||
Line 334: | Line 303: | ||
Restart the DHCP server: <html><code></html> | Restart the DHCP server: <html><code></html> | ||
- | <code> | ||
/etc/init.d/isc-dhcp-server restart | /etc/init.d/isc-dhcp-server restart | ||
- | </code> | ||
<html></code></html> | <html></code></html> | ||
Line 345: | Line 312: | ||
<html><code></html> | <html><code></html> | ||
- | <code> | ||
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 | ||
- | </code> | ||
<html></code></html> | <html></code></html> | ||
Line 359: | Line 324: | ||
<html><code></html> | <html><code></html> | ||
- | <code> | ||
cd /usr/local/bin | cd /usr/local/bin | ||
wget http://files.andybev.com/web-portal/rmtrack | wget http://files.andybev.com/web-portal/rmtrack | ||
chmod +x rmtrack | chmod +x rmtrack | ||
- | </code> | ||
<html></code></html> | <html></code></html> | ||
Line 370: | Line 333: | ||
<html><code></html> | <html><code></html> | ||
- | <code> | ||
cd /usr/local/bin | cd /usr/local/bin | ||
wget http://files.andybev.com/web-portal/test-ppp | wget http://files.andybev.com/web-portal/test-ppp | ||
Line 378: | Line 340: | ||
chmod +x test-ppp.init | chmod +x test-ppp.init | ||
insserv test-ppp.init | insserv test-ppp.init | ||
- | </code> | ||
<html></code></html> | <html></code></html> | ||
Line 385: | Line 346: | ||
<html><code></html> | <html><code></html> | ||
- | <code> | ||
cd /usr/local/bin | cd /usr/local/bin | ||
wget http://files.andybev.com/web-portal/linkstats-ppp0 | wget http://files.andybev.com/web-portal/linkstats-ppp0 | ||
Line 393: | Line 353: | ||
wget http://files.andybev.com/web-portal/tc-viewer | wget http://files.andybev.com/web-portal/tc-viewer | ||
chmod +x tc-viewer | chmod +x tc-viewer | ||
- | </code> | ||
<html></code></html> | <html></code></html> | ||
Line 400: | Line 359: | ||
<html><code></html> | <html><code></html> | ||
- | <code> | ||
cd /usr/local/ | cd /usr/local/ | ||
wget http://files.andybev.com/web-portal/portalshaper-sh.tar.gz | wget http://files.andybev.com/web-portal/portalshaper-sh.tar.gz | ||
tar -zxvf portalshaper-sh.tar.gz | tar -zxvf portalshaper-sh.tar.gz | ||
rm portalshaper-sh.tar.gz | rm portalshaper-sh.tar.gz | ||
- | </code> | ||
<html></code></html> | <html></code></html> | ||
Line 443: | Line 400: | ||
<html><code></html> | <html><code></html> | ||
- | <code> | ||
auto ppp0 | auto ppp0 | ||
iface ppp0 inet ppp | iface ppp0 inet ppp | ||
Line 449: | Line 405: | ||
provider isp0 | provider isp0 | ||
post-up /usr/local/portalshaper/master | post-up /usr/local/portalshaper/master | ||
- | </code> | ||
<html></code></html> | <html></code></html> | ||
Line 456: | Line 411: | ||
<html><code></html> | <html><code></html> | ||
- | <code> | ||
auto ppp1 | auto ppp1 | ||
iface ppp1 inet ppp | iface ppp1 inet ppp | ||
Line 462: | Line 416: | ||
provider isp1 | provider isp1 | ||
post-up /usr/local/portalshaper/master | post-up /usr/local/portalshaper/master | ||
- | </code> | ||
<html></code></html> | <html></code></html> | ||
Line 469: | Line 422: | ||
<html><code></html> | <html><code></html> | ||
- | <code> | ||
cd /etc/network/ | cd /etc/network/ | ||
wget http://files.andybev.com/web-portal/solos-preload | wget http://files.andybev.com/web-portal/solos-preload | ||
chmod +x solos-preload | chmod +x solos-preload | ||
- | </code> | ||
<html></code></html> | <html></code></html> | ||
Line 490: | Line 441: | ||
<html><code></html> | <html><code></html> | ||
- | <code> | ||
www-data ALL = NOPASSWD: /sbin/iptables -I internet 1 -t nat -m time --datestop ??????????????????? -m mac --mac-source ??\:??\:??\:??\:??\:?? -j RETURN | www-data ALL = NOPASSWD: /sbin/iptables -I internet 1 -t nat -m time --datestop ??????????????????? -m mac --mac-source ??\:??\:??\:??\:??\:?? -j RETURN | ||
www-data ALL = NOPASSWD: /sbin/iptables -D internet -t nat -m time --datestop ??????????????????? -m mac --mac-source ??\:??\:??\:??\:??\:?? -j RETURN | www-data ALL = NOPASSWD: /sbin/iptables -D internet -t nat -m time --datestop ??????????????????? -m mac --mac-source ??\:??\:??\:??\:??\:?? -j RETURN | ||
www-data ALL = NOPASSWD: /usr/local/bin/rmtrack [0-9]*.[0-9]*.[0-9]*.[0-9]* | www-data ALL = NOPASSWD: /usr/local/bin/rmtrack [0-9]*.[0-9]*.[0-9]*.[0-9]* | ||
www-data ALL = (proxy) NOPASSWD: /usr/lib/squid3/ext_session_acl | www-data ALL = (proxy) NOPASSWD: /usr/lib/squid3/ext_session_acl | ||
- | </code> | ||
<html></code></html> | <html></code></html> | ||
Line 511: | Line 460: | ||
<html><code></html> | <html><code></html> | ||
- | <code> | ||
# We don't want persistent connections, otherwise lots | # We don't want persistent connections, otherwise lots | ||
# 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 520: | Line 468: | ||
# properly routed at the re-route stage. | # properly routed at the re-route stage. | ||
qos_flows mark miss=0x1000000/0xF000000 | qos_flows mark miss=0x1000000/0xF000000 | ||
- | </code> | ||
<html></code></html> | <html></code></html> | ||
Line 534: | Line 481: | ||
<html><code></html> | <html><code></html> | ||
- | <code> | ||
acl our_networks src 10.0.0.0/16 | acl our_networks src 10.0.0.0/16 | ||
Line 551: | Line 497: | ||
http_access allow our_networks | http_access allow our_networks | ||
- | </code> | ||
<html></code></html> | <html></code></html> | ||
Line 558: | Line 503: | ||
<html><code></html> | <html><code></html> | ||
- | <code> | ||
mkdir -p /var/lib/squid/session | mkdir -p /var/lib/squid/session | ||
chown proxy:proxy /var/lib/squid/session/ | chown proxy:proxy /var/lib/squid/session/ | ||
- | </code> | ||
<html></code></html> | <html></code></html> | ||
Line 632: | Line 575: | ||
<html><code></html> | <html><code></html> | ||
- | <code> | ||
isp.server.name USERNAME:PASSWORD | isp.server.name USERNAME:PASSWORD | ||
- | </code> | ||
<html></code></html> | <html></code></html> | ||
Line 641: | Line 582: | ||
<html><code></html> | <html><code></html> | ||
- | <code> | ||
chown root:root /etc/postfix/relay_passwd | chown root:root /etc/postfix/relay_passwd | ||
chmod 600 /etc/postfix/relay_passwd | chmod 600 /etc/postfix/relay_passwd | ||
- | </code> | ||
<html></code></html> | <html></code></html> | ||
Line 651: | Line 590: | ||
<html><code></html> | <html><code></html> | ||
- | <code> | ||
postmap /etc/postfix/relay_passwd | postmap /etc/postfix/relay_passwd | ||
- | </code> | ||
<html></code></html> | <html></code></html> | ||
Line 660: | Line 597: | ||
<html><code></html> | <html><code></html> | ||
- | <code> | ||
smtp_sasl_auth_enable = yes | smtp_sasl_auth_enable = yes | ||
smtp_sasl_password_maps = hash:/etc/postfix/relay_passwd | smtp_sasl_password_maps = hash:/etc/postfix/relay_passwd | ||
smtp_sasl_security_options = | smtp_sasl_security_options = | ||
- | </code> | ||
<html></code></html> | <html></code></html> | ||
Line 677: | Line 612: | ||
<html><code></html> | <html><code></html> | ||
- | <code> | ||
useradd -g users mailuser | useradd -g users mailuser | ||
passwd mailuser | passwd mailuser | ||
- | </code> | ||
<html></code></html> | <html></code></html> | ||