Cisco c3560 layer 3 switch configuration
Switch > en
Switch#configure terminal
Switch#hostname c3560
Switch (config) # enable password cisco
Switch (config) # line vty 0 4
Swtich (config-line) # password password
Switch (config-line) # login
(password is the login password of the Telnet user to be set)
Switch (config) # vlan 10
Switch (config-vlan) # name vlan10
Switch (config-vlan) # end
Switch (config) # vlan 20
Switch (config-vlan) # name vlan20
Switch (config-vlan) # end
Switch (config) # vlan 30
Switch (config-vlan) # name vlan30
Switch (config-vlan) # end
Switch (config) # vlan 40
Switch (config-vlan) # name vlan40
Switch (config-vlan) # end
Switch (config) # vlan 50
Switch (config-vlan) # name vlan50
Switch (config-vlan) # end
Switch (config) # vlan 60
Switch (config-vlan) # name vlan60
Switch (config-vlan) # end
Switch (config) # vlan 70
Switch (config-vlan) # name vlan70
Switch (config-vlan) # end
Switch # configure terminal
Switch (config) # interface range fastethernet 0amp 1-14
Switch (config-if) # switchport mode access
Switch (config-if) # switchport access vlan 10
Switch (config-if) # end
/ * Port 1 is used to connect to the connected router 192.168.1.254. Because each VLAN has set sub-gateways and the default route points to 192.168.1.254, each VLAN has been interconnected. It is not necessary to set port 1 as the trunk port and keep the default access port. If the layer 3 switch is connected to the layer 2 switch and multiple VLAN is divided on the layer 2 switch, the two ports interconnected by the layer 3 switch and the layer 2 switch need to be set as trunk ports * /
Switch (config) # interface range fastethernet 0amp 15-16
Switch (config-if) # switchport mode access
Switch (config-if) # switchport access vlan 20
Switch (config-if) # end
Switch (config) # interface range fastethernet0/17-18
Switch (config-if) # switchport mode access
Switch (config-if) # switchport access vlan30
Switch (config-if) # end
Switch (config) # interface fastethernet0/19
Switch (config-if) # switchport mode access
Switch (config-if) # switchport access vlan40
Switch (config-if) # end
Switch (config) # interface fastethernet0/20
Switch (config-if) # switchport mode access
Switch (config-if) # switchport access vlan50
Switch (config-if) # end
Switch (config) # interface range fastethernet0/21-22
Switch (config-if) # switchport mode access
Switch (config-if) # switchport access vlan60
Switch (config-if) # end
Switch (config) # interface range fastethernet0/23-24
Switch (config-if) # switchport mode access
Switch (config-if) # switchport access vlan70
Switch (config-if) # end
Switch (config) # interface vlan 10
Switch (config-if) # ip address 192.168.1.1 255.255.255.0
Switch (config) # interface vlan 20
Switch (config-if) # ip address 192.168.2.1 255.255.255.0
Switch (config) # interface vlan 30
Switch (config-if) # ip address 192.168.3.1 255.255.255.0
Switch (config) # interfacevlan 40
Switch (config-if) # ip address 192.168.4.1 255.255.255.0
Switch (config) # interface vlan 50
Switch (config-if) # ip address 192.168.5.1255.255.255.0
Switch (config-if) # exit
Switch (config) # service dhcp
Switch (config) # ip dhcp replay infomation option
/ * because the switch and router IP are in the same vlan, vlan 10 can get IP*/ without using the ip helper-address command
Switch (config) # Interface vlan 20
Switch (config) # ip helper-address 192.168.1.254
Switch (config) # interface vlan 30
Switch (config) # ip helper-address 192.168.1.254
Switch (config) # interface vlan 40
Switch (config) # ip helper-address 192.168.1.254
Switch (config) # interface vlan 50
Switch (config) # ip helper-address 192.168.1.254
Switch (config) # ip route 0.0.0.0 0.0.0.0 192.168.1.254
Step 7: enable routing
/ * after routing is enabled, the hosts of each VLAN can access each other. If you need to further control access, you need to apply it to the access control list * /
Switch (Config) # Ip Routing
Switch#copy running-config startup-config