AWG Blogs

Saturday, July 4, 2009

Installing SATAN 1.1.1 on Debian 4.0

wget http://www.ibiblio.org/pub/packages/security/Satan-for-Linux/satan-1.1.1.linux.fixed2.tgz

unpack in /tmp and cd to satan-1.1.1

edit reconfig:

sed -i 's/version 5/v\(ersion \)\?5/' reconfig

if no dev environment:

apt-get install make
apt-get install build-essential

then:

perl reconfig
make linux

run:

./satan

Wednesday, July 1, 2009

vtund Experimentation part 3 - Bridging

Picking up from "vtund Experimentation part 2" we are going to set up the bridge interface, which will bridge tap0 and eth1 as depicted in http://blog.kovyrin.net/2006/04/05/connecting-two-remote-local-networks-with-transparent-bridging/ (although there it's eth0).

On both server and client sever the vtund connection (if any) and kill the vtund process.

On the server:
in the lion config of vtund-server.conf, replace
"ifconfig "%% 10.1.0.1 netmask 255.255.255.0";
with the following lines:
ifconfig "%% up";
program "brctl addif br0 %%";
comment out the route command.
change the password (recommended)

On the client:
in the lion config of vtund-client.conf, replace
"ifconfig "%% 10.1.0.2 netmask 255.255.255.0";
with the following lines:
ifconfig "%% up";
program "brctl addif br0 %%";
change the password to same as server's (if changed on server).

On the server:
in /etc/network/interfaces
remove the eth1 ip configuration, except for the line
auto eth1 # to bring up eth1
Add the br0 ip configuration:
iface br0 inet static
address 192.168.100.99
netmask 255.255.255.0
bridge_ports eth1

On the client:
in /etc/network/interfaces
remove the eth1 ip configuration, except for the line
auto eth1 # to bring up eth1
Add the br0 ip configuration:
iface br0 inet static
address 192.168.100.100
netmask 255.255.255.0
bridge_ports eth1

On both server and client bring up br0:
ifup br0

On the server:
vtund -n -s -f /etc/vtund-server.conf

Then on client:
vtund -n -f /etc/vtund-client.conf lion server_public_ip_address

