Tải bản đầy đủ (.docx) (21 trang)

Demo code XÂY DỰNG HỆ THỐNG HẠ TẦNG DOANH NGHIỆP

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (92.34 KB, 21 trang )

PHỤ LỤC CẤU HÌNH MƠ HÌNH HẠ TẦNG

1. Cấu hình bộ định tuyến Router S

Router>enable
Router#configure terminal
Router(config)#hostname S
S(config)#interface fastEthernet 0/0.10
S(config)#encapsulation dot1q 10
S(config-if)#ip address 192.168.1.1 255.255.255.0
S(config)#encapsulation dot1q 99
S(config)#interface fastEthernet 0/0.99
S(config-if)#ip address 192.168.99.1 255.255.255.0
S(config-if)#no shutdown
S(config-if)#
S(config-if)#exit
S(config)#interface l0
S(config-if)#ip address 1.1.1.1 255.255.255.255
S(config-if)#do show ip interface br
Interface
IP-Address OK? Method Status
FastEthernet0/0

unassigned

Protocol

YES manual up

up


FastEthernet0/0.10

192.168.1.1

YES manual up

up

FastEthernet0/0.99

192.168.99.2 YES manual up

up

FastEthernet0/1
NVI0
Loopback0

10.10.22.6
unassigned
1.1.1.1

YES NVRAM up
NO unset up
YES NVRAM up

up
up
up


S(config)#ip route 8.8.8.8 255.255.255.255 192.168.1.2
S(config)#ip route 2.2.2.2 255.255.255.255 192.168.1.2
S(config)#ip route 2.2.2.2 255.255.255.255 10.10.22.123
S(config)#ip route 2.2.2.2 255.255.255.255 192.168.1.2
S(config)#ip route 10.10.40.0 255.255.255.0 10.10.22.1
S(config)#ip route 192.168.1.4 255.255.255.252 192.168.1.2
S(config)# ip route 192.168.1.8 255.255.255.248 192.168.1.2
S(config)# ip route 192.168.1.16 255.255.255.252 192.168.1.2
S(config)# ip route 192.168.1.20 255.255.255.252 192.168.1.2 30
S#show ip route
SVTH: Vũ Anh Quân_1821051009_DCCTHT63B

1


Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
1.0.0.0/32 is subnetted, 1 subnets
C

1.1.1.1 is directly connected, Loopback0
2.0.0.0/32 is subnetted, 1 subnets

S


2.2.2.2 [1/0] via 192.168.1.2
[1/0] via 10.10.22.123
8.0.0.0/32 is subnetted, 1 subnets

S

8.8.8.8 [1/0] via 192.168.1.2

C 192.168.99.0/24 is directly connected, FastEthernet0/0.99
10.0.0.0/24 is subnetted, 2 subnets
C

10.10.22.0 is directly connected, FastEthernet0/1

S

10.10.40.0 [1/0] via 10.10.22.1
192.168.1.0/24 is variably subnetted, 5 subnets, 2 masks

S

192.168.1.8/29 [1/0] via 192.168.1.2

C

192.168.1.0/30 is directly connected, FastEthernet0/0.10

S


192.168.1.4/30 [1/0] via 192.168.1.2

S

192.168.1.16/30 [1/0] via 192.168.1.2

S

192.168.1.20/30 [30/0] via 192.168.1.2

S#ping 8.8.8.8
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 8.8.8.8, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 40/48/56 ms
S(config)#ip nat source static 192.168.1.2 10.10.22.100
S(config)#ip nat source static 192.168.1.5 10.10.22.111
S(config)#ip nat source static 192.168.1.10 10.10.22.112
SVTH: Vũ Anh Quân_1821051009_DCCTHT63B

2


S(config)#ip nat source static 192.168.1.11 10.10.22.113
S(config)#ip nat source static 192.168.1.18 10.10.22.114
S(config)#ip nat source static 192.168.2.1 10.10.22.115
S(config)#ip nat source static 192.168.99.1 10.10.22.116
S(config)#ip nat source static 192.168.99.5 10.10.22.117
S(config)#ip nat source static 192.168.99.6 10.10.22.118
S(config)#access-list 1 permit 192.168.1.2

