C u hình switch c b n ơ ả ấ
Mô tả
ấ
ệ ố ơ ả ụ ầ ớ ặ ự ệ ồ
ể ấ ấ
ế ố
ử ụ
C u hình các thông s c b n cho Catalys Switch v i giao di n ệ dòng l nh CLI. Các tác v c n th c hi n bao g m đ t tên cho switch, c u hình các interface vlan, c u hình đ telnet vào switch….Dùng máy tr m k t n i v i switch qua k t n i console, ạ ế ố ớ ng tác ng giao di n t i dùng s d ng trình HyperTerminal. ườ ệ ươ Đây là m t công c đu c MS Windows h tr . ỗ ợ ộ ụ ợ
Th c hi n ự ệ
ệ ở ộ
ệ ở ộ ồ ủ ố
ẽ ượ ỏ ế ố
ộ ườ ả ờ ụ
1. Kh i đ ng ngu n c a switch. Trên giao di n Hyper Terminal hi n ra các thông s kh i t o trong quá trình kh i đ ng Switch. ở ạ % Please answer 'yes' or 'no'. Would you like to enter the initial configuration dialog? [yes/no]: no Press RETURN to get started! 00:04:13: %LINK-5-CHANGED: Interface Vlan1, changed state to administratively down 00:04:14: %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to down ạ ể ấ c h i n u mu n vào các h p tho i đ c u Ng ườ hình t ố i dùng là mu n i NO (vì m c đích c a ng ủ vào ch đ CLI (command line interface). i dùng s đ đ ng, tr l ự ộ ế ộ
2. Vào enable mode xem c u hình m c đ nh c a switch ấ ặ ị ủ
Switch>enable
Switch#show running-config Building configuration... Current configuration : 1473 bytes ! version 12.1 ! hostname Switch ! ip subnet-zero ! spanning-tree mode pvst spanning-tree extend system-id ! interface FastEthernet0/1 no ip address ! interface FastEthernet0/2 no ip address ! interface FastEthernet0/3 no ip address ! interface FastEthernet0/4 no ip address ! interface FastEthernet0/5 no ip address ! interface FastEthernet0/6 no ip address ! interface FastEthernet0/7 no ip address ! interface FastEthernet0/8
no ip address ! interface FastEthernet0/9 no ip address ! interface FastEthernet0/10 no ip address ! interface FastEthernet0/11 no ip address ! interface FastEthernet0/12 no ip address ! interface GigabitEthernet0/1 no ip address ! interface GigabitEthernet0/2 no ip address ! interface Vlan1 no ip address shutdown ! ip classless ip http server ! line con 0 line vty 5 15 ! end
ế ậ ư ố
t l p các thông s cho switch nh hostname, enable 3. Thi password, console password và virtual terminal password. Các lo iạ t ch th password s d ng có phân bi ng và ch hoa. Do đó ữ ườ ử ụ ữ ệ
s d ng ch vi t hoa khác ữ ế ế
ng. Ví d Cisco khác v i cisco. ng i dùng c n phân bi ầ ườ v i ch viêt th ữ ớ ườ t các ký t ụ ự ử ụ ớ
Switch#config terminal Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#hostname Vnpro Vnpro(config)#enable password cisco Vnpro(config)#enable secret class Vnpro(config)#line console 0 Vnpro(config-line)#password console Vnpro(config-line)#login Vnpro(config-line)#^Z
ỗ ợ
ể
ỗ ợ ề ể
ầ ấ Switch h tr các Virtual Line dùng cho các phiên telnet. C n c u hình password cho các line này m i có th telnet vào Switch (trình ớ t c u hình h tr telnet s trình bày sau). Đ xem thông tin v ẽ ự ấ các Virtual Line trên Switch: dùng l nh “show line”. ệ
Vnpro#show line Tty Typ Tx/Rx A Modem Roty AccO AccI Uses Noise Overruns Int * 0 CTY - - - - - 0 0 0/0 - 1 VTY - - - - - 0 0 0/0 - 2 VTY - - - - - 0 0 0/0 - 3 VTY - - - - - 0 0 0/0 - 4 VTY - - - - - 0 0 0/0 - 5 VTY - - - - - 0 0 0/0 - 6 VTY - - - - - 0 0 0/0 - 7 VTY - - - - - 0 0 0/0 - 8 VTY - - - - - 0 0 0/0 - 9 VTY - - - - - 0 0 0/0 - 10 VTY - - - - - 0 0 0/0 - 11 VTY - - - - - 0 0 0/0 - 12 VTY - - - - - 0 0 0/0 - 13 VTY - - - - - 0 0 0/0 -
14 VTY - - - - - 0 0 0/0 - 15 VTY - - - - - 0 0 0/0 - 16 VTY - - - - - 0 0 0/0 -
ấ
C u hình password cho các line vty Vnpro#config terminal Enter configuration commands, one per line. End with CNTL/Z. Vnpro(config)#line vty 0 4 Vnpro(config-line)#password cisco Vnpro(config-line)#login
ấ ế ị ườ ệ
t b Cisco, m i dòng l nh do ng ấ ệ ố ệ ố ạ ố ớ ậ ậ
ổ ộ
t. i dùng gõ C u hình trên thi ỗ ẽ ậ ứ vào. Sau khi nh n phím “enter” c u hình h th ng s l p t c ấ c khi thay thay đ i. Vì v y, đ i v i các h th ng m ng th t, tr ướ đ i m t thông s nào đó c a thi ư ạ ấ t b , c n ph i sao l u l i c u ả ủ ố ổ hình ban đ u đ có th khôi ph c l ể ế ị ầ ụ ạ i khi c n thi ầ ể ế ầ
c 4: c u hình Vlan.
ấ ấ ặ ị ướ ế
B Ki m tra c u hình Vlan m c đ nh trên Switch Vnpro#show 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 Fa0/13, Fa0/14, Fa0/15, Fa0/16 Fa0/17, Fa0/18, Fa0/19, Fa0/20 Fa0/21, Fa0/22, Fa0/23, Fa0/24 Gi0/1, Gi0/2 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 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 Remote SPAN VLANs ------------------------------------------------------------------------------ Primary Secondary Type Ports ------- --------- ----------------- ------------------------------------------ ằ t c các port đ u n m M c đ nh trên Switch ch có Vlan 1 v i t trong Vlan này, Vlan 1002 dành riêng cho FDDI, Vlan 1003 dành riêng cho TOKEN-RING…Có hai cách t o thêm Vlan Cách 1:Thao tác trên Vlan database Vnpro#vlan database Vnpro(vlan)#vtp domain Chuyenviet Changing VTP domain name from NULL to Chuyenviet Vnpro(vlan)#vtp server Setting device to VTP SERVER mode. Vnpro(vlan)#vlan 10 name Admin VLAN 10 added: Name: Admin Vnpro(vlan)#vlan 20 name User VLAN 20 added: Name: User Vnpro(vlan)#apply APPLY completed. Vnpro(vlan)#exit APPLY completed. Exiting.... Cách 2: T ong tác tr c ti p đ n Vlan c n t o ra ế ự ế Vnpro(config)#interface vlan 10 Vnpro(config-if)#exit Vnpro(config)# Vnpro(config)#interface vlan 20
c sau: ệ ể ự ướ
ầ ụ
ể
ấ
ấ ậ ỉ
ụ ụ ể
ậ ứ ỉ ạ ụ
Vnpro(config-if)#exit Vnpro(config)# Đ gán các port vào các Vlan, th c hi n các b Ví d ta c n gán các port fastethernet 2 vào Vlan 10, port fastetehnet 3 vào Vlan 20 Vnpro(config)#interface fastethernet0/2 Vnpro(config-if-range)#switchport access vlan 10 Vnpro(config-if-range)#exit Vnpro(config)#interface fastethernet0/3 Vnpro(config-if-range)#switchport access vlan 20 Vnpro(config-if-range)#exit Ki m tra l i c u hình Vlan ạ ấ Vnpro#show vlan VLAN Name Status Ports ---- -------------------------------- --------- ------------------------------- 1 default active Fa0/1, Fa0/4, Fa0/5, Fa0/6 Fa0/7, Fa0/8, Fa0/9, Fa0/10 Fa0/11, Fa0/12, Fa0/13, Fa0/14 Fa0/15, Fa0/16, Fa0/17, Fa0/18 Fa0/19, Fa0/20, Fa0/21, Fa0/22 Fa0/23, Fa0/24, Gi0/1, Gi0/2 10 Admin active Fa0/2 20 User active Fa0/3 1002 fddi-default active 1003 token-ring-default active 1004 fddinet-default active 1005 trnet-default active C u hình IP cho interface Vlan: các interface Vlan đ c c u hình ượ ấ IP ch mang tính ch t lu n lý. IP này ph c v cho vi c qu n lý, ả ệ ừ xa đ a ch IP lu n lý này còn có th dùng đ telnet vào Switch t ể ị và ch y các ng d ng SNMP. Vnpro#config terminal Enter configuration commands, one per line. End with CNTL/Z. Vnpro(config)#interface vlan 10 Vnpro(config-if)#ip address 10.0.0.1 255.255.255.0
ệ ằ
c dùng đ ỉ ủ ượ ị ị ỉ ể
Vnpro(config-if)#no shutdown Vnpro(config-if)#^Z 00:14:43: %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan10, changed state to down 00:14:43: %SYS-5-CONFIG_I: Configured from console by console L u c u hình vào NVRAM ư ấ Vnpro#copy running-config startup-config Destination filename [startup-config]? Building configuration... [OK] C n chú ý gán default-gateway cho switch b ng câu l nh ầ VnPro#ip default-gateway 10.0.0.100 Đ a ch 10.0.0.100 có th dùng là đ a ch c a PC đ ể telnet vào switch.