Crear 2 vlan

cvf_pt.pkt.7z Renombrar a cvf_pt.pkt

2vlan_router_switch_2pcs.png

Configuración del Router

Reset del router por software

Router>enable
Router#write erase
Erasing the nvram filesystem will remove all configuration files! Continue? [confirm]
[OK]
Erase of nvram: complete
%SYS-7-NV_BLOCK_INIT: Initialized the geometry of nvram
Router#reload
Proceed with reload? [confirm]

Cambiar nombre al router

Router>enable
Router#configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#hostname NombreRouter
NombreRouter(config)#exit
NombreRouter#
%SYS-5-CONFIG_I: Configured from console by console
NombreRouter#exit

Configurar la ip y dhcp en el puerto g0/0 del router (el que conecta a un switch)

Router>enable
Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#interface g0/0
Router(config-if)#ip address 192.168.1.1 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to up
Router(config-if)#exit
Router(config)#ip dhcp pool vlan1
Router(dhcp-config)#network 192.168.1.0 255.255.255.0
Router(dhcp-config)#default-router 192.168.1.1
Router(dhcp-config)#dns-server 8.8.8.8
Router(dhcp-config)#exit
Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#ip dhcp excluded-address 192.168.1.1
Router(config)#exit
Router#
%SYS-5-CONFIG_I: Configured from console by console
Router#exit

Crear vlan en el router

Router>enable
Router#vlan database
% Warning: It is recommended to configure VLAN from config mode,
  as VLAN database mode is being deprecated. Please consult user
  documentation for configuring VTP/VLAN in config mode.
Router(vlan)#vlan 10 name Ciencias
VLAN 10 added:
    Name: Ciencias
Router(vlan)#vlan 20 name Matematicas
VLAN 20 added:
    Name: Matematicas
Router(vlan)#exit
APPLY completed.
Exiting....
Router#exit
Router1#configure terminal
Router1(config)#interface g0/0.10
Router1(config-subif)#
%LINK-5-CHANGED: Interface GigabitEthernet0/0.10, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0.10, changed state to up
Router1(config-subif)#encapsulation dot1Q 10
Router1(config-subif)#ip add 192.168.10.1 255.255.255.0
Router1(config-subif)#exit
Router1(config)#ip dhcp excluded-address 192.168.10.1
Router1(config)#ip dhcp pool vlan10
Router1(dhcp-config)#network 192.168.10.0 255.255.255.0
Router1(dhcp-config)#default-router 192.168.10.1
Router(dhcp-config)#dns-server 8.8.8.8
Router1(dhcp-config)#exit
Router1(config)#
Router1(config)#interface g0/0.20
Router1(config-subif)#
%LINK-5-CHANGED: Interface GigabitEthernet0/0.20, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0.20, changed state to up
Router1(config-subif)#encapsulation dot1Q 20
Router1(config-subif)#ip address 192.168.20.1 255.255.255.0
Router1(config-subif)#exit
Router1(config)#ip dhcp excluded-address 192.168.20.1
Router1(config)#ip dhcp pool vlan20
Router1(dhcp-config)#network 192.168.20.0 255.255.255.0
Router1(dhcp-config)#default-router 192.168.20.1
Router(dhcp-config)#dns-server 8.8.8.8
Router1(dhcp-config)#exit
Router1(config)#

Guardar configuración del router

Router#copy running-config startup-config 
Destination filename [startup-config]? 
Building configuration...
[OK]
Router#

Configuración del Switch

Cambiar nombre al switch

Switch>
Switch>enable
Switch#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#hostname Switch1
Switch1(config)#

Configurar el interfaz g0/1 del Switch

Switch1(config)#interface g0/1
Switch1(config-if)#switchport trunk allowed vlan 1,10,20
Switch1(config-if)#switchport mode trunk
Switch1(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to up
Switch1(config-if)#exit
Switch1(config)#

Crear las vlan en el Switch

Switch1(config)#vlan 10
Switch1(config-vlan)#name Ciencias
Switch1(config-vlan)#exit
Switch1(config)#vlan 20
Switch1(config-vlan)#name Matematicas
Switch1(config-vlan)#exit

Configurar las interfaces fastEthernet del switch

Switch1(config)#interface f0/1
Switch1(config-if)#switchport access vlan 10
Switch1(config-if)#exit
Switch1(config)#interface f0/2
Switch1(config-if)#switchport access vlan 20
Switch1(config-if)#exit
Switch1(config)#
==== Guardar la configuración del Switch ====
Switch1#copy running-config startup-config
Destination filename [startup-config]? 
Building configuration...
[OK]
Switch1#

Configuración de los 2 pc

Poner los pc en modo dhcp

Click en el pc
Pestaña Desktop
IP Configuration
DHCP
Esperar un poco y aparecerá la ip 192.168.1.x