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 192.168.0.0 0.0.0.255
Router(config)#access-list 10 permit host 192.168.0.4
Router(config)#access-list 10 permit host 192.168.0.5
Router(config)#interface fastEthernet 0/0
Router(config-if)#ip access-group 10 in
Router(config-if)#exit
Router(config)#

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

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

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 200.100.1.1 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 0.0.0.0 0.0.0.0 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
Router(config-if)#exit

go to se 2/0

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

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

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


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>enable
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)#exit
Switch(config)#vlan 3                           //
Create vlan and give vlan id
Switch(config-vlan)#name VLAN3       //You can assign vlan name as VLAN3
Switch(config-vlan)#exit
Switch(config)#
 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
Switch(config-if)#

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


Network address of 
                               vlan 1 - 192.168.10.0
                               vlan 2 - 192.168.20.0
                               vlan 3 - 192.168.30.0

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

Router>enable
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 192.168.10.1 255.255.255.0  // assign ip address for vlan 1
Router(config-subif)#exit
Router(config)#

 encapsulation dot1Q
 Use
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)#
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 .
Switch(config-if)#



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 - 192.168.10.2
R 1 - FastEthernet - 192.168.10.1 
         Serial - 10.0.0.2
R  0 -   R1-R0 network serial - 10.0.0.1
            R0-PC 0 - 192.168.11.1 
            R0-R2 - 11.0.0.1
R 2 -    R2-R0 - Serial  11.0.0.2
            FastEthernet - 192.168.12.1 




            
             
















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  192.168.16.0 .  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  225.255.255.0 . There are 5 networks , so   5<2^3 . so s bytes are available for host.

192.168.16.000|00000 | 192.168.16.0                       Subnet 0  
192.168.16.001|00000 | 192.168.16.32                     Subnet 1
192.168.16.010|00000 | 192.168.16.64                     Subnet 2  
192.168.16.011|00000 | 192.168.16.96                     Subnet 3  
192.168.16.100|00000 | 192.168.16.128                   Subnet 4  
192.168.16.101|00000 | 192.168.16.160                   Subnet 5  
192.168.16.110|00000 | 192.168.16.192                   Subnet 6  
192.168.16.111|00000 | 192.168.16.224                   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 192.168.16.194 
Subnet mask 255.255.255.224
Default Gateway 192.168.16.193

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>
Router>enable
Router#config t
Router(config)#hostname R1
R1(config)#interface fastethernet 0/0
R1(config-if)#ip address 192.168.16.193 255.255.255.224
R1(config-if)#no shutdown
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
R1(config-if)#exit
R1(config)# 
Now configure serial port on  router with ip address 192.168.16.34 255.255.255.224  
 
R1(config)#interface serial 0/0/0
R1(config-if)#ip address 192.168.16.34 255.255.255.224
R1(config-if)#clock rate 64000
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#
 
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 192.168.16.128 ( To R2)

R2(config)#ip route 192.168.16.128 255.255.255.224 192.168.16.33
R2(config)#

 
Now test the connectivity. Go on pc1 and 

C:\> ping 192.168.16.130 




 
 

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.