Task 4 Layer 3 switch realizes mutual access between different VLANs
The financial department and the customer service department of Xinke Shanghai Branch are located on the same floor, and the two departments are divided into different VLANs . Now they want to communicate with each other through a Layer 3 switch. The network topology is shown in the figure below . The specific operation is as follows:
Step 1 Plan the switch port, VLAN and computer IP address, as shown in the text above.
Step 2 Turn on the routing function and divide VLAN10 and VLAN20 , add ports f 0/1 and f 0/2 respectively, the code is as follows:
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
Step 3 Set IP addresses for VLAN10 and VLAN20 , the code is as follows:
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#
Step 3 Verify Interoperability
Task 5 RIP dynamic routing configuration of the switch
When two or more Layer 3 switches are cascaded, in order to enable the different network segments connected to each switch to communicate with each other, it is necessary to configure a dynamic routing protocol. Common dynamic routing protocols include RIP , OSPF and so on. This task introduces the RIP dynamic routing configuration of the switch by realizing the mutual communication between different floors of the Xinke headquarters . The network topology diagram is shown in the figure.
Step 1 : Divide port-based VLANs on switch S0 and switch S1 respectively
Step 2 Configure the IP addresses of the VLAN interfaces of switches S0 and S1
Step 3 Set the network location and IP address of PC1 ~ PC4
Step 4 configure switch S0 , the code is as follows:
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)#
Step 5 Configure switch S1 , the code is as follows:
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)#
Step 6 Verify interoperability through the Ping command
Step 7 Add the dynamic routing protocol RIP of the directly connected network segment on 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
Step 8 Add the dynamic routing protocol RIP of the directly connected network segment on S1 , the code is as follows
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
Step 9 Verify interoperability through the Ping command
Task 6 OSPF dynamic routing configuration between switches
This task uses the OSPF protocol to realize the mutual communication between different floors of Xinke Company, and introduces the OSPF dynamic routing configuration of the switch. The network topology is shown in the figure below.
Step 1 Refer to steps 1 to 6 of task 5 of this project , configure switches S1 , S2 and PC1 , PC2 , PC3 , PC4 , and verify the interoperability through the Ping command .
Step 2 Start the OSPF protocol on S0 , and configure the corresponding directly connected network segment into the OSPF process. The code is as follows:
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)#
Step 3 Start the OSPF protocol on S1 , and configure the corresponding directly connected network segment to the OSPF process. The code is as follows:
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)#
Step 4 Verify interoperability through the Ping command