本次練習是參考Cisco網路學院
CCNA Exploration 4.0 LAN Switching and Wireless
Student Lab Manual
我將它轉成Dynamips的設定檔 並寫下自己的實驗紀錄
Dynamips的設定檔:
##################################################
#
# For CCNA Exploration 4.0 LAN and Switching and Wireless
# Lab 5.5.2-3
#
##################################################
autostart=false
[localhost:7200]
workingdir = /opt/dynamips/dynagen-0.10.1/UTS/CCNA3/Week03/workingconfig/
[[3640]]
# Specify 3640 IOS image on Windows here:
# image = C:Program FilesDynamipsimagesc3640-jk9o3s-mz.123-14.T7.extracted.bin
# Specify 3640 IOS image on Linux here:
image = /opt/dynamips/images/c3640-jk.bin
ram = 128
disk0 = 0
disk1 = 0
# Choose an idlepc value from the below
idlepc = 0x605ac7b8
mmap = true
ghostios = true
confreg = 0x2102
###########################
#
# Define router instances 1
#
###########################
[[Router SW1]]
model = 3640
console = 2001
autostart = false
slot0 = NM-16ESW
F0/1 = SW3 F0/1
F0/2 = SW3 F0/2
F0/3 = SW2 F0/3
F0/4 = SW2 F0/4
[[Router SW2]]
model = 3640
console = 2002
autostart = false
slot0 = NM-16ESW
F0/11 = PC1 F0/0
F0/12 = PC2 F0/0
F0/13 = PC3 F0/0
[[Router SW3]]
model = 3640
console = 2003
autostart = false
slot0 = NM-16ESW
F0/3 = SW2 F0/1
F0/4 = SW2 F0/2
[[Router PC1]]
model = 3640
console = 2004
autostart = false
slot0 = NM-1FE-TX
[[Router PC2]]
model = 3640
console = 2005
autostart = false
slot0 = NM-1FE-TX
[[Router PC3]]
model = 3640
console = 2006
autostart = false
slot0 = NM-1FE-TX
這Lab是STP設定練習
我的設定是
1. 先設定PC1-4
hostname PC*
!
no ip domain lookup
!
interface FastEthernet0/0
ip address 172.17.*0.2* 255.255.255.0
no shutdown
!
ip route 0.0.0.0 0.0.0.0 172.17.*0.12
!
line con 0
logging synchronous
!
end
2. 設定VTP
S1-3:
VTP Domain: Lab5
VTP Password: cisco
S1:
VTP mode: Server
S2-3
VTP mode: Client
Switch1:
vlan database
vtp server
vtp domain Lab5
vtp password cisco
exit
Switch2-3:
vlan database
vtp client
vtp domain Lab5
vtp password cisco
exit
2. 設定Switch1-3的Trunk Port 和 Native VLAN
Switch1-3:
interface range fastEthernet 0/1 - 4
switchport mode trunk
switchport trunk encapsulation dot1q
switchport trunk native vlan 99
no shutdown
3. 設定Switch1的VLAN
Switch1:
SW1#vlan database
vlan 99 name Management
vlan 10 name Staff
vlan 20 name Students
vlan 30 name Guest
exit
檢查Switch1-3的VLAN設定
Switch1-3:
show vlan-switch
4. 設定Switch1-3的Management VLAN
Switch1-3:
interface vlan 99
ip address 172.17.99.* 255.255.255.0
no shutdown
互ping 有通
5. Switch2 指派VLAN到Port
Switch2:
interface fastEthernet 0/11
switchport mode access
switchport access vlan 10
no shutdown
!
interface fastEthernet 0/12
switchport mode access
switchport access vlan 20
no shutdown
!
interface fastEthernet 0/13
switchport mode access
switchport access vlan 30
no shutdown
6. Switch1-3 觀察目前STP的參數
Switch1-3:
show spanning-tree
debug spanning-tree events
7. Switch1&3 調整STP
Switch1:
spanning-tree vlan 1 priority 4096
spanning-tree vlan 10 priority 4096
spanning-tree vlan 20 priority 4096
spanning-tree vlan 30 priority 4096
Switch3:
spanning-tree vlan 99 priority 4096
然後再觀察SW1-3的STP的變化
show spanning-tree
8. 驗證指令
show spanning-tree
debug spanning-tree events
最後PC1-3,SW1-3互ping 有通 結束
Switch1設定檔:
hostname SW1
!
no ip domain lookup
!
spanning-tree vlan 1 priority 4096
spanning-tree vlan 10 priority 4096
spanning-tree vlan 20 priority 4096
spanning-tree vlan 30 priority 4096
!
interface FastEthernet0/1
switchport trunk native vlan 99
switchport mode trunk
!
interface FastEthernet0/2
switchport trunk native vlan 99
switchport mode trunk
!
interface FastEthernet0/3
switchport trunk native vlan 99
switchport mode trunk
!
interface FastEthernet0/4
switchport trunk native vlan 99
switchport mode trunk
!
interface Vlan99
ip address 172.17.99.11 255.255.255.0
!
line con 0
logging synchronous
!
end
Switch2設定檔:
hostname SW2
!
no ip domain lookup
!
interface FastEthernet0/1
switchport trunk native vlan 99
switchport mode trunk
!
interface FastEthernet0/2
switchport trunk native vlan 99
switchport mode trunk
!
interface FastEthernet0/3
switchport trunk native vlan 99
switchport mode trunk
!
interface FastEthernet0/4
switchport trunk native vlan 99
switchport mode trunk
!
interface FastEthernet0/11
switchport access vlan 10
!
interface FastEthernet0/12
switchport access vlan 20
!
interface FastEthernet0/13
switchport access vlan 30
!
interface Vlan99
ip address 172.17.99.12 255.255.255.0
!
line con 0
logging synchronous
!
end
Switch3設定檔:
hostname SW3
!
no ip domain lookup
!
spanning-tree vlan 99 priority 4096
!
interface FastEthernet0/1
switchport trunk native vlan 99
switchport mode trunk
!
interface FastEthernet0/2
switchport trunk native vlan 99
switchport mode trunk
!
interface FastEthernet0/3
switchport trunk native vlan 99
switchport mode trunk
!
interface FastEthernet0/4
switchport trunk native vlan 99
switchport mode trunk
!
interface Vlan99
ip address 172.17.99.13 255.255.255.0
!
line con 0
logging synchronous
!
end
PC1設定檔:
hostname PC1
!
no ip domain lookup
!
interface FastEthernet0/0
ip address 172.17.10.21 255.255.255.0
duplex auto
speed auto
!
ip route 0.0.0.0 0.0.0.0 172.17.10.12
!
line con 0
logging synchronous
!
end
PC2設定檔:
hostname PC2
!
no ip domain lookup
!
interface FastEthernet0/0
ip address 172.17.20.22 255.255.255.0
duplex auto
speed auto
!
ip route 0.0.0.0 0.0.0.0 172.17.20.12
!
line con 0
logging synchronous
!
end
PC3設定檔:
hostname PC3
!
no ip domain lookup
!
interface FastEthernet0/0
ip address 172.17.30.23 255.255.255.0
duplex auto
speed auto
!
ip route 0.0.0.0 0.0.0.0 172.17.30.12
!
line con 0
logging synchronous
!
end
參考資料:
Cisco網路學院 http://www.cisco.com/web/learning/netacad/index.html
CCNA Exploration 4.0 LAN Switching and Wireless
Student Lab Manual
最初發表 / 最後更新: 2008.03.21 / 2018.05.28
0 comments:
張貼留言