Wednesday, November 5, 2008

My new Network Layout with Astaro

So I being a Comcast customer, not by choice, decided I wanted to be able to more closely monitor and control my network usage. I was toying around with different ways to monitor my traffic but didn't want to replace my router not add another device to the network outside the router.

I also looked at monitoring traffic per device, but this has its own problems such as missing traffic and counting local traffic twice, once on the source and again on the destination. The long an the short is I can only do what I want by having the traffic bass through a single device, an Astaro Security Gateway in my case.

I do run VMware Server on my single server though and desided if I could get a configuration with the ASG running in a virtual machine thus not needing the extra hardware. While, after a few hours of testing, and restoring my router once, I got it up and working. Heere is a diagram of the layout and soem notes.

Black lines on white are pyisical network connections.
Black lines on blue are vmware bridge connections.
Green lines indicate internal network traffic.
Red lines indicate external network traffic.

Some variouse notes on my configuration:
  • The monitored internal netowrk is on the 192.168.1.* subnet.
  • The unmonitored external network is on the 192.168.1.150.* subnet.
  • Both networks exist on the same pyisical switch but the DHCP server doles out only internal addresses. A computer could be configured staticly to the external subnet and I havn't found a way to prevent this but in oder to circumvent the ASG the user would have to know about the second subnet.
  • The server has only a single gigabit network interface card on it. Traffic on the internal network heading out will go to the server and be passed onto the ASG's internal virtual interface. Next the ASG will proccess the traffic and send it back out on the external interface. The server will pass the traffic back out on its internal interface but the traffic will really be on the external subnet so it will pass off to the router.
  • The internal and external networks co-exist on the same network segment just differnet segments, for that reson I pourpasly left on the main routers Firewall and NAT.
  • There is no noticible impact on network preformance as the traffic is already limited by teh 6M cable modem connection.
  • I can not monitor just the external interface of teh ASG for trafic usage statistics with vnstat.

Flex DateChooser Toggle

Upadte- 2/4/2009 3:11 PM
Added support for simulating the shift key as well. If allowDisjointSelection is set then each click will toggle a date like id did before.
If it switched off though now the first click will set a start date and the second click an end date so that a range can be selected via clicking.


This component changes the DateChooser class to add a toggle option. When set clicking on a date will toggle it in the same way that control-clicking does.

DateChooser.as
package
{
import flash.events.Event;
import flash.events.MouseEvent;

import mx.controls.DateChooser;
import mx.core.mx_internal;

use namespace mx_internal;

/**
* This custom DateChooser adds the ability to toggle dates on click or to select a range with two clicks instead of using
* keyboard modifiers. If allowDisjointSelection is set then clicking a date will toggle it on or off. If not then the first click
* will set the start date and the second click will set the end date. In this mode a third click will un-select the first range and
* set a new start date.
*
* @author Jeremy Pyne jeremy.pyne@gmail.com
*/
public class DateChooser extends mx.controls.DateChooser
{
public function DateChooser()
{
super();
}

override protected function createChildren():void
{
super.createChildren();

dateGrid.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler, false, 1);
}

//----------------------------------
// toggleSelection
//----------------------------------

/**
* @private
* Storage for the allowMultipleSelection property.
*/
private var _toggleSelection:Boolean = false;


[Bindable("toggleSelectionChanged")]
[Inspectable(category="General", defaultValue="true")]

/**
* If true, specifies that selecting dates will toggle them. Simulates controll key down.
*
* @default false
* @helpid
* @tiptext Selections are toggled if true
*/
public function get toggleSelection():Boolean
{
return _toggleSelection;
}

/**
* @private
*/
public function set toggleSelection(value:Boolean):void
{
_toggleSelection = value;
dispatchEvent(new Event("toggleSelectionChanged"));
}


private function mouseUpHandler(event:MouseEvent):void
{
if(toggleSelection && allowMultipleSelection && event.shiftKey == false)
{
// If allowDisjointSelection is set then simulate the control key pressed.
if(allowDisjointSelection)
event.ctrlKey = true;
// If not and there is something selected.
else if(this.selectedRanges.length)
// Simulate the shift key down if the currect selectedRange is that of a single day.
event.shiftKey = this.selectedRanges[0].rangeStart.time == this.selectedRanges[0].rangeEnd.time;
}
}
}
}