S(config)#access-list 2 permit 192.168.1.5
S(config)#access-list 2 permit 19.168.1.5
S(config)#access-list 3 permit 192.168.1.10
S(config)#snmp-server community public RO
S(config)#snmp-server host 10.10.22.123 version 2c public
S(config)#snmp-server host 10.10.40.54 version 2c public

2. Cấu hình bộ định tuyến Router F6
Router>enable
Router#configure terminal
Router(config)#hostname F6
F6(config)#interface fastEthernet 0/0.10
F6(config-subif)#encapsulation dot1Q 10
F6(config-subif)#ip address 192.168.1.2 255.255.255.252
F6(config-subif)#exit
F6(config)#interface fastEthernet 0/0.20
F6(config-subif)#encapsulation dot1Q 20
F6(config-subif)#ip address 192.168.1.6 255.255.255.252
F6(config)#interface fastEthernet 0/0.99
F6(config-subif)#encapsulation dot1Q 99
F6(config-subif)#ip address 192.168.99.3 255.255.255.0
SVTH: Vũ Anh Quân_1821051009_DCCTHT63B

3


F6(config-subif)#exit
F6(config)#interface l0
F6(config-if)#ip address 2.2.2.2 255.255.255.255
F6(config-if)#exit

F6(config)#interface fastEthernet 0/0
F6(config-if)#no shutdown
F6(config-if)#do show ip interface brief
Interface
IP-Address OK? Method Status
FastEthernet0/0
unassigned YES NVRAM up
FastEthernet0/0.10
192.168.1.2 YES NVRAM up
FastEthernet0/0.20
192.168.1.6 YES NVRAM up
FastEthernet0/0.99
192.168.99.3 YES NVRAM up
Loopback0
2.2.2.2
YES NVRAM up

Protocol
up
up
up
up
up

F6(config)# ip route 0.0.0.0 0.0.0.0 192.168.1.1
F6(config)# ip route 1.1.1.1 255.255.255.255 192.168.1.1
F6(config)# ip route 8.8.8.8 255.255.255.255 192.168.1.5
F6(config)# ip route 10.10.22.0 255.255.255.0 192.168.1.1
F6(config)# ip route 192.168.1.8 255.255.255.248 192.168.1.5
F6(config)# ip route 192.168.1.16 255.255.255.252 192.168.1.5

F6(config)# ip route 192.168.1.20 255.255.255.252 192.168.1.20 30
F6(config)#do show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is 192.168.1.1 to network 0.0.0.0

S
C
S
C

1.0.0.0/32 is subnetted, 1 subnets
1.1.1.1 [1/0] via 192.168.1.1
2.0.0.0/32 is subnetted, 1 subnets
2.2.2.2 is directly connected, Loopback0
8.0.0.0/32 is subnetted, 1 subnets
8.8.8.8 [1/0] via 192.168.1.5
192.168.99.0/24 is directly connected, FastEthernet0/0.99
10.0.0.0/24 is subnetted, 1 subnets

SVTH: Vũ Anh Quân_1821051009_DCCTHT63B

4



S

10.10.22.0 [1/0] via 192.168.1.1
192.168.1.0/24 is variably subnetted, 4 subnets, 2 masks
S
192.168.1.8/29 [1/0] via 192.168.1.5
C
192.168.1.0/30 is directly connected, FastEthernet0/0.10
C
192.168.1.4/30 is directly connected, FastEthernet0/0.20
S
192.168.1.16/30 [1/0] via 192.168.1.5
S* 0.0.0.0/0 [1/0] via 192.168.1.1
F6(config)#snmp-server community punlic RO
F6(config)#snmp-server host 10.10.22.123 public

SVTH: Vũ Anh Quân_1821051009_DCCTHT63B

5


1. Cấu hình bộ định tuyến Router F2
Router>enable
Router#configure terminal
Router(config)#hostname F2
F2(config)#interface fastEthernet 0/0
F2(config-if)#ip address 192.168.1.9 255.255.255.248
F2(config-if)#no shut
F2(config-if)#exit
F2(config)#interface fastEthernet 0/1

F2(config-if)#ip address 192.168.1.5 255.255.255.252
F2(config-if)#no shut
F2(config-if)#do show ip interface br
Interface
IP-Address OK?
Method

Status

Protocol
FastEthernet0/0

192.168.1.9

YES

manual

up

up

FastEthernet0/1

192.168.1.5

