How to set up a cisco router / Networking for a small office

How to set up a cisco router / Networking for a small office

Hello everyone. Today I want to tell you how to set up a Cisco router or organize a network for a small office. Let’s talk about the differences between a layer 3 switch and a router, and analyze the scheme for organizing a small office and a medium one using a Cisco router. I think this is an interesting topic and very common.Differences between a Cisco router and a Layer 3 switch

Let me remind you in the previous article we configured a cisco switch as a core operating at layer 3 of the OSI model, and dismantled that it is more productive and cheaper than a cisco router. So, what then makes you buy Cisco routers, it’s all about the brains that give functionality, such as:

  • ip routing
  • NAT
  • VPN
  • Firewall

Without which it is difficult to imagine how to connect remote offices with the central one. Such is the cunning party policy of Cisco.

Scheme for a small office

The branch scheme is as follows: 1 Router0 Cisco 1841 model for example, one Cisco 2960 switch and three computers. As you can see we have 3 segments for which we will configure vlan . It is assumed that you have already completed the basic configuration of the Cisco switch .

We create VLAN2, VLAN3, VLAN4. Log in to your cisco 2960 and go to configuration mode /

enable
conf t
valn 2
name VLAN2
exit
vlan 3
name VLAN3
exit
vlan 4
name VLAN4
exit

now let’s define each computer in the desired vlan. PC0 in vlan 2, PC1 in vlan 3, PC2 in vlan 4. For me, these are ports fa0/1, fa0/2 and fa0/3.

int fa 0/1
switchport mode access
switchport access vlan 2
exit
int fa 0/2
switchport mode access
switchport access vlan 3
exit
int fa 0/3
switchport mode access
switchport access vlan 4
exit
do wr mem

The next step is to configure the trunk port to our Cisco 1841 router. Enter the following commands

Selecting the desired interface

int fa 0/4

We set the trunk mode

switchport mode trunk

allow certain vlans

switchport trunk allowed vlan 2,3,4
end
wr mem

All work on the Cisco 2960 switch is completed, let’s move on to our router.

Configuring a Cisco 1841 Router

Let’s start configuring the cisco 1841 router so that it routes traffic between vlan and acts as an Internet gateway . By default, all ports on the router are in the off state, let’s turn on the port where the patch cord is plugged from the cisco 2960 switch, I have it fa 0/0.

enable
conf t
int fa 0/0
no shutdown

exit

You will have something similar, telling you that the port has become active.

%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up

Port turned green

The next step is to create subinterfaces by the number of vlan. Routers simply do not have vlan and their role is played by subinterfaces, where a certain vlan corresponds to a subinerface.

Create a subinterface for vlan 2

int fa 0/0.2

indicate that it applies and happens vlan 2 packets

encapsulation dot1Q 2

set ip address

ip address 192.168.1.251 255.255.255.0

turn on the port

no shutdown
exit

and save the settings with the command

do wr mem

Let’s configure the subinterface for vlan 3.4 in a similar way

int fa 0/0.3 encapsulation
dot1Q 3 ip
address 192.168.2.251 255.255.255.0
no shutdown
exit

ip routing
do wr mem

Trying to ping PC3 and PC2 from PC0. As you can see in the screenshot everything is ok.

ping 192.168.1.251

ping 192.168.2.1

ping 192.168.3.1

So it’s easy to organize a local network in a very small branch and where the cisco router is quickly configured. we will configure NAT in another article.

Scheme for the average office

Here is what the LAN diagram of a mid-range office looks like. There is a cisco 2911 router acting as an Internet gateway. There is a network core Cisco 3560 level 3 switch. It will route local traffic between network vlans. In the Cisco 3560, 3 Cisco 2960 second-level switches are plugged in, which already connect the end devices. The network has 3 vlan 2,3,4.

Setting Switch1

Let’s start by configuring Switch1, the server segment. Log in to global configuration mode.

enable
conf t

Create vlan 4

vlan 4
name VLAN4
exit

Throw ports fa 0/1-2 into VLAN4

int range fa 0/1-2
switchport mode access
switchport access vlan 4
exit
do wr mem

Let's configure the trunk port fa 0/3, we will only allow vlan4 traffic

int fa 0/3
switchport mode trunk
switchport trunk allowed vlan 4
exit
do wr mem

Switch2 setup

We are done with the server segment. We proceed to the same setting on Switch2 and 3. And so Switch2 Cisco 2960.

First of all, we create vlan 2 and vlan3.

enable
conf t
vlan 2
name VLAN2
exit
vlan 3
name VLAN3
exit

Now let’s define our ports to which computers are connected to the required vlan

int fa 0/1
switchport mode access
switchport access vlan 2
exit
int fa 0/2
switchport access vlan 3
exit

Let’s configure the trunk port on the fa 0/3 interface

int fa 0/3
switchport mode trunk
switchport trunk allowed vlan 2,3,4
exit
do wr mem

Switch3 setting

We carry out the same trick with the Switch3 Cisco 2960 setting

First of all, we create vlan 2 and vlan3.

enable
conf t
vlan 2
name VLAN2
exit
vlan 3
name VLAN3
exit

Now let’s define our ports to which computers are connected to the required vlan

int fa 0/1
switchport mode access
switchport access vlan 2
exit
int fa 0/2
switchport access vlan 3
exit

Let’s configure the trunk port on the fa 0/3 interface

int fa 0/3
switchport mode trunk
switchport trunk allowed vlan 2,3,4
exit
do wr mem

Setting up the network core

Let’s start configuring routing, on the Cisco 3560 core, all three of its ports need to be configured as a trunk, create a vlan and assign an ip to them.

enable
conf t

create vlan 2,3,4
vlan 2
name VLAN2
exit
vlan 3
name VLAN3
exit
vlan 4
name VLAN4
exit

Set a static ip address vlan2,3,4

int vlan 2
ip address 192.168.1.251 255.255.255.0
no shutdown
exit
int vlan 3 ip
address 192.168.2.251 255.255.255.0
no shutdown
exit

Configuring trunk ports

int fa 0/1
switchport trunk encapsulation dot1q
switchport mode trunk
switchport trunk allowed vlan 2,3
exit
int fa 0/2
switchport trunk encapsulation dot1q
switchport mode trunk
switchport trunk allowed vlan 2,3
exit
int fa 0/3
switchport trunk encapsulation dot1q
switchport mode trunk
switchport trunk allowed vlan 2.3
exit

Enable routing and save the configuration
ip routing
do wr mem

Ping will be done from PC3. As you can see, servers and regular computers are separated.

We will talk about setting up the Internet and NAT in the following articles on this topic. As you can see, configuring cisco routers is not that difficult.