My Blog List

Thursday, April 5, 2012

network address translation (Dynamic NAT)

Dynamic NAT/PAT:  to map one to many or many to many IP address (public ip to privet ip).

1. First of all you must create access list
(Create ACL for which network or IP address you want to access internet)

Router(config)#access-list 10 permit
Router(config)#access-list 10 permit host
Router(config)#access-list 10 permit host
Router(config)#interface fastEthernet 0/0
Router(config-if)#ip access-group 10 in

2.Create NAT pool
 Router(config)#ip nat pool abc netmask
Router(config)#ip nat inside source list 10 pool abc

3. Then ping PC4 to the server by the commnd prompt  as - ping

Network address translation (NAT)

Static NAT: to map one to one IP address (public ip to privet ip)

1.First of all open the Nat file
2.assign the ip address for PC1,PC2,PC3,PC4

 3.assign the ip of serial port in office router as cuz its the public ip address of  given by ISP.
4. Configure a default route in the office router for Internet connectivity.

 as follows - -  - Router(config)#ip route serial 2/0

5.assign the inbound and out bound of office router !!!
Fa0/0 of office router is inbound of the private network.
Se2/0 of office router is the outbound of the network.

go to interface of fa0/0

Router(config)#interface fastEthernet 0/0
Router(config-if)#ip nat inside

go to se 2/0

Router(config)#interface serial 2/0
Router(config-if)#ip nat outside

6. Now Map the private ip address to public ip address !!!

Router(config)#ip nat inside source static
 // this command give the static ip for pc1 .
map the private ip for public ip !!
 7. ping the server by PC1 command prompt by - ping

thats all about the static NAT :) :) :)

Saturday, September 3, 2011

How To connect Visual Studio + Microsoft SQL Server

Hi fellows , i m using Microsoft visual studio 2008 vs Microsoft SQL server 2005 database . I think this will help you lot :) :)

So first of all i will show you how to connect database to stand alone application. ( not web application). here are some steps to consider when you designing the application. You must have a proper interface to the application.
The basic steps to designing an interface as follows.

    1. Operations on DataGridView
    2. Data Grid View
    3. Using Meaningful names to user Controllers
In fact , you can use  any tools in V.S 2008 and create your own interface.

After design the interface , now you have to get the database connection. Before connect the database you must create some tables and insert some records. (Ex:- a bank system - you may have more tables like Bank, Branch , Accounts, Account Type etc.) . Then only you can create interface or  application to insert data, delete data, update data and so on.
 When we come again to connecting the database ( assume we already have create tables on MS SQL Server with records.) there are some steps to follows.

    1. Importing App.config file - You can create new file called App.config
    2. Implementing Connection String Inside the file.- how to implement the C.S ??
    3. Creating new class Connection Manager - what is this Class used for ??
    4. Importing references System.Configuration - What is this references??
    5. Create new SQL connection. - how to create new sql connection.??

First of all you must create App.config file ,

Right click on project name in solution explore , Add , New Item

Then select Application Configuration file and clicl Add.

Open the App.config file. The Database connection string can be mentioned here.

     ConnectionManager class

To access database objects through our program we need to have a connection to the database from the program. In order to do this a new class called ConfigurationManager will be created. The purpose of having a separate class for this is to develop the project in a structured manner, which will help avoid having to develop the same code in multiple places of the program.

Right click on project name in solution explore , Add , New Item , Class

     To use SQL connection in .Net, it is required to import some Reference classes.

To do this, right click on the project file  Add Reference… 
Right click on project name in solution explore , Add Reference

      Also some namespaces needs to be imported in this class.

using System.Data;
using System.Data.SqlClient;
using System.Configuration;

1.      Implement ConnectionManager class.

A sql connection will be created in ConnectionManager class, and a connection created in GetConnection method will be returned

     Implement DBAccess class.

Class constructor is modified, in a way that a database connection will be created when an object of DBAcess class is created in the Form.
Notice that GetConnection method is used here, which is a static method to establish the connection.

In this class methods will be implemented to access database and return them to the form.

To obtain data from the database through DBAccess class, it is required to create an object of DBAccess class, in the Form class.

Saturday, March 19, 2011

VLAN Configurations

What is a VLAN? 

A VLAN is a virtual LAN. In technical terms, a VLAN is a broadcast domain created by switches. Normally, it is a router creating that broadcast domain. With VLAN’s, a switch can create the broadcast domain. 

How can devices on different VLAN’s communicate?

Devices on different VLAN’s can communicate with a router or a Layer 3 switch. As each VLAN is its own subnet, a router or Layer 3 switch must be used to route between the subnets. 

What is a trunk port?

When there is a link between two switches or a router and a switch that carries the traffic of more than one VLAN, that port is a trunk port.



How to create a VLAN?

 According to above network , it used 1841 Router , 2950-24 switch and Pc s. 

First of all you can configure switch . 

Switch#config t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#vlan 2                            // Create vlan and give vlan id
Switch(config-vlan)#name VLAN2        // You can assign vlan name as VLAN2
Switch(config)#vlan 3                           //
Create vlan and give vlan id
Switch(config-vlan)#name VLAN3       //You can assign vlan name as VLAN3
 According to this network you can create 3 vlan networks  .

vlan 1 is the default vlan .

After  creating  vlans you must assign PC s to specific vlans .

Switch(config)#interface fa0/2 // PC 0 is assign in interface fastEthernet 0/2
Switch(config-if)#switchport mode access 
Switch(config-if)#switchport access vlan 2 // assign PC 0 to vlan 2

Same as this you must assign other PC s to each vlans.

Network address of 
                               vlan 1 -
                               vlan 2 -
                               vlan 3 -

When we move to Router configuration we must assign sub network for 3 vlans .

Router#config t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#interface fastEthernet 0/0.1       //  by giving 0/0.1 it creates sub network
Router(config-subif)#encapsulation dot1Q 1   // select vlan1
Router(config-subif)#ip address  // assign ip address for vlan 1

 encapsulation dot1Q
Allows you to use a router interface as a trunk port to a switch. This is also known as "Router on a stick" because the switch uses the router to route between VLANs.

 Same as vlan 1 we must configure other two vlans .

Configure trunk port

Then you must configure trunk port of switch . 

Switch(config)#interface fastEthernet 0/1     // go to interface mode of the fast Ethernet port of switch (which    connected to router)
Switch(config-if)#switchport trunk allowed vlan add 2   // add vlan 2 for  switchport trunk .

You can ping between different vlans or in same LAN .


Friday, February 11, 2011

Dynamic Routing Configuration – RIP, IGRP

Design the below network and load it in to Packet Tracer Simulator.

Note:   For R1 and R3 - Router 1841.            For R2 – router 2811 
  Select R1 – S0 and R2 – S1 as DCE side for clocking inside the simulator.
Assign IP addresses according to Net ID for each and every device .

  Ethernet:  Connect Ethernet ports to a hub or a switch using a straight-through cable.  Use a     cross-over cable if going directly between Ethernet ports on two routers.
Serial:  If going directly between two routers, don’t forget to connect one port via the DTE cable and the other via the DCE cable
PC 1 -
R 1 - FastEthernet - 
         Serial -
R  0 -   R1-R0 network serial -
            R0-PC 0 - 
            R0-R2 -
R 2 -    R2-R0 - Serial
            FastEthernet - 


After assign IP address to each and every device first step is to checking whether the data packets by "ping" from pc to router.

 Adding Dynamic Routing:  RIP
If this router will be participating in a dynamic routing protocol like RIP or IGRP, you will need to enable the routing protocol along with those directly connected networks that will be participating.  Only use the classful network address, not the subnet address of the network.

Router(config)#  router  rip
Router(config-router)#  network  network-address   {NOT Subnet Address}
Router(config-router)#  network  network-address   {NOT Subnet Address}
Adding Dynamic Routing:  IGRP
If this router will be participating in a dynamic routing protocol like RIP or IGRP, you will need to enable the routing protocol along with those directly connected networks that will be participating.  Only use the classful network address, not the subnet address of the network.

Router(config)#  router  igrp autonomous-system    {autonomous-system a.k.a. process-id}
Router(config-router)#  network  network-address   {NOT Subnet Address}
Router(config-router)#  network  network-address   {NOT Subnet Address}

TCP / IP - An animated discussion


Friday, January 28, 2011

Static Routing and Default Routing Configurations

Network Address of above  pvt network is .  now we have to assign IP address for each and every network .First  we  have to identify  “How many networks are there ?? “  . As you can see on the above picture there are 5 networks. After identify the  networks,  now you can   find subnet marks and IP address for each and every  network devices.

Given network address is in class C . so the subnet address should be . There are 5 networks , so   5<2^3 . so s bytes are available for host.|00000 |                       Subnet 0|00000 |                     Subnet 1|00000 |                     Subnet 2|00000 |                     Subnet 3|00000 |                   Subnet 4|00000 |                   Subnet 5|00000 |                   Subnet 6|00000 |                   Subnet 7  

now assign IP address for each and every devices !!

  Now configure PC-1 first.To configure pc double click on pc and select desktop

IP address 
Subnet mask
Default Gateway

Now double click on 1841 Router 1 and select CLI 
--- System Configuration Dialog ---

Continue with configuration dialog? [yes/no]: no

Press RETURN to get started!
Router#config t
Router(config)#hostname R1
R1(config)#interface fastethernet 0/0
R1(config-if)#ip address
R1(config-if)#no shutdown
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
Now configure serial port on  router with ip address  
R1(config)#interface serial 0/0/0
R1(config-if)#ip address
R1(config-if)#clock rate 64000
R1(config-if)#no shutdown
Configure Router-2 and Router-3 in same way .
After configure all device you have to ping and checked whether all packets are delivered correctly. 
Command syntax for static route:
ip route  -  The command used to create the static route.
destination_network  - The network you're placing in the routing table.
mask - The subnet mask being used on the network.
next-hop_address-  The address of the next-hop router that will receive the packet and forward it to the remote network.

ip route [destination_network] [mask] [next-hop_address or exit_interface]
Now tell R1 about to network of ( To R2)

R2(config)#ip route

Now test the connectivity. Go on pc1 and 

C:\> ping 


Saturday, January 22, 2011

DCCN II  Worksheet 03 

Static Routing Configuration

First you have to downlord the worksheet 03 from moodle  and draw the bellow network and add IP address to each and every PCs and Routers . 

When you are using the cisco packet tracer you can add different type of routers , PCs, Wires etc .
for Design above network you must select two 1841 ciso routers ,  two PCs , Serial DTE and Copper cross over. 
Picture 1.1
When you select 1841router you have to add WIC-1T port because to connect serial.