YES

manual


up

up

F2(config)# ip route 0.0.0.0 0.0.0.0 192.168.1.1
F2(config)# ip route 1.1.1.1 255.255.255.255 192.168.1.6
F2(config)# ip route 2.2.2.2 255.255.255.255 192.168.1.6
F2(config)# ip route 8.8.8.8 255.255.255.255 192.168.1.10
F2(config)# ip route 8.8.8.8 255.255.255.255 192.168.1.11 30
F2(config)# ip route 10.10.22.0 255.255.255.0 192.168.1.1
F2(config)# ip route 192.16.1.16 255.255.255.252 192.168.1.10
F2(config)# ip route 192.16.1.20 255.255.255.252 192.168.1.11 30
F2(config)# ip route 192.168.1.0 255.255.255.252 192.168.1.6
F2(config)# ip route 192.168.1.16 255.255.255.252 192.168.1.10
F2(config)# ip route 192.168.1.20 255.255.255.252 192.168.1.11 30
F2(config)#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is 192.168.1.1 to network 0.0.0.0
SVTH: Vũ Anh Quân_1821051009_DCCTHT63B

6


1.0.0.0/32 is subnetted, 1 subnets

S

1.1.1.1 [1/0] via 192.168.1.6
2.0.0.0/32 is subnetted, 1 subnets

S

2.2.2.2 [1/0] via 192.168.1.6
8.0.0.0/32 is subnetted, 1 subnets

S

8.8.8.8 [1/0] via 192.168.1.10
10.0.0.0/24 is subnetted, 1 subnets

S

10.10.22.0 [1/0] via 192.168.1.1
192.16.1.0/30 is subnetted, 2 subnets

S

192.16.1.16 [1/0] via 192.168.1.10

S

192.16.1.20 [30/0] via 192.168.1.11
192.168.1.0/24 is variably subnetted, 5 subnets, 2 masks

C


192.168.1.8/29 is directly connected, FastEthernet0/0

S

192.168.1.0/30 [1/0] via 192.168.1.6

C

192.168.1.4/30 is directly connected, FastEthernet0/1

S

192.168.1.16/30 [1/0] via 192.168.1.10

S

192.168.1.20/30 [30/0] via 192.168.1.11

S* 0.0.0.0/0 [1/0] via 192.168.1.1
F2(config)#snmp-server community public RO
F2(config)#snmp-server host 10.10.22.123 public

SVTH: Vũ Anh Quân_1821051009_DCCTHT63B

7


2. Cấu hình bộ định tuyến Router W1
Router>

Router>enable
Router#configure terminal
Router(config)#hostname W1
W1(config)#interface fastEthernet 0/1
W1(config-if)#ip address 192.168.1.10 255.255.255.248
W1(config-if)#no shut
W1(config-if)#
W1(config-if)#exit
W1(config)#interface f0/0
W1(config-if)#ip address 192.168.1.17 255.255.255.252
W1(config-if)#no shut
W1(config-if)#
W1(config-if)#do show ip int br
Interface
IP-Address

OK?

Method

Status

Protocol
FastEthernet0/0

172.16.1.17

YES

manual


up

up

FastEthernet0/1

172.16.1.10

YES

manual

up

up

W1(config)# ip route 0.0.0.0 0.0.0.0 192.168.1.1
W1(config)# ip route 1.1.1.1 255.255.255.255 192.168.1.9
W1(config)# ip route 2.2.2.2 255.255.255.255 192.168.1.9
W1(config)# ip route 8.8.8.8 255.255.255.255 192.168.1.18
W1(config)# ip route 10.10.22.0 255.255.255.0 192.168.1.1
W1(config)# ip route 192.168.1.0 255.255.255.252 192.168.1.9
W1(config)# ip route 192.168.1.4 255.255.255.252 192.168.1.9
W1(config)#do show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2

ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
SVTH: Vũ Anh Quân_1821051009_DCCTHT63B

8


Gateway of last resort is 192.168.1.1 to network 0.0.0.0
1.0.0.0/32 is subnetted, 1 subnets
S

1.1.1.1 [1/0] via 192.168.1.9
2.0.0.0/32 is subnetted, 1 subnets

S

2.2.2.2 [1/0] via 192.168.1.9
8.0.0.0/32 is subnetted, 1 subnets

S

8.8.8.8 [1/0] via 192.168.1.18
10.0.0.0/24 is subnetted, 1 subnets

S

10.10.22.0 [1/0] via 192.168.1.1
192.168.1.0/24 is variably subnetted, 4 subnets, 2 masks

C


192.168.1.8/29 is directly connected, FastEthernet0/1

S

192.168.1.0/30 [1/0] via 192.168.1.9

S

192.168.1.4/30 [1/0] via 192.168.1.9

C

192.168.1.16/30 is directly connected, FastEthernet0/0

S* 0.0.0.0/0 [1/0] via 192.168.1.1
W1(config)#snmp-server community public RO R0
W1(config)#snmp-server host 10.10.22.123 public

3. Cấu hình bộ định tuyến Router W2
Router>
Router>enable
Router#configure terminal
Router(config)#hostname W2
W2(config)#interface fastEthernet 0/1
SVTH: Vũ Anh Quân_1821051009_DCCTHT63B

9



W2(config-if)#ip address 192.168.1.11 255.255.255.248
W2(config-if)#no shut

W2(config-if)#exit
W2(config)#interface fastEthernet 0/0
W2(config-if)#ip add 192.168.1.21 255.255.255.252
W2(config-if)#no shutdow
W2(config-if)#do show ip interface br
Interface
IP-Address OK?

Method

Status

Protocol
FastEthernet0/0

192.168.1.21

YES

manual

up

192.168.1.11

YES


manual

up

up
FastEthernet0/1
up
W2(config)# ip route 0.0.0.0 0.0.0.0 192.168.1.1
W2(config)# ip route 1.1.1.1 255.255.255.255 192.168.1.9 30
W2(config)# ip route 2.2.2.2 255.255.255.255 192.168.1.9 30
W2(config)# ip route 8.8.8.8 255.255.255.255 192.168.1.22 30
W2(config)# ip route 10.10.22.0 255.255.255.0 192.168.1.1
W2(config)# ip route 192.168.1.0 255.255.255.252 192.168.1.9 30
W2(config)#ip route 192.168.1.4 255.255.255.252 192.168.1.9 30
W2(config)#do show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is 192.168.1.1 to network 0.0.0.0
1.0.0.0/32 is subnetted, 1 subnets
S

1.1.1.1 [30/0] via 192.168.1.9
2.0.0.0/32 is subnetted, 1 subnets

SVTH: Vũ Anh Quân_1821051009_DCCTHT63B


10


S

2.2.2.2 [30/0] via 192.168.1.9
8.0.0.0/32 is subnetted, 1 subnets

S

8.8.8.8 [30/0] via 192.168.1.22
10.0.0.0/24 is subnetted, 1 subnets

S

10.10.22.0 [1/0] via 192.168.1.1
192.168.1.0/24 is variably subnetted, 4 subnets, 2 masks

C

192.168.1.8/29 is directly connected, FastEthernet0/1

S

192.168.1.0/30 [30/0] via 192.168.1.9

S

192.168.1.4/30 [30/0] via 192.168.1.9


C

192.168.1.20/30 is directly connected, FastEthernet0/0

S* 0.0.0.0/0 [1/0] via 192.168.1.1
W2(config)#snmp-server community public RO R0
W2(config)#snmp-server host 10.10.22.123 public

SVTH: Vũ Anh Quân_1821051009_DCCTHT63B

11


4. Cấu hình bộ định tuyến Router W
Router>
Router>enable
Router#configure terminal
Router(config)#hostname W
W(config)#interface fastEthernet 0/0
W(config-if)#ip address 192.168.1.18 255.255.255.252
W(config-if)#no shut
W(config-if)#
W(config-if)#exit
W(config)#interface fastEthernet 0/1
W(config-if)#ip address 192.168.1.22 255.255.255.252
W(config-if)#no shutdown
W(config-if)#
W(config-if)#exit
W(config)#interface l0

W(config)#int
W(config)#interface l0
W(config-if)#ip address 8.8.8.8 255.255.255.255
W(config-if)#do show
W(config-if)#do show ip interface br
Interface
IP-Address OK?
Method

Status

Protocol
FastEthernet0/0

192.168.1.18

YES

FastEthernet0/1

192.168.1.22

YES

Loopback0

8.8.8.8

manual


up

