martybugs.net SmoothwalL Express Info
 navigation
. MartyBugs home
. Smoothwall home
 
 Smoothwall info
. my box
. connect speed display
. red IP address display
. bytes in/out
. VNC over SSH
. time sync
. ad zapping
. ip accounting on 0.9.9 / 1.0
. ip accounting on 2.0
. status LEDs
. adding web users
. iptables config
. internal PPTP VPN
. RRDTool traffic graphs
. password reset
. proxy log analysis
. RRDTool memory graphs
. Squid config
. adding shell users
. Smoothwall links
 
 modem config
. Billion 7402L adsl router
. DSL-300G adsl modem
. DSL-300+ adsl modem
 
 site search
Custom Search
 
Dialup Info Display

[This modification has been verified to work with Smoothwall GPL 1.0 and Smoothwall Express 2.0.]

This page details how to get your dialup Smoothwall GPL installation to display the modem connect speed, red IP address, and data throughput for the red interface.
Note that this most of these modificatons will only work if your red interface is a dialup modem (ie, using ppp).

Refer to the pages detailing the individual modifications (see the menu at the left) for more information on that specific modifications.

Screen Shots:
Here's a screen shot of my Smoothwall GPL 0.9.9 GUI, showing the modem connect speed, the red IP address, and the bytes in/out for my red interface.


and here's a similar screen shot of my Smoothwall Express 2.0 beta2



Installation Instructions:
Ensure you have SSH enabled on your Smoothwall (it's configured on the "remote access" page. This is required for logging into your Smoothwall with SSH.

Refer to my connect speed display page for information on installing the ppps script for determining your modem connect speed, as well as login script information.

Refer to my display bytes in/out page for information on installing the pppstats binary if you're using Smoothwall Express 2.0.

Do not make the modifications to your index.cgi as specified on those pages, but use the code shown below instead.

Edit /home/httpd/cgi-bin/index.cgi and immediately after the line containing

print $connstate;

insert the following

print "</B>\n";
print "<center><font size='2'><br>\n";

# get connect speed
$conspeed = `cat ${swroot}/red/connectspeed`;
# get current IP
$ip = `cat ${swroot}/red/local-ipaddress`;
# get PPP stats
@stats = split(' ', `pppstats | tail -n 1`);

# check if we have a connect speed
if ($conspeed != '')
{
	# check if connected now
	if ($ip == '')
	{
	    print "last ";
	}
	print "connect speed: $conspeed<br>\n";
}

# check if connected now
if ($ip != '')
{
	print "IP: $ip<br>\n";
}
# check if not connected and we have stats
if (($ip == '') and ($stats[0] != 0))
{
	print "last connection: ";
}

# check if we have stats
if ($stats[0] != 0)
{
	$bytesin = commify(int($stats[0]/1024));
	$bytesout = commify(int($stats[6]/1024));
	print "$bytesin kb in; $bytesout kb out";
}
print "</font></center>";

# function to format numbers with commas at thousand separators
sub commify
{
	(my $a = shift) =~ s/\G(\d{1,3})(?=(?:\d\d\d)+(?:\.|$))/$1,/g;
	return $a;
}

That should be all that's required - just point your web browser at your smoothie, and you should see the additional info on the index.cgi page.

Note that some of the Smoothwall fixes overwrite the index.cgi with a newer version, so if you install a new fix, it may overwrite your changes, so always keep a backup copy of your index.cgi before patching your Smoothie, so you can reapply the changes to the new index.cgi.

Similarly, when doing a fresh installation of Smoothwall, only make these changes once you've fully patched the installation.



last updated 4 Aug 2004
 
.