Friday, March 28, 2014

loop back in same machine - physically send packet out

eth2 eth3

This goes via eth3.
route for added in eth3 arp set in eth3
source            dst
============ =============
= =                      =  =
============               =============
changed into
source*           dst
============       =============
= =                   =  =
============              =============
received by eth2. arp resolved by eth2. route in eth2.
source               dst
============ =============
= =                     =  =
============               =============
changed into
source           dst*
============        =============
= =                    =  =
============               ============= => eth2 address. so reply  back.

ifconfig p3p1
ifconfig p3p2

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

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

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

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

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

ip route add dev p3p2
arp -i p3p2 -s 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


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.

libguestfs virt-copy-out

how to install libguestfs?

use this :
yum install '*guestf*' -y

Now , you will have binaries like virt-copy-out

Thursday, March 13, 2014

network naming eth0 as em1 , p1p1

I have observed some different naming for ethernet interfaces in the Server.

You can find  the reason here
Systems, particularly servers, with multiple network ports, name the ports ethX in a non-deterministic order, and are therefore not useful for system administrators.
System Administrators can then use BIOS-provided names, which are consistent and not arbitrarily named, for their network ports. This eliminates the confusion that non-deterministic naming brings, and eliminates the use of hard-coded MAC address based port renaming which a) is racy and error-prone, and b) introduces state into an otherwise stateless system.
This change affects most desktop, notebook, and server-class systems.
The em means that the interface is embedded onto the motherboard. Other names apply for add-on cards:p#p# names refer to PCI (and its modern derivatives) expansion cards, where the first number is the slot on the motherboard which they're plugged into, the second number is the port on the card (a card may contain multiple ports) and the third number, if present, is a virtual function number.

Thursday, March 6, 2014

kernel debugging via UML

I was going through UML linux kernel debugging here:
Very Good effort.

some tips  based on my expereince:

you need to enable following , if you are going to use Fedora20 based rootfs.(available here )




./linux ubda=$PWD/Fedora20-x86-root_fs  mem=512m  init=/bin/bas

Wednesday, March 5, 2014

IOGEAR switch not switching

IOGEAR switch not working....

just switch mouse and keyboard connected to the IOGEAR switch , it will start working and start switching between CPUs.

Reason here :