Vahid Ghafarpour's Blog

نكات جالب از نظر وحيد غفارپور!

Tuesday, April 17, 2007

VPN on Ubuntu

I need to make a VPN connection between two servers
so I prefered openvpn

sudo apt-get install openvpn

these are samples from man openvpn

make nodes

sudo mknod /dev/net/tun c 10 200
sudo modprobe tun

then you can set connection like here

without security
sudo openvpn --remote june.kg --dev tun1 --ifconfig 10.4.0.1 10.4.0.2 --verb 9
sudo openvpn --remote may.kg --dev tun1 --ifconfig 10.4.0.2 10.4.0.1 --verb 9

with static-key security
sudo openvpn --genkey --secret key
sudo openvpn --remote june.kg --dev tun1 --ifconfig 10.4.0.1 10.4.0.2 --verb 5 --secret key
sudo openvpn --remote may.kg --dev tun1 --ifconfig 10.4.0.2 10.4.0.1 --verb 5 --secret key

I prefered second one
you can test with
ping 10.4.0.1
ping 10.4.0.2

Labels:

Sunday, April 15, 2007

VLAN on ubuntu

install
sudo apt-get install vlan

add new vlan
sudo vconfig add eth1 2

remove vlan
sudo vconfig rem eth1.2

set ip
sudo ifconfig eth1.2 192.168.0.1
or set in /etc/network/interfaces
iface eth1.2

some times routing have problems, it add a route to eth0 for each ip

Labels:

Saturday, April 14, 2007

Quota on Ubuntu

#apt-get install quota

add usrquota and grpquota into /etc/fstab for needed mountpoint
for example
/dev/sdc /home reiserfs defaults,usrquota,grpquota 0 2

create quota files
#touch /home/quota.user /home/quota.group
#chmod 600 /home/quota.*

remount
#mount -o remount /home

enable quota

#quotacheck -avugm
#quotaon -avug

Labels:

Sunday, April 8, 2007

dma/io allocation for i2o controller failed

In order to work around this problem you need to go through these steps:

1) At the busybox type:

mkdir /dev/i2o
ln -s /dev/sda /dev/i2o/hda
ln -s /dev/sda1 /dev/i2o/hda1
ln -s /dev/sda2 /dev/i2o/hda2
ln -s /dev/sda3 /dev/i2o/hda3
(go on until you linked all your devices)
exit

2) Now your server should continue the boot process; as soon as you get the prompt fix the problem blacklisting the module in the initrd image: for example:

mkdir initrd
cd initrd
zcat /boot/initrd.img-2.6.15-28-server | cpio -ivdm
echo "blacklist dpt_i2o" >> etc/modprobe.d/blacklist
find . | cpio --quiet -o -H newc | gzip -9 > /boot/initrd.img-2.6.15-28-server

Labels: