Thursday, 22 August 2013

A short tutorial on dmesg, Linux command !

The command is "dmesg" which means "display messages" or "driver messages" as per Wiki, but I think it should be "debug messages" as these messages helps the developers to debug the Linux Kernel problem occurred during boot-up time or later. These messages are mostly hardware related messages, in which the peripherals or the actual ports gets initialized. If we give this command without any option it will print all messages on screen.

The format of command:

Usage: dmesg [-c] [-n level] [-s bufsize]
The man file says:

[root@localhost ~]# man dmesg
Formatting page, please wait...
       The program helps users to print out their bootup messages.  Instead of
       copying the messages by hand, the user need only:
              dmesg > boot.messages
       and mail the boot.messages file to whoever can debug their problem.
OPTIONS
       -c     Clear the ring buffer contents after printing.
       -r     Print the raw message buffer, i.e., donĂ¢t strip  the  log  level
              prefixes.
       -sbufsize
              Use  a  buffer  of size bufsize to query the kernel ring buffer.
              This is 16392 by default.  (The  default  kernel  syslog  buffer
              size was 4096 at first, 8192 since 1.3.54, 16384 since 2.1.113.)
              If you have set the kernel buffer to be larger than the  default
              then this option can be used to view the entire buffer.
       -nlevel
              Set  the  level at which logging of messages is done to the con-
              sole.  For example, -n 1 prevents  all  messages,  expect  panic
              messages, from appearing on the console.  All levels of messages
              are still written to /proc/kmsg, so syslogd(8) can still be used
              to  control  exactly  where kernel messages appear.  When the -n
              option is used, dmesg will not print or clear  the  kernel  ring
              buffer.
              When  both options are used, only the last option on the command
              line will have an effect.
SEE ALSO
       syslogd(8)
AVAILABILITY
       The dmesg command is part of the util-linux-ng package and is available
       from ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/.
                                                     
The commands which can be used are:

1) dmesg -> display whole output on screen

2) dmesg | less  -> display output as one screen at a time

3) dmesg > debug.log -> redirect all messages to log file

4) dmesg | grep usb/time/interrupt/tty/dma/memory -> to display(grep) only relevant or required information

5) dmesg -n 1 -> stop all messages except panic messages

I could not find information on various levels , let me know if any one of you know.

Heppy Learning, Happy Sharing!

Monday, 5 August 2013

Things to avoid in Life !

Recently I heard below things and like it. We all do it without knowing and if somebody else do it we feel irritated :-)
 
 

Me first Attitude (MFA)

TTT (Talk, Talk and Talk…)

PTB (Pass the buck)

I already Know IT (IAKI)

Prove it to me (PITM)

Monday, 29 July 2013

Cisco command to see the time and the command to see DHCP bindings


show clock : To see time on Cisco

show ip dhcp binding : To see the lease time of dhcp clients

Thursday, 25 July 2013

Freeradius configuration for PEAP/TLS and TTLS

Free Radius Server can be downloaded from http://sourceforge.net/projects/freeradius/

Some of the common commands are :

1) To run RADIUS service :

radiusd –X


2) To kill RADIUS service, search for the process-id

ps –ax

kill 9 <pid>


3) Configure Clients:

/usr/local/etc/raddb/clients.conf

client 10.0.0.1/16 {

secret = test123

shortname = private-network-2

}


4) Configure users:

/usr/local/etc/raddb/users

"user1" Cleartext-Password: = "test1"

5) PEAP :To authenticate a client using PEAP, the following configurations are needed for the PEAP module in the eap.conf file

peap {
default_eap_type = mschapv2
copy_request_to_tunnel = no
use_tunneled_reply = no
virtual_server = "inner-tunnel"
}


6) To authenticate a client by validating the server certificate, "ca.der " certificate needs to be installed in the client

7) TLS: To authenticate a client using TLS ,the following configurations are needed for the TLS module in the eap.conf file
 tls {
certdir = ${confdir}/certs
cadir = ${confdir}/certs
private_key_password = whatever
private_key_file = ${certdir}/server.pem
certificate_file = ${certdir}/server.pem
CA_file = ${cadir}/ca.pem
dh_file = ${certdir}/dh

random_file = ${certdir}/random
CA_path = ${cadir}
cipher_list = "DEFAULT"
make_cert_command = "${certdir}/bootstrap"
cache {
enable = no
lifetime = 24 # hours
max_entries = 255
}

}


