Thursday, June 10, 2010

Linux VLAN configuration

here is a small Howto configure VLAN on a linux system.

the required VLAN ID i have to configure is "15". copy the file
/etc/sysconfig/network-scripts/ifcfg-eth0 to /etc/sysconfig/network-scripts/ifcfg-eth0.15

cp  /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0.15

now we have to edit the new virtual interface  ifcfg-eth0.15

vi  /etc/sysconfig/network-scripts/ifcfg-eth0.15

replace DEVICE= with your VLAN ID


DEVICE=eth0.15

also add a line VLAN=yes


DEVICE=eth0.15
VLAN=yes


don't forget to set your IP address ;-) also remove gateway entries...
the gateway entries should be only at /etc/sysconfig/network


-- Yaniv

Friday, June 4, 2010

QEMU-IMG

the qemu-img command for creating and manipulating disc images.


Creating an image

qemu-img create -f qcow2 your_image_name.qcow2 50GB

 will create a new blank image with 50GB in the qcow2 format.


also the qemu-img program can be used to convert images from one format to another. or add compression or encryption to an image.

convert an image

qemu-img convert -O qcow2 test.vmdk testqcow2


get information about an image

qemu-img info your_image

Wednesday, June 2, 2010

Linux Files and Folder Permission examples

understanding file permission... with some examples.

what is this drwxr-xr-x about?

first think to understand is that we have 4 fields

1. file type | 2. user | 3. group | 4. other





1. The first character in the field indicates a file type of one of the following:

d = directory
l = symbolic link
s = socket
p = named pipe
- = regular file
c= character (unbuffered) device file special
b=block (buffered) device file special

most of the times you will see "d" or "-" or "l"

2. the user (primary owner) permissions.


3. the group permissions.


4. and others

just try to remember

user = u
group = g
other = o



there are 3 types of access

1. read
2. write
3. execute

rwx


lets see some example

yaniv@yaniv-ub:/tmp/test$ ls -ld folder1/
drwxr-xr-x 2 yaniv yaniv 4096 2010-06-02 10:15 folder1/
yaniv@yaniv-ub:/tmp/test$
so we see drwxr-x-r-x

lets look at the 4 fields: d| rwx | r-x | r-x

field 1: d = directory
field 2: the user (primary owner) = read, write, execute
field 3: the group = read, execute
field 4: other = read, execute

to be continued soon...