綜合組網實訓指導書
1. 實訓步驟
1.1. 建立拓撲結構,完成數據規劃
1.2. 完成PC到交換機2950的數據配置
1.2.1. 創建VLAN
Switch>ena
Switch#conf terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#vlan 10
Switch(config-vlan)#exit
Switch(config)#vlan 20
Switch(config-vlan)#exit
1.2.2. 更改端口類型,並且把端口加入到相應VLAN中
Switch(config)#interface fastEthernet 0/1
Switch(config-if)#switchport access vlan 10
Switch(config-if)#exit
Switch(config)#interface fastEthernet 0/2
Switch(config-if)#switchport access vlan 20
Switch(config-if)#exit
Switch(config)#interface fastEthernet 0/24
Switch(config-if)#switchport mode trunk
Switch(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/24, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/24, changed state to up
Switch(config-if)#switchport trunk allowed vlan 10
Switch(config-if)#switchport trunk allowed vlan add 20
Switch(config-if)#
1.3. 3560交換機配置
1.3.1. 創建VLAN
Switch>ena
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#vlan 10
Switch(config-vlan)#exit
Switch(config)#vlan 20
Switch(config-vlan)#exit
Switch(config)#
1.3.2. 更改鏈接下級(2950)交換機端口的端口類型與所屬VLAN
Switch(config)#interface fastEthernet 0/1
Switch(config-if)#switchport mode trunk
Command rejected: An interface whose trunk encapsulation is "Auto" can not be configured to "trunk" mode.
Switch(config-if)#switchport trunk encapsulation dot1q
Switch(config-if)#switchport mode trunk
Switch(config-if)#switchport trunk allowed vlan 10
Switch(config-if)#switchport trunk allowed vlan add 20
Switch(config-if)#exit
Switch(config)#
1.3.3. 創建VLAN接口,在VLAN接口下配置VLAN的網關
Switch(config)#interface 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 172.20.9.254 255.255.255.0
Switch(config-if)#exit
Switch(config)#interface 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 172.20.10.254 255.255.255.0
Switch(config-if)#exit
Switch(config)#
1.4. 驗證PC與網關之間鏈路的連通是否正常
1.4.1. 配置PC的IP地址
1.4.2. 在PC的命令提示符窗口內ping 各自的網關地址
注意事項:如果配置好了網關,兩個網絡之間不能ping通,需要在3560交換機中使用“Switch(config) ip routing”開啟路由功能。
1.5. 3560與路由器2911之間連接配置
1.5.1. 配置3560的VLAN300接口配置
1.5.1.1. 創建VLAN300接口地址
Switch(config)#vlan 300
Switch(config-vlan)#exit
Switch(config)#interface vlan 300
Switch(config-if)#
%LINK-5-CHANGED: Interface Vlan300, changed state to up
Switch(config-if)#ip address 10.10.10.1 255.255.255.252
Switch(config-if)#exit
Switch(config)#
1.5.1.2. VLAN300與接口關聯起來
1、3560設備連接路由的端口是ACCESS類型,對端路由器的接口地址直接配置在物理接口下
2、3560設備連接路由器端口是TRUNK類型,對端路由器的接口地址配置在子接口下,並且子接口要關聯相對應的VLAN
Switch(config)#interface gigabitEthernet 0/1
Switch(config-if)#switchport trunk encapsulation dot1q
Switch(config-if)#switchport mode trunk
Switch(config-if)#switchport trunk allowed vlan 300
1.5.1.3. 配置路由器2911
Router(config)#interface fastEthernet 0/0
Router(config-if)#no shutdown
Router(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)#exit
Router(config)#interface fastEthernet 0/0.300
Router(config-subif)#
%LINK-5-CHANGED: Interface FastEthernet0/0.300, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.300, changed state to up
Router(config-subif)#encapsulation dot1Q 300
Router(config-subif)#ip address 10.10.10.2 255.255.255.252
Router(config-subif)#exit
Router(config)#
1.5.1.4. 2911路由器加去往172.20.9.0/24的路由
Router(config)#ip route 172.20.9.0 255.255.255.0 10.10.10.1
Router(config)#
1.6. 配置服務器網關
Router(config)#interface fastEthernet 0/1
Router(config-if)#no shutdown
Router(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)#ip address 192.168.1.254 255.255.255.0
Router(config-if)#
1.7. 配置服務器的IP地址
1.8. 在3560上加一條去往服務器的路由
Switch(config)#
Switch(config)#ip route 192.168.1.0 255.255.255.0 10.10.10.2
Switch(config)#