交换机与生成树简单问题配置

  • 格式:doc
  • 大小:47.50 KB
  • 文档页数:5

1 交换机与生成树简单问题配置

S1(config)#

S1(config)#int fa0/1

S1(config-if)#description 1st connection to core switch 一些提示信息

S1(config-if)#int fa0/2

S1(config-if)#description 2nd connection to core switch

S1(config-if)#int fa0/8

S1(config-if)#description connection to IVR

S1(config-if)#int lo 3

S1(config-if)#description connection to HostA

S1(config-if)#int lo 4

S1(config-if)#description connection to Phone A

S1(config-if)#line con 0

S1(config-line)#password console

S1(config-line)#login

S1(config-line)#exit

S1(config)#line vty 0 4

S1(config-line)#password telnet

S1(config-line)#login

S1(config-line)#int vlan 1

S1(config-if)#ip add 192.168.10.17 255.255.255.240 交换机配地址在vlan 1 下

S1(config-if)#no shut

S1(config-if)#exit

S1(config)#banner motd #This is the S1 switch# 一些提示信息 2 S1(config)#exit

S1#copy run start

S2(config)#enable secret todd

S2(config)#int fa0/1

S2(config-if)#description 1st connection to core

S2(config-if)#int fa0/2

S2(config-if)#description 2nd connection to core

S2(config)#int lo 3

S2(config-if)#description connection to HostB

S2(config-if)#int lo 4

S2(config-if)#description connection to PhoneB

S2(config-if)#line con 0

S2(config-line)#password console

S2(config-line)#login

S2(config-line)#exit

S2(config)#line vty 0 4

S2(config-line)#password telnet

S2(config-line)#login

S2(config-line)#exit

S2(config)#int vlan 1

S2(config-if)#ip add 192.168.10.18 255.255.255.240

S2(config-if)#no shut

S2(config-if)#exit

S2(config)#banner motd #This is my S2 Switch#

S2(config)#exit

S2#copy run start

S2#ping 192.168.10.17

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 192.168.10.17, timeout is 2 seconds:

.!!!!

Success rate is 80 percent (4/5), round-trip min/avg/max = 28/40/76 ms

S2#

core(config)#enable secret todd

core(config)#int fa0/5

core(config-if)#description 1st connection to S2

core(config-if)#int fa0/6

core(config-if)#description 2nd connection to S2 3 core(config-if)#int fa0/7

core(config-if)#description 1st connection to S1

core(config-if)#int fa0/8

core(config-if)#description 2nd connection to S1

core(config-if)#lin con 0

core(config-line)#password console

core(config-line)#login

core(config-line)#exit

core(config)#line vty 0 4

core(config-line)#password telnet

core(config-line)#login

core(config-line)#exit

core(config)#int vlan 1

core(config-if)#ip add 192.168.10.19 255.255.255.240

core(config-if)#no shut

core(config-if)#exit

core(config)#banner motd #This is the core Switch #

core(config)#exit

core#copy run start

core#ping 192.168.10.17

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 192.168.10.17, timeout is 2 seconds:

.!!!!

Success rate is 80 percent (4/5), round-trip min/avg/max = 24/66/104 ms

core#ping 192.168.10.18

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 192.168.10.18, timeout is 2 seconds:

.!!!!

Success rate is 80 percent (4/5), round-trip min/avg/max = 20/59/104 ms

core#show ip arp

Protocol Address Age (min) Hardware Addr Type Interface

Internet 192.168.10.18 0 cc00.0290.0000 ARPA Vlan1

Internet 192.168.10.19 - cc00.0d3c.0000 ARPA Vlan1

Internet 192.168.10.17 0 cc00.08a0.0000 ARPA Vlan1

core#

core#config t

core(config)#ip default-gateway 192.168.10.30

core(config)#exit

core#

4

端口安全 3550

()#int range fa0/3 - 4

Switchport port-security maximun 1

Switchport port-security mac-address sticky

Switchport port-security violation shutdown

Exit

Portfast

()#int range fa0/3 – 4

Spanning-tree portfast

BPDU护卫

BPDU过滤器(防止PORTFAST产生的不良影响)

Spanning-tree bpduguard enable (接上面)

Spanning-tree bpdufilter enable

Spanning-tree mode rapid-pvst (开启快速生成树)用(show spanning-tree查看)

EtherChannel

S1上

()#int port-channel 1 开启隧道1

Int range fa0/1 – 2

Switchport trunk en dot1q

Switchport mode trunk 封装dot1q起trunk

Switchport nonegotiate 关闭自动协商

Channel-group 1 mode desirable 应用

Do show int fa0/1 etherchannel

在另一面的两个接口也同样处理