Monday, April 28, 2014

ltp individual test case running


To run ltp individual test case, use this:

[root@localhost ltp]# pwd
/opt/ltp
[root@localhost ltp]# ./runltp -s memcg_regression 
[root@localhost ltp]# 

This will get results and logs saved.


Here I have selected one entry from runtest/controllers., select accordingly from 
runtest/testcases/

Sunday, April 13, 2014

bonnie++ Can't open file


While running bonnie++ , you may face this error :


# ./bonnie++ -d /mnt -s 8056M -n 0 -m TEST_IO -f -b -u username
Using uid:1000, gid:1000.
Can't open file ./Bonnie.3497.000

You need to add -u root:root , to the command line like :

./bonnie++ -d /mnt -s 8056M -n 0 -m TEST_IO -f -b -u root:root



Caveat:
Please note running as root is not recommended. So, ensure you try this only on a test system.

As per man page:

       -u     user-id to use.  When running as root specify the UID to use for
              the  tests.   It is not recommended to use root (since the occa‐
              sion when a Bonnie++ bug wiped out someone's system), so if  you
              really  want  to run as root then use -u root.  Also if you want
              to specify the group to run as then use the  user:group  format.
              If  you  specify  a  user  by name but no group then the primary
              group of that user will be chosen.  If you  specify  a  user  by
              number and no group then the group will be nogroup.



Friday, March 28, 2014

loop back in same machine - physically send packet out




http://serverfault.com/questions/127636/force-local-ip-traffic-to-an-external-interface

eth2 10.50.0.1 eth3 10.50.1.1

ping 10.60.0.1
This goes via eth3.
route for 10.60.0.1 added in eth3
10.60.0.1 arp set in eth3
source            dst
============ =============
= 10.50.1.1 =                      = 10.60.0.1  =
============               =============
changed into
source*           dst
============       =============
= 10.60.1.1 =                   =  10.60.0.1  =
============              =============
received by eth2. 10.60.1.1 arp resolved by eth2.
 10.60.1.1 route in eth2.
source               dst
============ =============
= 10.60.1.1 =                     = 10.60.0.1  =
============               =============
changed into
source           dst*
============        =============
= 10.60.1.1 =                    = 10.50.0.1  =
============               =============

10.50.0.1 => eth2 address. so reply  back.


ifconfig p3p1 10.50.0.1/24
ifconfig p3p2 10.50.1.1/24

iptables -t nat -A POSTROUTING -s 10.50.0.1 -d 10.60.1.1 -j SNAT --to-source 10.60.0.1

iptables -t nat -A PREROUTING -d 10.60.0.1 -j DNAT --to-destination 10.50.0.1

iptables -t nat -A POSTROUTING -s 10.50.1.1 -d 10.60.0.1 -j SNAT --to-source 10.60.1.1

iptables -t nat -A PREROUTING -d 10.60.1.1 -j DNAT --to-destination 10.50.1.1

ip route add 10.60.1.1 dev p3p1
arp -i p3p1 -s 10.60.1.1 A0:36:5F:05:E8:2E  //p3p2's mac address

ip route add 10.60.0.1 dev p3p2
arp -i p3p2 -s 10.60.0.1 A0:36:4F:05:E8:2C //p3p1 mac address.


Thursday, March 27, 2014

Fedora + arm guestfish: no operating system was found on this disk error - Solved



I thought of trying ARM based Fedora using emulation platform:

tried this command :
virt-copy-out -a Fedora-XFCE-armhfp-20-Alpha-4-sda.raw  /boot .

got this erorr:
guestfish: no operating system was found on this disk


Thanks libguestfs author , libguestfs which I used is very OLD.
So I tried using another command which he informed about.
guestfish --ro -a Fedora-XFCE-armhfp-20-Alpha-4-sda.raw -m /dev/sda1 tar-out / boot_simple.tar

This worked out. Thanks to rwmjones !

Wednesday, March 26, 2014

NAT




Nice intro on NAT:




Source IP addresses are changed to the exterior IP address of the Nat Host

Source Port numbers are changed to a unique value

transalted session must be saved in a state table.

Return traffic is matched in the state table and destination IP and port numbers are modified accordingly.


- impossible to map the real topology of the network.

- interior hosts are NOT reachable from the internet.


IP masquerading IS NOT a TRUE NAT implementation.(Linux 2.2.x kernels)

Linux 2.4.x kernels uses IPTables which provides NAT. It is TRUE NAT.


http://bio3d.colorado.edu/tor/sadocs/tcpip/nat.html#true%20nat