up
YES

manual

up

up

manual

up

up

W(config)# ip route 0.0.0.0 0.0.0.0 192.168.1.1
W(config)# ip route 1.1.1.1 255.255.255.255 192.168.1.17
W(config)# ip route 1.1.1.1 255.255.255.255 192.168.1.21 30
W(config)# ip route 2.2.2.2 255.255.255.255 192.168.1.17
W(config)# ip route 2.2.2.2 255.255.255.255 192.168.1.21 30
SVTH: Vũ Anh Quân_1821051009_DCCTHT63B

12


W(config)# ip route 10.10.22.0 255.255.255.0 192.168.1.1
W(config)# ip route 192.168.1.0 255.255.255.252 192.168.1.17
W(config)# ip route 192.168.1.0 255.255.255.252 192.168.1.21 30

W(config)# ip route 192.168.1.4 255.255.255.252 192.168.1.17
W(config)# ip route 192.168.1.4 255.255.255.252 192.168.1.21 30
W(config)# ip route 192.168.1.8 255.255.255.252 192.168.1.17
W(config)# ip route 192.168.1.8 255.255.255.252 192.168.1.21 30
W(config)#do show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is 192.168.1.1 to network 0.0.0.0
1.0.0.0/32 is subnetted, 1 subnets
S

1.1.1.1 [1/0] via 192.168.1.17
2.0.0.0/32 is subnetted, 1 subnets

S

2.2.2.2 [1/0] via 192.168.1.17
8.0.0.0/32 is subnetted, 1 subnets

C

8.8.8.8 is directly connected, Loopback0
10.0.0.0/24 is subnetted, 1 subnets

S


10.10.22.0 [1/0] via 192.168.1.1
192.168.1.0/30 is subnetted, 5 subnets

S

192.168.1.8 [1/0] via 192.168.1.17

S

192.168.1.0 [1/0] via 192.168.1.17

S

192.168.1.4 [1/0] via 192.168.1.17

C

192.168.1.16 is directly connected, FastEthernet0/0

C

192.168.1.20 is directly connected, FastEthernet0/1

S* 0.0.0.0/0 [1/0] via 192.168.1.1
W#ping 1.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
SVTH: Vũ Anh Quân_1821051009_DCCTHT63B


13


....!
Success rate is 20 percent (1/5), round-trip min/avg/max = 44/44/44 ms
W(config)#snmp-server community public RO R0
W(config)#snmp-server host 10.10.22.123 public

SVTH: Vũ Anh Quân_1821051009_DCCTHT63B

14


5. Cấu hình bộ chuyển mạch SW1
Switch>
Switch>enable
Switch#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname SW1
SW1(config)#interface e0/1
SW1(config-if)#switchport trunk encapsulation dot1q
SW1(config-if)#switchport mode trunk
SW1(config)#vlan 10
SW1(config-if)#interface e0/0
SW1(config-if)#switchport trunk encapsulation dot1q
SW1(config-if)#switchport mode trunk
SW1(config-if)#do sh vlan
VLAN
Name
Status


Ports

--------

--------------------------

------------

-----------------------------

1

default

active

Et0/2, Et0/3

10

VLAN0010

active

1002

fddi-default

act/unsup


1003

token-ring-default

act/unsup

1004

fddinet-default

act/unsup

1005

trnet-default

act/unsup

VLAN Type SAID

MTU Parent RingNo BridgeNo Stp BrdgMode Trans1

Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ -----1 enet 100001

1500 -

-


-

- -

0

0

10 enet 100010

1500 -

-

-

- -

0

0

1002 fddi 101002
1003 tr 101003

1500 1500 -

-

-


-

-

-

-

- -

0

0

0

0

1004 fdnet 101004

1500 -

-

-

ieee -

0


0

1005 trnet 101005

1500 -

-

-

ibm -

0

0

Primary Secondary Type

Ports

------- --------- ----------------- -----------------------------------------SVTH: Vũ Anh Quân_1821051009_DCCTHT63B

15


SW1#show interface trunk
Port
Mode
Encapsulation Status


Native vlan

Et0/0

on

802.1q

trunking

1

Et0/1

on

802.1q

trunking

1

Port

Vlans allowed on trunk

Et0/0

1-4094


Et0/1

1-4094

Port

Vlans allowed and active in management domain

