- bài lab mô tả cách giả lập switch layer 3 trên Dynagen và cấu hình InterVLAN routing:
- cấu hình file .net :
- cấu hình của các virtual pc:
- cấu hình Switch L3:
Router(config)#hostname SWL3
SWL3(config)#ip routing
SWL3(config)#int range fa 0/1 - 2
SWL3(config-if-range)#switchport trunk encapsulation dot1q
SWL3(config-if-range)#switchport mode trunk
SWL3(config-if-range)#exit
SWL3(config)#int vlan 2
SWL3(config-if)#ip address 192.168.2.1 255.255.255.0
SWL3(config-if)#no shut
SWL3(config)#int vlan 3
SWL3(config-if)#ip address 192.168.3.1 255.255.255.0
SWL3(config-if)#no shut
SWL3(config-if)#int loopback 0
SWL3(config-if)#ip address 10.0.0.1 255.255.255.0
SWL3(config-if)#end
SWL3#vlan database
SWL3(vlan)#vtp server
SWL3(vlan)#vtp domain cisco
SWL3(vlan)#vlan 2 name group02
SWL3(vlan)#vlan 3 name group03
SWL3(vlan)#exit
SWL3#
- cấu hình SW1:
Router(config)#hostname SW1
SW1(config)#no ip routing
SW1#vlan database
SW1(vlan)#vtp client
SW1(vlan)#vtp domain cisco
SW1(vlan)#exit
SW1#conf t
SW1(config)#int fa1/0
SW1(config-if)#switchport trunk encapsulation dot1q
SW1(config-if)#switchport mode trunk
SW1(config-if)#exit
SW1(config)#int range fa 1/3 - 4
SW1(config-if-range)#switchport mode access
SW1(config-if-range)#switchport access vlan 2
SW1(config-if-range)#end
- cấu hình SW2
Router(config)#hostname SW2
SW2(config)#no ip routing
SW2#vlan database
SW2(vlan)#vtp client
SW2(vlan)#vtp domain cisco
SW2(vlan)#exit
SW2#conf t
SW2(config)#int fa1/0
SW2(config-if)#switchport trunk encapsulation dot1q
SW2(config-if)#switchport mode trunk
SW2(config-if)#exit
SW2(config)#int range fa 1/3 - 4
SW2(config-if-range)#switchport mode access
SW2(config-if-range)#switchport access vlan 3
SW2(config-if-range)#end
- ktra lại lab : từ các virtual pc ở vlan 2 ping đến các virtual pc ở vlan 3 và ping được đến địa chỉ ip 10.0.0.1 của interface loopback 0 trên SWL3.
- cấu hình file .net :
#simulate Layer 3 switch
#Inter VLAN routing
[localhost]
[[3640]]
image = D:\dynagenlabs\images\c3640-jk9o3s-mz.123-14.T7.extracted.bin
ram = 256
mmap = true
ghostios = true
sparsemem = true
#switch SW1
[[Router SW1]]
model = 3640
console = 2002
slot 1 = NM-16ESW
idlepc = 0x8000ba50
fa1/3 = NIO_udp:30000:127.0.0.1:20000
fa1/4 = NIO_udp:30001:127.0.0.1:20001
#switch SW2
[[Router SW2]]
model = 3640
console = 2003
slot 1 = NM-16ESW
idlepc = 0x8000becc
fa1/3 = NIO_udp:30002:127.0.0.1:20002
fa1/4 = NIO_udp:30003:127.0.0.1:20003
#switch layer 3
[[Router SWL3]]
model = 3640
console = 2004
slot 0 = NM-16ESW
#idlepc = 0x60566918
f0/1 = SW1 fa1/0
f0/2 = SW2 fa1/0
#Inter VLAN routing
[localhost]
[[3640]]
image = D:\dynagenlabs\images\c3640-jk9o3s-mz.123-14.T7.extracted.bin
ram = 256
mmap = true
ghostios = true
sparsemem = true
#switch SW1
[[Router SW1]]
model = 3640
console = 2002
slot 1 = NM-16ESW
idlepc = 0x8000ba50
fa1/3 = NIO_udp:30000:127.0.0.1:20000
fa1/4 = NIO_udp:30001:127.0.0.1:20001
#switch SW2
[[Router SW2]]
model = 3640
console = 2003
slot 1 = NM-16ESW
idlepc = 0x8000becc
fa1/3 = NIO_udp:30002:127.0.0.1:20002
fa1/4 = NIO_udp:30003:127.0.0.1:20003
#switch layer 3
[[Router SWL3]]
model = 3640
console = 2004
slot 0 = NM-16ESW
#idlepc = 0x60566918
f0/1 = SW1 fa1/0
f0/2 = SW2 fa1/0
# The startup file of VPC
#
1
ip 192.168.2.10 192.168.2.1 24
# switch to PC1
1
2
ip 192.168.2.20 192.168.2.1 24
# switch to PC2
2
3
ip 192.168.3.10 192.168.3.1 24
# switch to PC1
3
4
ip 192.168.3.20 192.168.3.1 24
# switch to PC2
4
#
1
ip 192.168.2.10 192.168.2.1 24
# switch to PC1
1
2
ip 192.168.2.20 192.168.2.1 24
# switch to PC2
2
3
ip 192.168.3.10 192.168.3.1 24
# switch to PC1
3
4
ip 192.168.3.20 192.168.3.1 24
# switch to PC2
4
Router(config)#hostname SWL3
SWL3(config)#ip routing
SWL3(config)#int range fa 0/1 - 2
SWL3(config-if-range)#switchport trunk encapsulation dot1q
SWL3(config-if-range)#switchport mode trunk
SWL3(config-if-range)#exit
SWL3(config)#int vlan 2
SWL3(config-if)#ip address 192.168.2.1 255.255.255.0
SWL3(config-if)#no shut
SWL3(config)#int vlan 3
SWL3(config-if)#ip address 192.168.3.1 255.255.255.0
SWL3(config-if)#no shut
SWL3(config-if)#int loopback 0
SWL3(config-if)#ip address 10.0.0.1 255.255.255.0
SWL3(config-if)#end
SWL3#vlan database
SWL3(vlan)#vtp server
SWL3(vlan)#vtp domain cisco
SWL3(vlan)#vlan 2 name group02
SWL3(vlan)#vlan 3 name group03
SWL3(vlan)#exit
SWL3#
- cấu hình SW1:
Router(config)#hostname SW1
SW1(config)#no ip routing
SW1#vlan database
SW1(vlan)#vtp client
SW1(vlan)#vtp domain cisco
SW1(vlan)#exit
SW1#conf t
SW1(config)#int fa1/0
SW1(config-if)#switchport trunk encapsulation dot1q
SW1(config-if)#switchport mode trunk
SW1(config-if)#exit
SW1(config)#int range fa 1/3 - 4
SW1(config-if-range)#switchport mode access
SW1(config-if-range)#switchport access vlan 2
SW1(config-if-range)#end
- cấu hình SW2
Router(config)#hostname SW2
SW2(config)#no ip routing
SW2#vlan database
SW2(vlan)#vtp client
SW2(vlan)#vtp domain cisco
SW2(vlan)#exit
SW2#conf t
SW2(config)#int fa1/0
SW2(config-if)#switchport trunk encapsulation dot1q
SW2(config-if)#switchport mode trunk
SW2(config-if)#exit
SW2(config)#int range fa 1/3 - 4
SW2(config-if-range)#switchport mode access
SW2(config-if-range)#switchport access vlan 3
SW2(config-if-range)#end
- ktra lại lab : từ các virtual pc ở vlan 2 ping đến các virtual pc ở vlan 3 và ping được đến địa chỉ ip 10.0.0.1 của interface loopback 0 trên SWL3.
Comment