8) TTLS: To authenticate a client using TTLS ,the following configurations are needed for the TTLS module in the eap.conf file

ttls {
default_eap_type = md5
copy_request_to_tunnel = no
use_tunneled_reply = no
virtual_server = "inner-tunnel"
}


How to generate the certificates

1) To generate the certificates for ca and server use command "./bootstrap" in the below folder

/usr/local/etc/raddb/certs

2) To generate certificates for client

Use command, "make client.pem" and copy the certificate "client.p12" to client and install

*** while installing the client.p12 in windows client, config password same as in certificate i,e "whatever" as per in client.cnf


Radius VLAN assignment

"user1" Cleartext-Password := "test1"

Tunnel-type = VLAN,

Tunnel-medium-type = IEEE-802,

Tunnel-Private-Group-Id = "10"




Note: "use_tunneled_reply" is to be enabled for authentication to work. To enable, need to configure, "use_tunneled_reply = yes" in the eap.conf file




Wednesday, 24 July 2013

"No option 125" error from Cisco DHCP server

Problem : "No option 125" error was continuosly repeating and DHCP Server on Cisco was not offering any IP address to the clients.
 =========================================
Jul 24 05:36:21.147: DHCPD: No option 125
Jul 24 05:36:21.147: DHCPD: DHCPDISCOVER received from client 001e.e5dc.ae.c0 on interface GigabitEthernet0/1.
Jul 24 05:36:30.707: DHCPD: client's VPN is .
Jul 24 05:36:30.707: DHCPD: No option 125
 ========================================
Solution: After some debugging, came to know that the problem is with the subnet configured on the Gigabit ethernet. For DHCP Server to offer the ipa ddress atleast one interface should be in the same network as the pool is defined. Once the subnet is properly configured, the Server started replying.
The basic config file  for configuring DHCP SERVER on Cisco router
service dhcp
no ip dhcp conflict logging
!
ip dhcp pool 1
 network 11.0.0.0 255.0.0.0
 default-router 11.0.0.1
!
interface GigabitEthernet0/1
 ip address 11.0.0.1 255.0.0.0

iwconfig sample commands

 
1) iwconfig
 
 
Iwconfig command is used to configure wireless interface in Linux. It is similar to ifconfig command but with lots of wireless paramters.
 
Sample Commands
 
iwconfig eth0 essid My Network
 
iwconfig eth0 channel 3
 
iwconfig eth0 mode Managed
iwconfig eth0 rts 250
iwconfig eth0 key 0123-4567-89
iwconfig eth0 txpower 15
 
2) Atheros driver commands ( Madwifi)
 
 
a) iwconfig
b) wlanconfig
c) iwpriv
 

iwconfig ath0 essid test123

ifconfig ath0 up

wlanconfig ath0 create wlandev wifi1 wlanmode ap

iwconfig ath0 essid test123

iwpriv ath0 mode 11G

iwconfig ath0 channel 1

ifconfig ath0 up

wlanconfig ath0 list chan

iwconfig ath0 channel 36

iwpriv wifi0 getCountry

iwpriv wifi0 getCountryiD

iwpriv wifi0 setCountry US

iwpriv ath0 mode 11NAHT20

wlanconfig ath0 destroy

 

Monday, 15 July 2013

Presentation Skills how much important ?

We had presentations for internal team by internal team members last week. It was a good experience and i think each and every member got benefited with this. I am just giving some feedback on how it was from my view, and it is not intended for making fun or hurting sentiments.The sole purpose of this post is to make people aware, what are the common mistakes people do and how we can avoid them.

1) First day : This person , only one day before i asked him to give presentation and he agreed. He was confident , he selected the topic on which he was working.He started with writing all the topics on board and explained the scope of discussion, topics he is going to cover and what are not covered in the session. After that he started in detail about each topic and covered well.

2) Second Day :Next day, we had presentation in which the presenter was confident but the selected topic was very vast and it has to be explained in detail. He started nicely , but it was like he started using too many technical jargon, which few people were not able to understand. So it started and finished , but it could have been better.

3) Third Day: We had a nice presentation , the presenter did well in explaining the topic and showing slides and details whenever required.

4) Fourth day : We had an informal discussion on various things, as actual presenter was on leave.I explained the manufacturing process in general , how the embedded boards are actually formed, what are the various stages it has to go before reaching to our hands and we had some discussion on deployment scenarios.

