Monday 3 September 2012

Unix Handies

Unix Handnotes:

As far as I am concerned Unix is undoubtedly the Best operating system!!.In simple terms when we see the disadvantages of Unix to Microsoft/Mac I can say that GUI is only feature that Unix lags.But at the same time that is the most inevitable adavantages over the other operating systems..!

Here we go...Some of the ery useful things (say even unique feature ) with Unix,

(1) Use script command to record your sessions . I will quote with the real time scenario for further understanding.

bash-3.2$ script mak_del_dir
Script started, file is mak_del_dir
bash>mkdir test
bash >cd test
bash>cat file1
cat: file1: No such file or directory
bash >rmdir test
bash >exit
Script done, file is mak_del_dir
bash-3.2$


Now we have recorded the session of creating a dir and deleted and this session is recored using the script <file name> cmd and the recorded session can be viewed by using the cat <file name>






(2) cal cmd

     
      By using this command we will be able to view any date/day/month/year


       bash-3.2$ cal 1 1990
  January 1990
Su Mo Tu We Th Fr Sa
    1  2  3  4  5  6
 7  8  9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31





(3) For Terminal Settings Use stty -a

bash-3.2$ stty -a
speed 38400 baud; rows 37; columns 184; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O;
min = 1; time = 0;
-parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts -cdtrdsr
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl -ixon -ixoff -iuclc -ixany -imaxbel iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke
bash-3.2$              

We can also set /change any setting as per our needs
For eg:
if the interrupt shoul be ^j instead of ^C then
issue
 bash-3.2$ stty intr "^J"

(4) For sending mails using Unix:

Mailx command allows the user to send and recieve mails in unix machine.


  







Wednesday 30 May 2012

RIP functionalities

RIP:
 
              

We will directly sail into the actual functionalities of RIP as we will be able to find all the additional info in the internet.Now coming to the point,in a simple network professionals layman's term with the help of RIP the router will be able to learn the address of the other routers though they are not directly connected.In a network infrastructure there can be so many routers eg:

(A)<------------>(B)<------------->(C)<---------------->(D)

Lets now consider A B C D are the routers in a network .For Router A ,B router is the next hop but C router is nowhere linked to the A router.Its not possible to route the packets i,e pass the traffic from A router to C router as the A router is not aware of the destination address of C router in the routing table.The routing table is like a database which contains the source ip and destination ip address.considering the above example when you issue a ping <destination ip of C router> ,the expected reply will be unreachable as the router A could not find the destination ip address of the C router in the routing table.

Now this scenario is possible by configuring RIP to the network .RIP configurations has to be made on the router

CONFIGS ON ROUTER(A):

 A(config)#router rip
 A(config-router)#network <address of the hop which is not directly connected (i,e) C routers address>


we can also see whether the routing table is updated with the route by issuing the cli 'sh ip route'

<eg>
<snip>
A#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route

Gateway of last resort is not set

C    192.168.2.0/24 is directly connected, Serial2/0
R    192.168.3.0/24 [120/1] via 192.168.2.2, 00:00:06, Serial2/0
R    192.168.4.0/24 [120/1] via 192.168.2.2, 00:00:06, Serial2/0
R    192.168.5.0/24 [120/2] via 192.168.2.2, 00:00:06, Serial2/0
A#

<snip>

Here the C indicates the directly connected hop
and the R indicates the RIP connected network.

As per this the network 192.168.5.0 is not directly connected to the router A.We can also further confirm by pinging that network ip.

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.5.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 62/62/63 ms