当前位置:文档之家› 三层交换机配置案例pdf

三层交换机配置案例pdf

实验二网络拓扑:交换机1和2配置:Switch>enableSwitch#vlan database% Warning: It is recommended to configure VLAN from config mode,as VLAN database mode is being deprecated. Please consult userdocumentation for configuring VTP/VLAN in config mode.Switch(vlan)#vlan 10VLAN 10 added:Name: VLAN0010Switch(vlan)#vlan 20VLAN 20 added:Name: VLAN0020Switch(vlan)#exitAPPLY completed.Exiting....Switch#configure terminalEnter configuration commands, one per line. End with CNTL/Z.Switch(config)#interface fastEthernet 0/1Switch(config-if)#switchport mode trunkSwitch(config-if)#%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up Switch(config-if)#switchport trunk allowed vlan allSwitch(config-if)#exitSwitch(config)#interface fastEthernet 0/2Switch(config-if)#switchport mode accessSwitch(config-if)#switchport access vlan 10Switch(config-if)#exitSwitch(config)#interface fastEthernet 0/3Switch(config-if)#switchport mode accessSwitch(config-if)#switchport access vlan 20Switch(config-if)#exit交换机3配置:Switch>enableSwitch#vlan database% Warning: It is recommended to configure VLAN from config mode,as VLAN database mode is being deprecated. Please consult userdocumentation for configuring VTP/VLAN in config mode.Switch(vlan)#vlan 30VLAN 30 added:Name: VLAN0030Switch(vlan)#exitAPPLY completed.Exiting....Switch#configure terminalEnter configuration commands, one per line. End with CNTL/Z.Switch(config)#interface fastEthernet 0/1Switch(config-if)#switchport mode trunkSwitch(config-if)#%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up Switch(config-if)#switchport trunk allowed vlan allSwitch(config-if)#exitSwitch(config)#interface fastEthernet 0/2Switch(config-if)#switchport mode accessSwitch(config-if)#switchport access vlan 30Switch(config-if)#exitSwitch(config)#交换机4配置Switch>enableSwitch#vlan database% Warning: It is recommended to configure VLAN from config mode,as VLAN database mode is being deprecated. Please consult userdocumentation for configuring VTP/VLAN in config mode.Switch(vlan)#vlan 40VLAN 40 added:Name: VLAN0040Switch(vlan)#exitAPPLY completed.Exiting....Switch#configure terminalEnter configuration commands, one per line. End with CNTL/Z.Switch(config)#interface fastEthernet 0/1Switch(config-if)#switchport mode trunkSwitch(config-if)#%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up Switch(config-if)#switchport trunk allowed vlan allSwitch(config-if)#exitSwitch(config)#interface fastEthernet 0/2Switch(config-if)#switchport mode accessSwitch(config-if)#switchport access vlan 40Switch(config-if)#exitSwitch(config)#三层交换机1配置:Switch>enableSwitch#vlan database% Warning: It is recommended to configure VLAN from config mode,as VLAN database mode is being deprecated. Please consult userdocumentation for configuring VTP/VLAN in config mode.Switch(vlan)#vlan 10VLAN 10 added:Name: VLAN0010Switch(vlan)#vlan 20VLAN 20 added:Name: VLAN0020Switch(vlan)#vlan 70VLAN 70 added:Name: VLAN0070Switch(vlan)#exitAPPLY completed.Exiting....Switch#configure terminalEnter configuration commands, one per line. End with CNTL/Z.Switch(config)#interface fastEthernet 0/1Switch(config-if)#switchport mode accessSwitch(config-if)#switchport access vlan 70Switch(config-if)#no shutdownSwitch(config-if)#exitSwitch(config)#interface fastEthernet 0/2Switch(config-if)#switchport trunk encapsulation dot1qSwitch(config-if)#switchport mode trunkSwitch(config-if)#switchport trunk allowed vlan allSwitch(config-if)#exitSwitch(config)#interface fastEthernet 0/3Switch(config-if)#switchport trunk encapsulation dot1qSwitch(config-if)#switchport mode trunkSwitch(config-if)#switchport trunk allowed vlan allSwitch(config-if)#exitSwitch(config)#int vlan 10Switch(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.1.254 255.255.255.0Switch(config-if)#exitSwitch(config)#int vlan 20Switch(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.2.254 255.255.255.0Switch(config-if)#exitSwitch(config)#int vlan 70Switch(config-if)#%LINK-5-CHANGED: Interface Vlan70, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan70, changed state to up Switch(config-if)#ip address 192.168.7.2 255.255.255.0Switch(config-if)#exitSwitch(config)#ip routingSwitch(config)#ip route 0.0.0.0 0.0.0.0 192.168.7.1Switch(config)#endSwitch#%SYS-5-CONFIG_I: Configured from console by consoleSwitch#write memoryBuilding configuration...[OK]Switch#三层交换机2配置:Switch>enableSwitch#vlan database% Warning: It is recommended to configure VLAN from config mode,as VLAN database mode is being deprecated. Please consult userdocumentation for configuring VTP/VLAN in config mode.Switch(vlan)#vlan 30VLAN 30 added:Name: VLAN0030Switch(vlan)#vlan 40VLAN 40 added:Name: VLAN0040Switch(vlan)#vlan 80VLAN 80 added:Name: VLAN0080Switch(vlan)#Switch(vlan)#exitAPPLY completed.Exiting....Switch#configure terminalEnter configuration commands, one per line. End with CNTL/Z.Switch(config)#interface fastEthernet 0/1Switch(config-if)#switchport mode accessSwitch(config-if)#switchport access vlan 80Switch(config-if)#no shutdownSwitch(config-if)#exitSwitch(config)#interface fastEthernet 0/2Switch(config-if)#switchport trunk encapsulation dot1qSwitch(config-if)#switchport mode trunkSwitch(config-if)#switchport trunk allowed vlan allSwitch(config-if)#exitSwitch(config)#interface fastEthernet 0/3Switch(config-if)#switchport trunk encapsulation dot1qSwitch(config-if)#switchport mode trunkSwitch(config-if)#switchport trunk allowed vlan allSwitch(config-if)#exitSwitch(config)#int vlan 30Switch(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 address 192.168.3.254 255.255.255.0Switch(config-if)#exitSwitch(config)#int vlan 40Switch(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 address 192.168.4.254 255.255.255.0Switch(config-if)#exitSwitch(config)#int vlan 80Switch(config-if)#%LINK-5-CHANGED: Interface Vlan80, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan80, changed state to up Switch(config-if)#ip address 192.168.8.2 255.255.255.0Switch(config-if)#exitSwitch(config)#ip routingSwitch(config)#ip route 0.0.0.0 0.0.0.0 192.168.8.1Switch(config)#endSwitch#%SYS-5-CONFIG_I: Configured from console by consoleSwitch#write memoryBuilding configuration...[OK]Switch#路由器配置:Router>enableRouter#configure terminalEnter configuration commands, one per line. End with CNTL/Z.Router(config)#interface fastEthernet 0/0Router(config-if)#ip address 192.168.7.1 255.255.255.0Router(config-if)#no shutdownRouter(config-if)#%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up Router(config-if)#exitRouter(config)#interface fastEthernet 0/1Router(config-if)#ip address 192.168.8.1 255.255.255.0Router(config-if)#no shutdownRouter(config-if)#%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up Router(config-if)#exitRouter(config)#ip route 192.168.1.0 255.255.255.0 192.168.7.2Router(config)#ip route 192.168.2.0 255.255.255.0 192.168.7.2Router(config)#ip route 192.168.3.0 255.255.255.0 192.168.8.2Router(config)#ip route 192.168.4.0 255.255.255.0 192.168.8.2Router(config)#endRouter#%SYS-5-CONFIG_I: Configured from console by consoleRouter#write memoryBuilding configuration...[OK]Router#测试:。

相关主题