5) Fifth day : We had a presentation on RIP, this person started off nicely with explanation on  what is route , static route, what is routing, network, different types of routing protocol (link state, distance vector) , count to infinity, route poisoning and split horizon. It was already one hr , in the end one person asked "Are we going to start RIP now ?".
We all had a good laugh and concluded that as time is already over we will go for another session on RIP (only RIP)

So as you see, every person has a way of giving presentation , but it make sense only when the whole team is able to understand what you are saying. Always prepare presentation based on the audience, and it is very-very much required that "You" get used in giving presentation. Experience and number of years does not matter.

Learn from your mistakes and start by giving overview of topics which you are going to cover. If some one asks question and you are not sure , write it down and tell them that after presentation, you'll let them know.

Take feedback from your fellow members after presentation. Use technical terms but expand it or explain it so that all know what you are telling, also do not go to very basic, thinking that people doesn't know even basic things, it will be a waste of time for all.

One person i remember used "actually" too much during presentation, even his every 3 sentence  started with "actually", but as he become more comfortable in giving presentations he could understand and started avoiding "actually" and used it only when actually it was required. :-) :-)

Don't think too much and start giving presentations as soon as possible, plan for at least one presentation per year.

Happy Learning  , Happy Sharing !

Tuesday, 2 July 2013

How to add static routes in DHCP Clients, DHCP option supported for Classless routing !


If you want to add static routes in DHCP Clients use DHCP option 121 in DHCP SERVER.

It is defined in

http://www.faqs.org/rfcs/rfc3442.html. The option code is 121.

However, Microsoft DHCP server uses another option i.e. 249 to serve the same purpose.

In Linux based DHCP server i.e. ISC DHCP server , you can try adding the options as specified in

http://www.j-schmitz.net/blog/pushing-static-routes-with-isc-dhcp-server


Sunday, 30 June 2013

TFTP gets Timed out, No error message.

We had a issue with Windows XP laptop, the TFTP server stops responding. We checked the ports were fine, and was not used by any other tftp server. The windows XP firewall was off. Tried with two TFTP servers Solarwinds and TFTPD , both were not responding.

No error message :-( , if we reboot it in safe mode, it was working. So first clue , some service was stopping the TFTP operation.

Identifying service was also very frustrating, but looks like it was Cisco VPN client, which has Stateful firewall, once we stop this service, the TFTP was working fine.

From Cisco :

================================

How can I disable the Stateful Firewall Feature during the installation of the Cisco VPN Client?

A. For VPN Client versions prior to 5.0:

Refer to the Documentation Changes section of the VPN Client Rel 4.7 Release Notes in order to learn about the two topics "Using MSI to Install the Windows VPN Client without Stateful Firewall" and "Using InstallShield to Install the Windows VPN client without Stateful Firewall".

For VPN client versions after 5.0:

Beginning with Cisco VPN Client release 5.0.3.0560, an MSI installation flag was added to avoid the installation of the guild in firewall files:

msiexec.exe /i vpnclient_setup.msi DONTINSTALLFIREWALL=1

Refer to Bypassing Installation of Firewall Files When Stateful Firewall Is Not Required section for more information regarding this.


Ref:http://www.cisco.com/en/US/products/sw/secursw/ps2308/products_qanda_item09186a00801c2dbe.shtml


Solarwinds TFTP server documentation also states something similar:

Error message: " %Error opening tftp://IP_Address/filename (Timed out) ERROR: Failed to open archive file tftp://IP_Address/filename." when you try to transfer a file in TFTP Server

This error is typically caused by a firewall blocking access. We recommend disabling any firewalls on the machine running the TFTP Server.

FYI, Cisco's VPN client has a setting under options that states "Stateful Firewall Always On". If you have this client installed, you will want to uncheck this setting.


=====================================

Hope it helps someone !


Wednesday, 26 June 2013

Answer these DHCP protocol related interview question !

Post your answers in comments.

1) DHCP is based on which protocol ?

2) Can DHCP Server, itself can be DHCP client ?

3) DHCP supports three types of IP allocation schemes. What are they?

4) In which allocation scheme the IP address reuse is allowed?

5) How many types of DHCP messages you know or have seen it, how many are their in standard?

6) "DHCP is not used for configuring routers" this statement is true or false and why?

7) On what parameter the DHCP server decides, to send its OFFER as unicast packet or broadcast packet?

8) How do you identify the DHCPREQUEST packet is sent at init time, T1 time or T2 time?