With luck, a UDP connection (tunnel) will be initialized. From client you should be able to ping 192.168.100.99 (server's br0 ip address).

On the server, type
brctl show
results:

bridge name bridge id STP enabled interfaces
br0 xxxxxxxx no eth1
tap0


Now set up another machine on the 192.168.100.x network on either side and ping both machines from it. If the machines can't ping eachother, ensure that the switch (vSwitch if in VMware) is set to Accept in Promiscuous Mode Policy Exceptions.

(see also Building Linux Virtual Private Networks (VPNs) on Google Books for example of the Ethernet Tunnel)

vtund Experimentation part 2

On both client and server:
fresh stable (ubuntu LTS 8.04) Ubuntu, get all updates.
then apt-get install bridge-utils (per http://blog.kovyrin.net/2006/04/05/connecting-two-remote-local-networks-with-transparent-bridging/)
then:
apt-get install uml-utilities
tunctl -u root -t tap0
ifconfig tap0 0.0.0.0 promisc up

then apt-get install vtun

modprobe tun

Then on server, copy /usr/share/doc/vtun/examples/vtund-server.conf to /etc
comment out: bindaddr { iface lo; };
in lion configuration:
change: "compress lzo:9;" to "compress no;"
change: "encrypt yes;" to "encrypt no;"
comment out firewall lines

Then on client, copy /usr/share/doc/vtun/examples/vtund-client.conf to /etc
edit /etc/vtund-client.conf: under the "lion" configuration, change "device tap1" to "device tap0"

Then on server:
edit /etc/network/interfaces:
auto lo
iface lo inet loopback

iface eth0 inet static
address public_ip_address
netmask public_mask
gateway public_gateway
auto eth0

Then on client:
edit /etc/network/interfaces:
auto lo
iface lo inet loopback

iface eth0 inet static
address public_ip_address
netmask public_mask
gateway public_gateway
auto eth0

Then on server:
vtund -n -s -f /etc/vtund-server.conf

Then on client:
vtund -n -f /etc/vtund-client.conf lion server_public_ip_address

With luck, a UDP connection (tunnel) will be initialized. From client you should be able to ping 10.1.0.1 (server's tun0 ip address).

Tuesday, June 30, 2009

Read latest log entries created on Linux

find / -name \*.log\* -mmin -3 -print | xargs tail


This lists all the log entries on the machine in the last three minutes.

Thursday, June 18, 2009

Ubuntu Default Gateway

auto eth0 -- sets eth0 to come up on /etc/init.d/networking restart

tip: put auto eth1 before auto eth0 in /etc/network/interfaces in order to make eth0 the default gateway

Wednesday, June 17, 2009

vtun Experimentation

So I get fresh stable (ubuntu LTS 8.04) Ubuntu, get all updates.
then apt-get install bridge-utils (per http://blog.kovyrin.net/2006/04/05/connecting-two-remote-local-networks-with-transparent-bridging/)
then:
apt-get install uml-utilities
tunctl -u root -t tap0
ifconfig tap0 0.0.0.0 promisc up

then apt-get install vtun

on both client and server:
modprobe tun

then put at end of /etc/network/interfaces (note: create bridge dynamically through vtun program commands instead?):
auto br0
iface br0 inet static
address 192.168.1.200 (199 for server)
netmask 255.255.255.0
bridge_ports eth0

then ifup br0

on client /etc/vtund.conf

options {
port 5000;
timeout 60;

# Path to various programs
ifconfig /sbin/ifconfig;
route /sbin/route;
firewall /sbin/iptables;
}

IP-Tunnel {
passwd abcd1234; # Password
type ether; # Ethernet tunnel
device tun0;
up {
# Connection is Up
ifconfig "%% up";
program "brctl addif br0 %%";
};
down {
# Connection is Down
ifconfig "%% down";
};
}




On server /etc/vtund.conf:
options {
# type stand;
# stand(default), inet (used only at server)
port 5000;
# Server will listen on this port for incoming requests.
syslog daemon;
# Syslog facility

# Path to various programs
ppp /usr/sbin/pppd; #Path to the pppd. Use "which pppd" to find this.
ifconfig /sbin/ifconfig;
route /sbin/route;
firewall /sbin/iptables;
ip /sbin/ip;
}
# Default session options
default {
type ether;
#tun, ether, tty(default), pipe (Used only at Server)
proto udp;
#udp, tcp(default) (Used only at server)
# device tun0;
compress no;
# no, yes, zlib:(1-9), lzo:(1-9); e.g. zlib:1 (default) (Used only at server)
encrypt no;
#yes, no (used only at server)
stat yes;
#yes, no: check /var/log/vtund/SessionName_X
speed 0;
#By default maximum speed, NO shaping (Used only at server)
keepalive yes;
#Used to keep alive the connection. (Used only at server)
}
# TUN example. Session 'cobra'.
IP-Tunnel {
passwd abcd1234; # Password
type ether; # IP tunnel
proto udp; # UDP protocol
device tap0;
compress no; # lzo:9; # LZO compression level 9
encrypt no; # Encryption
keepalive yes; # Keep connection alive
stat yes; #yes, no

up {
# Connection is Up
# 10.3.0.1 - local, 10.3.0.2 - remote
# ifconfig "%% 192.168.254.201 pointopoint 192.168.254.200 mtu 1450";
# route "add -net 192.168.0.0 netmask 255.255.255.0 gw 192.168.254.200";
ifconfig "%% up";
program "brctl addif br0 %%";
};
down {
# Connection is down
# 10.3.0.1 - local, 10.3.0.2 - remote
ifconfig "%% down";
# route "del -net 192.168.0.0 netmask 255.255.255.0 gw 192.168.254.200";
};

}

then on server, vtund -s (change port to 5000?)

then on client: vtund IP-Tunnel 172.16.2.16 (real of IP of server).

other references:
recompile kernel http://www.howtogeek.com/howto/ubuntu/how-to-customize-your-ubuntu-kernel/

check Universal Tun/tap device driver support under Device Drivers > Network device support

try tunctl to create tap, e.g. http://www.mail-archive.com/vtun-users@lists.sourceforge.net/msg00001.html

try steps here: http://adamolson.com/articles/UnixReview.com%20%20Secure%20Tunneling%20between%20Intranets%20with%20VTun%202000.htm
or here: http://www.opennet.ru/soft/vpn_table/vtund1.html

read http://vtun.sourceforge.net/setup.html

tips for manual setup: http://www.blindhog.net/linux-bridging-for-gns3-lan-communications/

and http://www.linux.com/archive/articles/54894 vtun tutorial

bridging in Linux: http://www.linuxfoundation.org/en/Net:Bridge

http://dkprojects.wordpress.com/transparent-ethernet-bridge/ - transparent bridge (hub)

Sunday, March 22, 2009

TortoiseSVN - Quick Start

TortoiseSVN repository set up:

-Install TortoiseSVN
-Perform these steps in Windows Explorer:
-right click in new empty dir (named after your project) and
choose ToroiseSVN > create repository here. This will be your repository, so make note of its location.
-Then rightclick your project folder and click TortoisSVN > Import, Browse to the path to your newly created repository and hit ok. Alternatively, enter a path like file:///SVNRepos/MyProject
-Rename your project folder by appending ".bak" or anything
-Create a new empty folder next to your old folder having the same original name of the project folder
-Open the new empty project folder and right click in the empty folder and choose SVN Checkout...
-Make sure the path to your newly crated repository is under "URL of repository:" and hit OK

Now you have a version controlled project!