El switch Task 4 Layer 3 realiza el acceso mutuo entre diferentes VLAN
El departamento financiero y el departamento de servicio al cliente de Xinke Shanghai Branch están ubicados en el mismo piso, y los dos departamentos están divididos en diferentes VLAN.Ahora quieren comunicarse entre sí a través de un conmutador de capa 3. La topología de la red se muestra en la figura a continuación . El funcionamiento específico es el siguiente:
Paso 1 Planifique el puerto del conmutador, la VLAN y la dirección IP de la computadora , como se muestra en el texto anterior.
Paso 2 Active la función de enrutamiento y divida VLAN10 y VLAN20 , agregue los puertos f 0/1 y f 0/2 respectivamente, el código es el siguiente:
Switch>en
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#
Switch(config)#ip routing //启动路由功能
Switch(config)#vlan 10
Switch(config-vlan)#name AD
Switch(config-vlan)#ex
Switch(config)#vlan 20
Switch(config-vlan)#name FD
Switch(config-vlan)#ex
Switch(config)#int f0/1
Switch(config-if)#switch access vlan 10
Switch(config-if)#ex
Switch(config)#int f0/2
Switch(config-if)#switch access vlan 20
Switch(config-if)#ex
Paso 3 Configure las direcciones IP para VLAN10 y VLAN20 , el código es el siguiente:
Switch(config)#int vlan 10
Switch(config-if)#
%LINK-5-CHANGED: Interface Vlan10, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan10, changed state to up
Switch(config-if)#ip address 192.168.10.1 255.255.255.0 //设置vlan的ip地址
Switch(config-if)#no shutdown
Switch(config-if)#ex
Switch(config)#int vlan 20
Switch(config-if)#
%LINK-5-CHANGED: Interface Vlan20, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan20, changed state to up
Switch(config-if)#ip address 192.168.20.1 255.255.255.0
Switch(config-if)#no shutdown
Switch(config-if)#ex
Switch(config)#ex
Switch#
Paso 3 Verificar la interoperabilidad
Tarea 5 Configuración de enrutamiento dinámico RIP del conmutador
Cuando se conectan en cascada dos o más conmutadores de Capa 3, para permitir que los diferentes segmentos de red conectados a cada conmutador se comuniquen entre sí, es necesario configurar un protocolo de enrutamiento dinámico. Los protocolos de enrutamiento dinámico comunes incluyen RIP , OSPF , etc. Esta tarea introduce la configuración de enrutamiento dinámico RIP del conmutador al realizar la comunicación mutua entre los diferentes pisos de la sede de Xinke . El diagrama de topología de red se muestra en la figura.
Paso 1 : divida las VLAN basadas en puertos en el conmutador S0 y el conmutador S1 respectivamente
Paso 2 Configure las direcciones IP de las interfaces VLAN de los switches S0 y S1
Paso 3 Configure la ubicación de red y la dirección IP de PC1 ~ PC4
Paso 4 configure el interruptor S0 , el código es el siguiente:
Switch>en
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#vlan 10
Switch(config-vlan)#ex
Switch(config)#vlan 20
Switch(config-vlan)#ex
Switch(config)#vlan 100
Switch(config-vlan)#ex
Switch(config)#int f0/1
Switch(config-if)#switch access vlan 10
Switch(config-if)#ex
Switch(config)#int f0/2
Switch(config-if)#switch access vlan 20
Switch(config-if)#int f0/24
Switch(config-if)#switch access vlan 100
Switch(config-if)#ex
Switch(config)#int vlan 10
Switch(config-if)#
%LINK-5-CHANGED: Interface Vlan10, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan10, changed state to up
Switch(config-if)#ip add 192.168.10.1 255.255.255.0
Switch(config-if)#no shutdown
Switch(config-if)#ex
Switch(config)#int vlan 20
Switch(config-if)#
%LINK-5-CHANGED: Interface Vlan20, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan20, changed state to up
Switch(config-if)#ip add 192.168.20.1 255.255.255.0
Switch(config-if)#no shutdown
Switch(config-if)#ex
Switch(config)#int vlan 100
Switch(config-if)#
%LINK-5-CHANGED: Interface Vlan100, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan100, changed state to up
Switch(config-if)#ip add 192.168.100.1 255.255.255.0
Switch(config-if)#no shutdown
Switch(config-if)#ex
Switch(config)#ip routing
Switch(config)#
Paso 5 Configure el switch S1 , el código es el siguiente:
Switch>en
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#vlan 30
Switch(config-vlan)#ex
Switch(config)#vlan 40
Switch(config-vlan)#ex
Switch(config)#vlan 200
Switch(config-vlan)#ex
Switch(config)#int f0/1
Switch(config-if)#switch access vlan 30
Switch(config-if)#ex
Switch(config)#int f0/2
Switch(config-if)#switch access vlan 40
Switch(config-if)#ex
Switch(config)#int f0/24
Switch(config-if)#switch access vlan 200
Switch(config-if)#ex
Switch(config)#int vlan 30
Switch(config-if)#
%LINK-5-CHANGED: Interface Vlan30, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan30, changed state to up
Switch(config-if)#ip add 192.168.30.1 255.255.255.0
Switch(config-if)#no shutdown
Switch(config-if)#ex
Switch(config)#int vlan 40
Switch(config-if)#
%LINK-5-CHANGED: Interface Vlan40, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan40, changed state to up
Switch(config-if)#ip add 192.168.40.1 255.255.255.0
Switch(config-if)#no shutdown
Switch(config-if)#ex
Switch(config)#int vlan 200
Switch(config-if)#
%LINK-5-CHANGED: Interface Vlan200, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan200, changed state to up
Switch(config-if)#ip add 192.168.100.2 255.255.255.0
Switch(config-if)#no shutdown
Switch(config-if)#ex
Switch(config)#ip routing
Switch(config)#
Paso 6 Verificar la interoperabilidad a través del comando Ping
Paso 7 Agregue el protocolo de enrutamiento dinámico RIP del segmento de red conectado directamente en S0
Switch>en
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#router rip
Switch(config-router)#network 192.168.10.0
Switch(config-router)#network 192.168.20.0
Switch(config-router)#network 192.168.100.0
Switch(config-router)#ex
Paso 8 Agregue el protocolo de enrutamiento dinámico RIP del segmento de red conectado directamente en S1 , el código es el siguiente
Switch(config)#router rip
Switch(config-router)#network 192.168.30.0
Switch(config-router)#network 192.168.40.0
Switch(config-router)#network 192.168.100.0
Switch(config-router)#ex
Paso 9 Verificar la interoperabilidad a través del comando Ping
Tarea 6 Configuración de enrutamiento dinámico OSPF entre switches
Esta tarea utiliza el protocolo OSPF para realizar la comunicación mutua entre los diferentes pisos de Xinke Company e introduce la configuración de enrutamiento dinámico OSPF del conmutador. La topología de la red se muestra en la siguiente figura.
Paso 1 Consulte los pasos 1 al 6 de la tarea 5 de este proyecto , configure los switches S1 , S2 y PC1 , PC2 , PC3 , PC4 y verifique la interoperabilidad a través del comando Ping .
Paso 2 Inicie el protocolo OSPF en S0 y configure el segmento de red directamente conectado correspondiente en el proceso OSPF . El código es el siguiente:
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#router ospf 1
Switch(config-router)#network 192.168.10.0 0.0.0.255 area 0
Switch(config-router)#network 192.168.20.0 0.0.0.255 area 0
Switch(config-router)#network 192.168.100.0 0.0.0.255 area 0
Switch(config-router)#ex
Switch(config)#
Paso 3 Inicie el protocolo OSPF en S1 y configure el segmento de red directamente conectado correspondiente al proceso OSPF . El código es el siguiente:
Switch>en
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#router ospf 1
Switch(config-router)#network 192.168.30.0 255.255.255.0
% Incomplete command.
Switch(config-router)#network 192.168.30.0 0.0.0.255 area 0
Switch(config-router)#network 192.168.40.0 0.0.0.255 area 0
Switch(config-router)#network 192.168.100.0 0.0.0.255 area 0
Switch(config-router)#ex
Switch(config)#
Paso 4 Verificar la interoperabilidad a través del comando Ping