Internet Gateway Control Panel
http://home.nakhon.net/joke/igcp/
(c) 2542-2543 (1999-2000) by Joke
Version 0.1.7 Released 20/09/2543 (2000)
Overview
Internet Gateway Control Panel (IGCP) control SOME diald, squid and, in future, sendmail functions. It
aims for used in a system which changed configuration frequently. For example, site with 2 ISPs. It
contains some neat feature such as support 10 configurations, support 10 phone numbers per
configuration, configure and control via web interface.
License
IGCP is free for non-commercial personal usage. IGCP is provided as-it-as. No warranty of all kind. For
commercial, organizational, government, or educational usage, please contact me for more detail about
license fee (which could be free in some cases.)
Download
Current version is 0.1.7. The version number uses the same notaion as Linux's.
Feature
Feature in version 0.1.7. (* = New feature in version 0.1.7)
- Support 10 configurations.
- Support 10 phone numbers per configuration.
- Automatically rotate phone number.
- All configuration and controlation is done via web interface.
- Configurable parameters in each configuration are:
- Configuration Name
- Automatic/Manual Connection Mode
- Serial Device, Speed
- Modem Init String
- Dial Prefix
- Phone Numbers (up to 10)
- Local, Remote IP Address
- User Name, Password (PAP)
- Parent Proxy (up to 2)
- Control the link with:
- Up/Down the link immediately
- Display current link status.
- Integrated script for change HTTP password.
- * Detailed report.
- * Remember last successfully connected phone
number. (ie. if successfully connected, do not change phone number next time.)
- * Multiple language user interface.
- * Shutdown server via web.
Requirement
I don't know exactly what the requirement is, but these are my configurations which IGCP works.
- Linux 2.2.14 (based on Slackware 4.0)
- Diald 0.99.4
- Perl 5.005_03
- Apache 1.3.9
- Pppd 2.3.7
- Squid 2.3STABLE4
Installation
Distribution of IGCP assumes that you've decompressed diald source code in /usr/src/diald and installed
it in default directory (/usr/lib/diald) and use original Slackware's Apache installation
(/var/lib/apache). If your configuration differs from above, you have to edit some IGCP files manually.
- Backup files in diald's library (/usr/lib/diald) and pppd configuration
(/etc/ppp) because some of them will be overwritten. Decompress igcp-x.x.x.tar.gz in
temporary directory (for example, /tmp), you will get 5 files: igcp-etc.tar.gz,
igcp-lib.tar.gz, igcp-etc.tar.gz, pppderror.patch and igcp.html (this
file).
# cd /tmp
# tar zxvf /path/to/igcp-x.x.x.tar.gz
- Apply pppderror.patch to diald, recompile and install it.
# cd /usr/src
# patch < /tmp/pppderror.patch
# cd diald
# make
# make install
- Add this line to /etc/syslogd.conf. This will log pppd messages to proper file.
daemon.=debug /usr/lib/diald/pppd.log
- Decompress igcp-etc.tar.gz into /etc
# cd /etc
# tar zxvf /tmp/igcp-etc.tar.gz
- Decompress igcp-lib.tar.gz into /usr/lib/diald
# cd /usr/lib/diald
# tar zxvf /tmp/igcp-lib.tar.gz
- You may need to recompile squid_reconfigure.c and shutdown.c. Check the source code.
They're simple one line C code. Be sure to turn on suid bit on executable file.
# cd /usr/lib/diald/prog
# gcc -o squid_reconfigure squid_reconfigure.c
# gcc -o shutdown shutdown.c
# chmod u+s squid_reconfigure shutdown
- Decompress igcp-www.tar.gz into web's directory. It assumes that there are htdocs
and cgi-bin directories.
# cd /var/lib/apache
# tar zxvf /tmp/igcp-www.tar.gz
- Remove any parent proxy configuration from squid.conf. Rename it to
squid.conf.in. Make sure squid.conf is writable by nobody. This file will be
dynamically generated by IGCP.
# cd /usr/local/squid/etc
# grep -v "^cache_peer" squid.conf > squid.conf.in
# chmod 644 squid.conf
# chown nobody squid.conf
- Restart diald. The easiest way is to kill and rerun it.
# killall diald
# diald
- Enable override AuthConfig in /var/lib/apache/cgi-bin directory. This can be done
by changing the word None to AuthConfig in file httpd.conf. Ie., change these lines:
<Directory "/var/lib/apache/cgi-bin">
AllowOverride None
Options None
To these lines.
<Directory "/var/lib/apache/cgi-bin">
AllowOverride AuthConfig
Options None
Then, restart Apache by:
# apachectrl restart
- Create password file in /var/lib/apache by:
# cd /var/lib/apache
# bin/htpassword -c gateway.pwd gateway
The username must be gateway.
- If the system complain (in /var/log/syslog or /var/log/debug) about unknown tcp.https,
add these lines to /etc/services.
https 443/tcp ssl
https 443/udp ssl
- To change language, edit or create language.conf file in /var/lib/apache/cgi-bin/gateway.
And change files in /var/lib/apache/htdocs/gateway.
- That's all. I think.
Usage
Point browser to http://your.host.name/gateway/ and follow instructions. This is brief step:
- Enter all ISP informations in Config menu. (1st menu)
- Select desired ISP in Select menu. (2nd menu)
- Control line by using Control menu. (3rd menu)
Bug
- There's a lot of security issue. This because apache is run as nobody and it have to write some
security-sensitive files. My currently work around is to chown those files to nobody and chmod to 600.
- Currently, I use suid program to reconfigure squid. If somebody know this will opens security hole,
please tell me.
- There is no authorization. I think just using http authenticate is enough. (See Apache document.)
- Mail Server doesn't work yet.
To Do
- Integrate Sendmail configuration.
- Menu for change language.
- More options.
Feed Back
Please send your comment, suggestion or opinion to joke@nakhon.net.
20/09/2543 (2000) by Joke