Et0/0

1,10,99

Et0/1

1,10,99

Port

Vlans in spanning tree forwarding state and not pruned

Et0/0

1,10,99

Et0/1

1,10,99

SW1(config)#ip route 0.0.0.0 0.0.0.0 192.168.99.2

SW1(config)#ip default-gateway 192.168.99.2
SW1(config)#snmp-server community public RO R0
SW1(config)#snmp-server host 10.10.22.123 public

6. Cấu hình bộ chuyển mạch SW2
Switch>
Switch>enable
Switch#configure terminal
Switch(config)#hostname SW2
SW2(config)#vlan 10
SVTH: Vũ Anh Quân_1821051009_DCCTHT63B

16


SW2(config-vlan)#exit
SW2(config)#interface e0/0
SW2(config-if)#switchport access vlan 20
SW2(config-if)#exit
SW2(config)#interface e0/1
SW2(config-if)#switchport trunk encapsulation dot1q
SW2(config-if)#switchport mode trunk
SW2(config-if)#exit
SW2(config)#interface e0/2
SW2(config-if)#switchport trunk encapsulation dot1q
SW2(config-if)#switchport mode trunk
SW2(config-if)# do show vlan
VLAN
Name
Status

Ports
---------

----------------

----------

-----------------

1

default

active

Et0/3

10

VLAN0010

active

20

VLAN0020

active

1002


fddi-default

act/unsup

1003

token-ring-default

act/unsup

1004

fddinet-default

act/unsup

1005

trnet-default

VLAN Type SAID

Et0/0

act/unsup

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

1002 fddi 101002
1003 tr 101003

1500 1500 -

-

-

-

-

- -

0

0


0

0

1004 fdnet 101004

1500 -

-

-

ieee -

0

0

1005 trnet 101005

1500 -

-

-

ibm -

0


0

Remote SPAN VLANs
----------------------------------------------------------------------------SVTH: Vũ Anh Quân_1821051009_DCCTHT63B

17


Primary Secondary Type

Ports

------- --------- ----------------- -----------------------------------------SW2#sh interface trunk
Port
Mode
Encapsulation

Status

Et0/1

on

802.1q

trunking

1


Et0/2

on

802.1q

trunking

1

Port

Vlans allowed on trunk

Et0/1

1-4094

Et0/2

1-4094

Port

Vlans allowed and active in management domain

Et0/1

1,10,20


Et0/2

1,10,20

Port

Vlans in spanning tree forwarding state and not pruned

Et0/1

1,10,20

Et0/2

1,10,20

Native vlan

SW2(config)#ip default-gateway 192.168.99.2
SW2(config)#ip route 0.0.0.0 0.0.0.0 192.168.99.2
SW2(config)#snmp-server community public R0
SW2(config)#snmp-server host 10.10.22.123 public

SVTH: Vũ Anh Quân_1821051009_DCCTHT63B

18


7. Cấu hình bộ chuyển mạch SW3
Switch>

Switch>enable
Switch#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname SW3
SW3(config)#vlan 10
SW3(config-vlan)#exit
SW3(config)#vlan 20
SW3(config-vlan)#exit
SW3(config)#vlan 30
SW3(config-vlan)#do show vlan
VLAN
Name

Status

---------

-----------------------

----------

1

default

active

Ports
---------------------------Et0/0, Et0/1, Et0/2, Et0/3


SVTH: Vũ Anh Quân_1821051009_DCCTHT63B

19


10

VLAN0010

active

20

VLAN0020

active

30

VLAN0030

active

1002

fddi-default

act/unsup

1003


token-ring-default

act/unsup

1004

fddinet-default

act/unsup

1005

trnet-default

act/unsup

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
1003 tr 101003

1500 1500 -

-

-

-

-


-

-

- -

0

0

0

0

1004 fdnet 101004

1500 -

-

-

ieee -

0

0

1005 trnet 101005


1500 -

-

-

ibm -

0

0

Primary Secondary Type

Ports

------- --------- ----------------- -----------------------------------------SW3(config)#ip route 0.0.0.0 0.0.0.0 192.168.99.2
SW3(config)#snmp-server community public RO
SW3(config)#snmp-server host 10.10.22.123 public

SVTH: Vũ Anh Quân_1821051009_DCCTHT63B

20



×