Wednesday 17 August 2011

Linux: What is Firewall? How it Works

Linux: What is Firewall? How it Works: "Firewall is a system that is present between external network i.e. Internet and internal network LAN. It allows your internal network to ..."

What is Firewall? How it Works


Firewall is a system that is present between external network i.e. Internet and internal network LAN. It allows your internal network to access the internet but it restrict external network so that not one access you LAN systems or data on your internal network. Firewall can also be defined as a device configured to allow and reject traffic on the basis of defined rules.


How it Works
Firewall stops all incoming traffic to internal IP addresses. Let us take an example of ping to understand the working of firewall. Whenever a ping command is executed it sends in ICMP echo request messages to source and in return receives ICMP echo reply. To block these ICMP echo request messages to reach destination we will configure firewall to fail the ping commands. Similarly SMTP protocol that response to TCP port 25 is used for email, blocking the port will disable the user in network to send emails.

Wednesday 3 August 2011

Linux: How to Ping machine using hostname in debian/Linux...

hostgator coupons
Linux: How to Ping machine using hostname in debian/Linux...: "We can ping machine by their hostname rather IP address gedit /hostname add hostname along with their IP addresses i.e 192.168.10.200..."

What is Rsync Utility


It is a backup/mirroring tools used to replicate between two locations on separate hosts in a network. In rsync only actual changed pieces of files are transferred rather than whole file, further saving your file transfer time and reducing load on network.

Friday 15 July 2011

How to Ping machine using hostname in debian/Linux.

We can ping machine by their hostname rather IP address 

gedit  /hostname

add hostname along with their IP addresses
i.e 192.168.10.200 hostname
In this way you can  ping LAN systems with hostname

How to view TCP or UDP ports open or close at debian/Linux server

netstar -an
This will list all TCP and UDP ports

How to view Kernel IP routing table in debian/Linux

Every kernel makes its own routing table
command 
#  route

What is Arp? How we can view ARP entry and delete ARP entry.

 Arp maps IP address to Mac address 
  arp –a 
 You will see the IP address is mapped against the Mac address of the machine.
             To delete the ARP entry gives 
             arp del IP address

Wireshark


Wireshark is a tool that allows the packet traces to be sniffed, captured and analyzed. It is used for trouble shooting networks problems, examine security issues, and debug protocol implementation and learning protocols internally.

What is Packet Sniffing?

Packet sniffing is the act of capturing packets of data flowing across computer network. You are able to see any bit of information entering or leaving your computer. Normally computer looks at packet addressed to it and ignores the traffic on the network. When a sniffers is set on a computer, it interface is set to promiscuous mode. This means that it looks at everything that comes through. Using packet sniffer it is possible to capture data like passwords, IP addresses, and protocols being used on the network and also other information.  A packet sniffer utility is that it sniffs without modifying the packets in any way. The computer having sniffer installed not only receive the data which is directed to him but also monitor all traffic on the physically connected network. Packet sniffer sees everything. It includes SMTP, POP, IMAP traffic, HTTP, FTP traffic and can read password in clear text etc.
A packet sniffer can be set up in two ways.
a)      Unfiltered
Captures all of the packets
b)      Filtered
Captures only those packets which containing specific data elements.

What is Subnetting?

Subnet is a segment of a network. Subnetting is a technique that allows a network administrator to divide one physical network into smaller logical networks and to limit the scope of broadcast traffic, network security issues, and to separate network segments by function.
Let us take as example of how to do one bit, two bit and three bit subnetting. We purchased network id 201.100.50.0. In subnetting we move a host bit into network and make subnets , formula for calculation of subnetwork is 2n -2 and for host in each subnet is 2n-2 where as n stands for no bits sifted to network portion for subnetwork and n stands for remaining bits of hosts for number of hosts in a network.
Example
200.100.50.0
Network part 24 bits
Host part 8bits
One bit Subnetting
No of subnets­­­ = 2n-2   No of host in each subnet = 2n-2         
                        No of subnets­­­ = 21-2 = 2 subnets (n bits shifted to network)
No of host in each subnet = 27-2 =128-2 =126 (n remaining bit in host)

First Subnet                  200.100.50.0
                        {            .      .     .    .
                                      .      .     .    .
                                    200.100.50.127

Second Subnet            
200.100.50.128
                        {            .      .     .    .
                                      .      .     .    .
                                    200.100.50.255
Two Bit Subnetting
No of subnets­­­ = 2n-2   No of host in each subnet = 2n-2         
                        No of subnets­­­ = 22-2 = 4-2=2 subnets (n bits shifted to network)
No of host in each subnet = 26-2 =64-2 =62 (n remaining bit in host)

First Subnet                  200.100.50.0
                        {             .      .     .    .
                                      .      .     .    .
                                    200.100.50.63

Second Subnet             200.100.50.64
                        {             .      .     .    .
                                      .      .     .    .
                                    200.100.50.127

Third Subnet                200.100.50.128
                        {             .      .     .    .
                                      .      .     .    .
                                    200.100.50.191

Fourth Subnet              200.100.50.192
                        {             .      .     .    .
                                      .      .     .    .
                                    200.100.50.255
Now if we again look at the formula we will see 22-2 = 4-2, here 4 is total no of subnets and -2 means that we will not use first and last subnet. Similarly in hosts 26 -2= 64-2=62, here 64 total no hosts in each subnet and -2 means we will not use first and last address because first address is subnetwork ID and last is broadcast  ID of the subnetwork .Then we will left with 62  usable hosts in each subnet.


Second Subnet             200.100.50.65
                        {             .      .     .    .
                                      .      .     .    .
                                    200.100.50.126

Third Subnet                200.100.50.129
                        {             .      .     .    .
                                      .      .     .    .
                                    200.100.50.190
So finally we will use only second and third subnet and each subnet first and last IP will not be used because they are subnet Ids and Broad cast Ids and you will left with 62 no of usable hosts. Similarly we perform three, four bit etc subnetting.
Note in one bit subnetting I have not done -2 from the network why? Because 21-2= 0, it means that we are left with 0 subnet. So remember that in class C one bit subnetting is not possible.