Later more, Keep learning , Keep sharing!


Thursday, 13 June 2013

How to install and use ZAP wireless tool from Ruckus Wireless on Fedora or Linux PC


This tool is used for UDP performance testing mostly for Video or IPTV kind of traffic for wireless AP


How Zap Works from Ruckus website:

Zap works by sending controlled bursts of packets and measuring both packet loss and inter-arrival times. The primary results reported are number of packets lost, total packets

received and detailed throughput statistics. Because Zap provides a measure of both throughput and consistency over time and distance, it has particular importance to streaming

video, voice and other latency-sensitive applications. Conversely, knowing only average throughput levels will not help predict the performance of a wireless network.

By measuring the maximum throughput of batches of packets, Zap is able to determine the minimum throughput that can be expected at a given percentile. For example, if Zap reports

the 99.5 percentile to be 50Mbps, that means statistically, throughput is at or greater than 50Mbps 99.5 percent of the time. For video applications, the ability to determine

throughput within the 99.5 percentile gives IT managers and network designers the assurance of the maximum throughput that a given IP wireless network can deliver reliably to

ensure picture-perfect viewing.

Steps to install and use this tool in Fedora or Linux PC

Internet is connected to this machine.


1) Download and install SVN client on PC

 #yum install svn

2) once installed  run below command

#svn checkout http://zapwireless.googlecode.com/svn/trunk zaptool

3) Change directory

 #cd zaptool

4) Install the tool

# make

# make install

5) you will need gcc compiler to make the files if not installed in machine

#yum install gcc

run step 4

6) After step 4 the tool is installed in the pc , repeat the same on another linux PC for back to back tests


7) Connect both the PC, back to back and run below commands

PC1 ( 154.1.1.1)-----PC2 (154.1.1.2)


PC1#zapd &

PC2#zapd &

PC2#zap -s154.1.1.1 -d154.1.1.2 -X30


8) You should be seeing some results on PC2 after running above commands. Success-> try with your wireless devices

which is to be tested. Error-> go to step 9


9) If you get error -> could not Rx or similar try below commands on both PC, it will disable firewall.

PC1#service iptables stop

PC1#echo 0 > /selinux/enforce

PC2#service iptables stop

PC2#echo 0 > /selinux/enforce


10) Repeat step 7, should work fine.


Results : The result can be interpreted as below (taken from ZAP QSG)

 
Example zap output:

 192.168.0.2 192.168.0.177 408=rx 0=dr 0=oo 0=rp 20=rx in 57.6ms 4.1mbps  4.3|10.2  3.7  0.2  0.1  0.1  0.1

The details on all the fields are:

src    src address
dst    dst address
rx    cumulative received packets
dr    dropped packets
oo    out of order packets
rp    retried packets
rx in    received packets in this batch (sample)
b_time    batch (sample) time
b_thrput    batch thruput (for given batch or sample)
avg    cumulative aggregate thruput
0%    max thruput observed (peak thruput)
50%    median thruput
90%    thruput at 90 percentile (i.e. thruput was better than this 90% of the time)
95%    thruput at 95 percentile
99%    thruput at 99 percentile
99.9%    thruput at 99.9 percentile



Keep learning,Keep sharing!

Tuesday, 11 June 2013

How to install Tomcat server in fedora core 14 PC ?

Following steps is to be done to install tomcat server on Fedora PC. I have used core 14, but the steps should be pretty much same for other Fedora versions.

1) Download latest Tomcat server from the website

wget http://mirror.nexcess.net/apache/tomcat/tomcat-7/v7.0.41/bin/apache-tomcat-7.0.41.tar.gz

2) tar -xvzf apache-tomcat-7.0.41.tar.gz

3) The JRE 7 or 6 is to be installed on the PC. Download and install the rpm. In my pc it was already installed. The path should be properly set

export JAVA_HOME=/usr/java/jdk1.6.0_23

4) Set the path

export CATALINA_HOME=/home/user1/apache-tomcat-7.0.41

5) Start the Server

$CATALINA_HOME/bin/startup.sh

6) The server will set some defaults and should start without any errors.

7) Browser the default page

http://localhost:8080/


Wednesday, 8 May 2013

Check CRC /Hash calculation for files

We can send files to any other person or organization as attachment. Only if one download and opens it, will know if the file is correct or not, that too if it is in human readable format, like pdf, doc, excel etc. What if it is binary file or image, which is to be given to the other person? The other person cannot identify it until it uses it in the application for which it is intended.

