Login »

Bluetrait

Search Posts

Categories

Bluetrait
    Coding
        WordPress
            Plugins
        PHP
        Bluetrait (Program)
    Geek
        Cisco
        IBM N2200 8363
        PCs
        Spam
        IPv6
        Apple
        NetScreen
        Internet
    General
        Uni

Popular posts

Click here if you are looking for Bluetrait, the weblog software.


Login

Username:

Password:

Setting up a route based site-to-site vpn using aggressive mode

Posted by Michael Dale on Thu, 31 Jan 2008 9:22 AM

The following howto guide explains how to setup a route based site-to-site VPN with one site using a firewalled internet connection and a dyanmic ip address.

So the background:
We have a client who is currently uses a Next G wireless connection who requires a link back into head office.

The wireless connection is limited in the follownig ways:

  • No public ip address
  • No static ip address
  • No port forwarding capabilities

So the connection is locked down.

The client required a site-to-site vpn for their business to operate (main application is running in head office).

So the following guide will show you how to set this up.

Network Details:
Head Office

  • Real internet connection with a static IP address
  • 192.168.0.x internal network

Remote Office

  • Internet connection without public ip address and/or port forwards
  • 192.168.6.x internal network

Head Office Setup

  1. Create a new IKE user (Objects->Users->Local)
  2. Create a new Unnumbered Tunnel Interface mapped to the untrust zone (Network->Interfaces (List)) and connected to your untrust Interface
  3. Create a new "Dialup User" VPN Gateway (VPNs->AutoKey Advanced->Gateway),
    1. Dialup user being the one you created in step 1.
    2. Outgoing interface is your untrust port.
    3. Enter a preshared key.
    4. In the advanced settings:
      1. Mode (Initiator) Aggressive
      2. Enable NAT-Traversal
  4. Create a new AutoKey IKE (VPNs->AutoKey IKE).
    1. Security Level: Custom
    2. Remote gateway is the one you setup in step 3
    3. In the advanced settings
      1. Replay Protection
      2. Bind to the Tunnel Interface you created in step 2
      3. VPN Monitor
      4. Rekey
  5. Create Routes (Network->Routing->Routing Entries)
    1. Network (remote network): 192.168.6.0/255.255.255.0
    2. Gateway
    3. Interface: Tunnel Interface you created in step 2
  6. Create polcies:
    1. From Trust to Untrust:
      1. Source: 192.168.0.0/24
      2. Destination: 192.168.6.0/24 
    2. From Untrust to Trust: 
      1. Source: 192.168.6.0/24
      2. Destination: 192.168.0.0/24
          

Remote Office Setup

  1. Create a new Unnumbered Tunnel Interface mapped to the untrust zone (Network->Interfaces (List)) and connected to your untrust Interface
  2. Create a new "Dialup User" VPN Gateway (VPNs->AutoKey Advanced->Gateway),
    1. Local ID being the IKE Identity you created in step 1 on the Head Office setup.
    2. Outgoing interface is your untrust port.
    3. Enter a preshared key (same as Head Office setup).
    4. In the advanced settings:
      1. Mode (Initiator) Aggressive
      2. Enable NAT-Traversal
  3. Create a new AutoKey IKE (VPNs->AutoKey IKE).
    1. Security Level: Custom
    2. Remote gateway is the one you setup in step 2
    3. In the advanced settings
      1. Replay Protection
      2. Bind to the Tunnel Interface you created in step 1
      3. VPN Monitor
      4. Rekey
  4. Create Routes (Network->Routing->Routing Entries)
    1. Network (remote network): 192.168.0.0/255.255.255.0
    2. Gateway
    3. Interface: Tunnel Interface you created in step 1
  5. Create polcies:
    1. From Trust to Untrust:
      1. Source: 192.168.6.0/24
      2. Destination: 192.168.0.0/24 
    2. From Untrust to Trust: 
      1. Source: 192.168.0.0/24
      2. Destination: 192.168.6.0/24

So that should be all you need to do. The Remote Office will be the side that starts the VPN. Make sure the encryption settings are the same for each side.

The good thing about this setup is that you don't need to use a service like DynDNS so it should be a bit more reliable.

If I get a chance I'll try and add some screen shots.


Bluetrait Event Viewer 1.6

Posted by Michael Dale on Sun, 27 Jan 2008 4:52 PM

Bluetrait Event Viewer (BTEV) 1.6 is now out. It has a few fixes that should make it compatible with WordPress 2.5 (due out in March I believe).


.au domains for $21.45 2/year

Posted by Michael Dale on Mon, 14 Jan 2008 3:20 PM

Jumba have a special on at the moment; .au domains for $21.45 for two years. Thats cheaper than what I pay for a standard .com!

Anyway I picked up dalegroup.net.au


Syntax Highlighting

Posted by Michael Dale on Wed, 02 Jan 2008 11:42 AM

I wrote a small plugin for Bluetrait 2 that allows some basic WordPress plugin compatibility. The first plugin that works is WP-Syntax the only change that was required to this plugin was to rename the main plugin file.

Let's give it a test:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
/*
	Bluetrait 2.0 Cron Support
	Michael Dale Copyright 2007
*/
 
//stop from running over and over again :)
define('BT_RUNNING_CRON', TRUE);
ignore_user_abort(TRUE);
 
include('bt-common.php');
 
$cron_intervals = bt_get_config('cron_intervals');
 
if (!is_array($cron_intervals)) exit;
 
foreach ($cron_intervals as &$cron_interval) {
	if ($cron_interval['next_run'] <= bt_datetime()) {
		$cron_interval['next_run'] = bt_datetime($cron_interval['frequency']);
		bt_run_section('cron_' . $cron_interval['name']);
		//too noisy
		//trigger_error('Cron ('.$cron_interval['description'].') Successful', E_USER_NOTICE);
	}
}
 
bt_set_config('cron_intervals', $cron_intervals);
?>

Looks like I need to make a few changes to the CSS. But it doesn't look too bad.


PHP 5.3

Posted by Michael Dale on Wed, 02 Jan 2008 10:38 AM

I had a play around with PHP 5.3. The main new feature is namespaces. I am looking forward to using this in future.

Unfortunately PHP 5.2 isn't very common so using namespaces in my code will need to wait.

This is a good website if you want to learn about how namespaces will work in PHP 5.3