tuananhit
21-07-2006, 05:47 PM
cho topo mang nhu sau:
pc1----SW----PC2
............|
...........pc3
SW: 2950
Pc1 gan' voi' fa0/2 cua SW IP 192.168.1.10 SM:255.255.255.0
PC2 gan' voi' fa0/4 cua SW IP 192.168.1.20 SM:255.255.255.0
pc3 gan voi' fa0/7 cua SW IP 192.168.1.30 SM:255.255.255.0
chua cau hinh VLAN:
3 may' ping voi' nhau de^u` tho^ng.
Switch>ena
Switch#sh run
!
Version 12.1
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname Switch
ip name-server 0.0.0.0
!
!
!
ip subnet-zero
!
!
!
!
!
!
spanning-tree extend system-id
!
!
!
!
interface FastEthernet0/1
bandwidth 100000
!
interface FastEthernet0/2
bandwidth 100000
!
interface FastEthernet0/3
bandwidth 100000
!
interface FastEthernet0/4
bandwidth 100000
!
interface FastEthernet0/5
bandwidth 100000
!
interface FastEthernet0/6
bandwidth 100000
!
interface FastEthernet0/7
bandwidth 100000
!
interface FastEthernet0/8
bandwidth 100000
!
interface FastEthernet0/9
bandwidth 100000
!
interface FastEthernet0/10
bandwidth 100000
!
interface FastEthernet0/11
bandwidth 100000
!
interface FastEthernet0/12
bandwidth 100000
!
vtp domain bigdomain
interface Vlan 1
no ip address
no ip route-cache
shutdown
!
ip classless
no ip http server
!
!
!
line con 0
transport input none
line aux 0
line vty 0 15
!
no scheduler allocate
end
ca^u' hinh` VLAN nhu sau:
Switch#vlan database
Switch(vlan)#vlan 10 name VLAN10
VLAN 10 added:
Name:VLAN10
Switch(vlan)#vlan 20 name VLAN20
VLAN 20 added:
Name:VLAN20
Switch(vlan)#vlan 30 name VLAN30
VLAN 30 added:
Name:VLAN30
Switch>sh vlan
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4
Fa0/5, Fa0/6, Fa0/7, Fa0/8
Fa0/9, Fa0/10, Fa0/11, Fa0/12
10 VLAN10 active
20 VLAN20 active
30 VLAN30 active
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1 enet 100001 1500 - - - - - 0 0
10 enet 100010 1500 - - - - - 0 0
20 enet 100020 1500 - - - - - 0 0
30 enet 100030 1500 - - - - - 0 0
1002 fddi 101002 1500 - - - - - 0 0
1003 tr 101003 1500 - - - - - 0 0
1004 fdnet 101004 1500 - - - ieee - 0 0
1005 trnet 101005 1500 - - - ibm - 0 0
gan' cac' port cua SW vao` VLAN:
Switch>ena
Switch# conf t
Switch(config)# int fa0/4
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 20
luc nay` em quay sang PC2 sau do'em ping den PC1 thi` Tho^ng con` PC3 thi` ko tho^ng
sau do' em gan fa0/7 cua SW vao` VLAN30
Switch(config)#int fa0/7
Switch(config-if)#switchport access vlan 30
luc nay` em quay sang PC1 sau do'em ping den PC2 thi` Tho^ng con` PC3 thi` ko tho^ng
sau do' em quay sang PC2 sau do'em ping den PC1 thi` Tho^ng con` PC3 thi` ko tho^ng
tiep theo em quay sang PC3 em ping den PC2,pc1 thi`de^u` Tho^ng
tiep theo em gan' port fa0/2 cua SW vao` VLAN10:
Switch(config)#int fa0/2
Switch(config-if)#switchport access vlan 10
Switch#sh vlan
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/1, Fa0/3, Fa0/5, Fa0/6
Fa0/8, Fa0/9, Fa0/10, Fa0/11
Fa0/12
10 VLAN10 active Fa0/2
20 VLAN20 active Fa0/4
30 VLAN30 active Fa0/7
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1 enet 100001 1500 - - - - - 0 0
10 enet 100010 1500 - - - - - 0 0
20 enet 100020 1500 - - - - - 0 0
30 enet 100030 1500 - - - - - 0 0
1002 fddi 101002 1500 - - - - - 0 0
1003 tr 101003 1500 - - - - - 0 0
1004 fdnet 101004 1500 - - - ieee - 0 0
1005 trnet 101005 1500 - - - ibm - 0 0
sau do' em quay sang pc1 em ping de^n' pc2 thi` tho^ng con` pc3 thi` kho^ng tho^ng
ro^i` em quay sang pc2 em ping de^n' pc1 thi` tho^ng con` pc3 thi` kho^ng tho^ng
em lai. quay sang pc3 em ping de^n' pc1 va` pc2 thi`de^u` tho^ng
luc' nay` em ko hieu tai sao pc3 khac' VLAN voi' PC1 va` pc2 ma` lai. tho^ng duoc.
pc1 khac' VLAN voi' PC2 sao khi ping lai. tho^ng duoc.
mình dùng Netsim.
liệu có phải do mình đặt IP của các VLAN cùng Subnet ko nhỉ?
mình thử đặt khác Subnet rồi mà vẫn ko được
pc1----SW----PC2
............|
...........pc3
SW: 2950
Pc1 gan' voi' fa0/2 cua SW IP 192.168.1.10 SM:255.255.255.0
PC2 gan' voi' fa0/4 cua SW IP 192.168.1.20 SM:255.255.255.0
pc3 gan voi' fa0/7 cua SW IP 192.168.1.30 SM:255.255.255.0
chua cau hinh VLAN:
3 may' ping voi' nhau de^u` tho^ng.
Switch>ena
Switch#sh run
!
Version 12.1
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname Switch
ip name-server 0.0.0.0
!
!
!
ip subnet-zero
!
!
!
!
!
!
spanning-tree extend system-id
!
!
!
!
interface FastEthernet0/1
bandwidth 100000
!
interface FastEthernet0/2
bandwidth 100000
!
interface FastEthernet0/3
bandwidth 100000
!
interface FastEthernet0/4
bandwidth 100000
!
interface FastEthernet0/5
bandwidth 100000
!
interface FastEthernet0/6
bandwidth 100000
!
interface FastEthernet0/7
bandwidth 100000
!
interface FastEthernet0/8
bandwidth 100000
!
interface FastEthernet0/9
bandwidth 100000
!
interface FastEthernet0/10
bandwidth 100000
!
interface FastEthernet0/11
bandwidth 100000
!
interface FastEthernet0/12
bandwidth 100000
!
vtp domain bigdomain
interface Vlan 1
no ip address
no ip route-cache
shutdown
!
ip classless
no ip http server
!
!
!
line con 0
transport input none
line aux 0
line vty 0 15
!
no scheduler allocate
end
ca^u' hinh` VLAN nhu sau:
Switch#vlan database
Switch(vlan)#vlan 10 name VLAN10
VLAN 10 added:
Name:VLAN10
Switch(vlan)#vlan 20 name VLAN20
VLAN 20 added:
Name:VLAN20
Switch(vlan)#vlan 30 name VLAN30
VLAN 30 added:
Name:VLAN30
Switch>sh vlan
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4
Fa0/5, Fa0/6, Fa0/7, Fa0/8
Fa0/9, Fa0/10, Fa0/11, Fa0/12
10 VLAN10 active
20 VLAN20 active
30 VLAN30 active
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1 enet 100001 1500 - - - - - 0 0
10 enet 100010 1500 - - - - - 0 0
20 enet 100020 1500 - - - - - 0 0
30 enet 100030 1500 - - - - - 0 0
1002 fddi 101002 1500 - - - - - 0 0
1003 tr 101003 1500 - - - - - 0 0
1004 fdnet 101004 1500 - - - ieee - 0 0
1005 trnet 101005 1500 - - - ibm - 0 0
gan' cac' port cua SW vao` VLAN:
Switch>ena
Switch# conf t
Switch(config)# int fa0/4
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 20
luc nay` em quay sang PC2 sau do'em ping den PC1 thi` Tho^ng con` PC3 thi` ko tho^ng
sau do' em gan fa0/7 cua SW vao` VLAN30
Switch(config)#int fa0/7
Switch(config-if)#switchport access vlan 30
luc nay` em quay sang PC1 sau do'em ping den PC2 thi` Tho^ng con` PC3 thi` ko tho^ng
sau do' em quay sang PC2 sau do'em ping den PC1 thi` Tho^ng con` PC3 thi` ko tho^ng
tiep theo em quay sang PC3 em ping den PC2,pc1 thi`de^u` Tho^ng
tiep theo em gan' port fa0/2 cua SW vao` VLAN10:
Switch(config)#int fa0/2
Switch(config-if)#switchport access vlan 10
Switch#sh vlan
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/1, Fa0/3, Fa0/5, Fa0/6
Fa0/8, Fa0/9, Fa0/10, Fa0/11
Fa0/12
10 VLAN10 active Fa0/2
20 VLAN20 active Fa0/4
30 VLAN30 active Fa0/7
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1 enet 100001 1500 - - - - - 0 0
10 enet 100010 1500 - - - - - 0 0
20 enet 100020 1500 - - - - - 0 0
30 enet 100030 1500 - - - - - 0 0
1002 fddi 101002 1500 - - - - - 0 0
1003 tr 101003 1500 - - - - - 0 0
1004 fdnet 101004 1500 - - - ieee - 0 0
1005 trnet 101005 1500 - - - ibm - 0 0
sau do' em quay sang pc1 em ping de^n' pc2 thi` tho^ng con` pc3 thi` kho^ng tho^ng
ro^i` em quay sang pc2 em ping de^n' pc1 thi` tho^ng con` pc3 thi` kho^ng tho^ng
em lai. quay sang pc3 em ping de^n' pc1 va` pc2 thi`de^u` tho^ng
luc' nay` em ko hieu tai sao pc3 khac' VLAN voi' PC1 va` pc2 ma` lai. tho^ng duoc.
pc1 khac' VLAN voi' PC2 sao khi ping lai. tho^ng duoc.
mình dùng Netsim.
liệu có phải do mình đặt IP của các VLAN cùng Subnet ko nhỉ?
mình thử đặt khác Subnet rồi mà vẫn ko được