One easy way is to do CRC32 check at both the ends. There is one free tool available hashtab which does hash calculation and generates the unique values.

Once this tool is downloaded and installed, for any file, if you right click -> properties -> you can see one extra tab "File hashes" -> It will display the Name and the Hash value unique to the file.

You can copy this information and send to the other party as well. The other person once download the file, he/she can check the properties-> and the hash value, if both sides it matches, means the file is fine,otherwise resend the file.

You can download the hashtab from below link and try it.

http://www.implbits.com/HashTab/HashTabWindows.aspx

Keep learning, Keep sharing !


Thursday, 2 May 2013

Window disappears when minimized in Linux (Fedora) once Panel is deleted

In fedora PC, someone accidentally deleted the bottom Panel. Now we could add the new panel, but all the opened windows just disappears when we minimized them. How ever using ALT+Tab we can access them.

I could find the solution with the help of friend Google.

1)       Once bottom panel is deleted

2)       Right click on Top panel -> New Panel

3)       The bottom panel will get created

4)       Right click on bottom panel -> Add to panel

5)       In Find an item-> type Window-> select Windows List-> ADD

6)       Now all the opened windows can be seen in this panel.

I think it can be done using Panel Preferences also, but I am not sure it is supported or not in Fedora.

Keep learning, Keep sharing !

Monday, 8 April 2013

"adapter not available" in windows XP with Odyssey Client

I have Windows XP laptop and it has Atheros AR9285 Wireless Network Adapter with Driver date 3/27/2009 version 7.7.0.267.

It was all working fine with Odyssey client Manager version 0.15.

Suddenly after reboot i observed  "adapter not available" in Odyssey. Exit, disable/enable the service, reboot of the laptop does not resolve the issue.

I had to uninstall the Wireless card and again reinstall it. After that it started working.

Sunday, 17 March 2013

Error (STOP: 0X0000007B (0xF78d2524,0XC0000034,0X00000000, 0X00000000)] in installing Windows XP

Recently i tried to change the OS of DELL Inspiron from ubuntu to Widows XP. I keep getting this error

STOP: 0X0000007B (0xF78d2524,0XC0000034,0X00000000, 0X00000000)

The solution was to change in the BIOS setting, the mode of  SATA controller from AHCI mode to ATA mode.


Tuesday, 5 February 2013

How to change IGMP Version (IGMP v1/v2/v3) in Windows XP PC?

By default when the Windows XP host joins IGMP group it uses IGMP v3. If you want to change this behavior and want PC to generate IGMP v1 or v2 messages change the registry settings as follows:


1) Start -> Run -> regedit

2) Go to HKEY_LOCAL_MACHINE ->SYSTEM->CurrentControlSet->Services->Tcpip->Paramters

3) Right Click -> New-> DWORD Value-> Rename the field as  "IGMPVersion"

Set the Value according to the table below and reboot the PC.  

Value "2" ->  IGMP Version 1

        "3" -> IGMP Version 2

        "4" -> IGMP Version 3 ( Default)


              

Why windows XP sends messages with 239.255.255.250 destination IP address?

We can see few packets destined to 239.255.255.250 IP address in Wireshark. They are:

1) SSDP Messages

2)  IGMP messages destined to 239.255.255.250

SSDP protocol is used to discover Upnp (Plug and play) devices in network. When we enable or disable the network interface, you can observe these messages.




What is Wireshark filter for SSDP protocols?

For SSDP protocols there is no separate Wireshark filter. We have to use either of the following two:


1) (udp.dstport==1900)

2) http




Monday, 4 February 2013

How to disable SSDP ( Simple Service Discovery Protocol) in Windows Microsoft XP ?

If you are running some captures and seeing lot of messages for SSDP  you have two options to filter out the messages in wireshark

Either disable it completely or use wireshark Filter " 

  • !(udp.dstport==1900) "
  • !((udp contains "HTTP/1.1") and ((udp contains 0a:53:54:3a) or (udp contains 0a:59:54:3a)))

How to disable the SSDP in Win XP

The two services you need to disable are:

  • Universal Plug and Play Device Host
  • SSDP Discovery Service

Disable the UPnP Device Host first by double-clicking on the service and selecting "Disabled" in the drop-down menu. Next, go on to the SSDP Discovery Service, double-click and select to stop the service, then disable it in the same manner.