Trunk实验配置详解

思科认证:思科交换机trunk配置实例详解

网络公司-思科交换机trunk配置实例

背景:如图,东湖机房-钻探机房-数字机房之间只有一根光纤(2芯),而这三个地方都要使用到两个不同的网络即10.63.57.0和192.168.192.0

东湖机房有一台C3550,钻探机房C3750,数字机房C3750

要求:在现有条件下,实现三地相同网段的网络互联。

配置:

东湖机房C3550

vlan 57

name lan

vlan 192

name wan

exit

interface range fastEthernet 0/2 - 12

switchport mode access

spanning-tree portfast

switchport access vlan 57

exit

interface range fastEthernet 0/13 - 24

switchport mode access

spanning-tree portfast

switchport access vlan 192

exit

int fa0/1

switchport trunk encapsulation dot1q

switchport mode trunk

switchport trunk allowed vlan 57

switchport trunk allowed vlan add 192

钻探机房C2960

vlan 57

name lan

vlan 192

name wan

exit

interface range gig1/0/2 - 12

switchport mode access

spanning-tree portfast

switchport access vlan 57

exit

interface range gig1/0/13 - 24

switchport mode access

spanning-tree portfast

switchport access vlan 192

exit

int fa0/1

switchport trunk encapsulation dot1q //c2960交换机不需要此条命令

switchport mode trunk

switchport trunk allowed vlan 57

switchport trunk allowed vlan add 192

数字机房C3750

vlan 3

name movie

vlan 987

name meeting

vlan 57

name lan

vlan 192

name wan

exit

interface range gig1/0/2 - 8

switchport mode access

spanning-tree portfast

switchport access vlan 2

exit

interface range gig1/0/9 - 16

switchport mode access

spanning-tree portfast

switchport access vlan 57

exit

interface range gig1/0/17 - 22

switchport mode access

spanning-tree portfast

switchport access vlan 192

exit

interface range gig1/0/22 - 24

switchport mode access

spanning-tree portfast

switchport access vlan 987

exit

int gig1/0/1

switchport trunk encapsulation dot1q

switchport mode trunk

switchport trunk allowed vlan 57

switchport trunk allowed vlan add 192

switchport trunk allowed vlan add 987

详细配置清单:

东湖机房C3550

c3550#sh run

Building configuration…

01:41:44: %SYS-5-CONFIG_I: Configured from console by console

Current configuration : 5040 bytes

version 12.1

no service pad

service timestamps debug uptime

service timestamps log uptime

no service password-encryption

hostname c3550

enable secret 5 $1$12.H$ImTHhROtL/FF9MG7O.kyL0

enable password ytv2003

ip subnet-zero

spanning-tree mode pvst

spanning-tree extend system-id

interface FastEthernet0/1

switchport trunk encapsulation dot1q

switchport trunk allowed vlan 57,192

switchport mode trunk

rmon collection stats 1 owner “root@ciscoworks [1066772640421]”

interface FastEthernet0/2

switchport access vlan 57

switchport mode access

rmon collection stats 2 owner “root@ciscoworks [1066772640390]”

spanning-tree portfast

interface FastEthernet0/3

switchport access vlan 57

switchport mode access

rmon collection stats 3 owner “root@ciscoworks [1066772640359]”

spanning-tree portfast

interface FastEthernet0/4

switchport access vlan 57

switchport mode access

rmon collection stats 4 owner “root@ciscoworks [1066772640328]”

spanning-tree portfast

interface FastEthernet0/5

switchport access vlan 57

switchport mode access

rmon collection stats 5 owner “root@ciscoworks [1066772640296]”

spanning-tree portfast

interface FastEthernet0/6

switchport access vlan 57

switchport mode access

rmon collection stats 6 owner “root@ciscoworks [1066772640265]”

spanning-tree portfast

interface FastEthernet0/7

switchport access vlan 57

switchport mode access

rmon collection stats 7 owner “root@ciscoworks [1066772640218]”

spanning-tree portfast

interface FastEthernet0/8

switchport access vlan 57

switchport mode access

rmon collection stats 8 owner “root@ciscoworks [1066772640171]”

spanning-tree portfast

interface FastEthernet0/9

switchport access vlan 57

switchport mode access

rmon collection stats 9 owner “root@ciscoworks [1066772640125]”

spanning-tree portfast

interface FastEthernet0/10

switchport access vlan 57

switchport mode access

rmon collection stats 10 owner “root@ciscoworks [1066772640093]”

spanning-tree portfast

interface FastEthernet0/11

switchport access vlan 57

switchport mode access

rmon collection stats 11 owner “root@ciscoworks [1066772640062]”

spanning-tree portfast

interface FastEthernet0/12

switchport access vlan 57

switchport mode access

rmon collection stats 12 owner “root@ciscoworks [1066772640031]”

spanning-tree portfast

interface FastEthernet0/13

switchport access vlan 192

switchport mode access

rmon collection stats 13 owner “root@ciscoworks [1066772640000]”

spanning-tree portfast

interface FastEthernet0/14

switchport access vlan 192

switchport mode access

rmon collection stats 14 owner “root@ciscoworks [1066772639968]”

spanning-tree portfast

interface FastEthernet0/15

switchport access vlan 192

switchport mode access

rmon collection stats 15 owner “root@ciscoworks [1066772639937]”

spanning-tree portfast

interface FastEthernet0/16

switchport access vlan 192

switchport mode access

rmon collection stats 16 owner “root@ciscoworks [1066772639890]”

spanning-tree portfast

interface FastEthernet0/17

switchport access vlan 192

switchport mode access

rmon collection stats 17 owner “root@ciscoworks [1066772639859]”

spanning-tree portfast

interface FastEthernet0/18

switchport access vlan 192

switchport mode access

rmon collection stats 18 owner “root@ciscoworks [1066772639828]”

spanning-tree portfast

interface FastEthernet0/19

switchport access vlan 192

switchport mode access

rmon collection stats 19 owner “root@ciscoworks [1066772639796]”

spanning-tree portfast

interface FastEthernet0/20

switchport access vlan 192

switchport mode access

rmon collection stats 20 owner “root@ciscoworks [1066772639750]”

spanning-tree portfast

interface FastEthernet0/21

switchport access vlan 192

switchport mode access

rmon collection stats 21 owner “root@ciscoworks [1066772639718]”

spanning-tree portfast

interface FastEthernet0/22

switchport access vlan 192

switchport mode access

rmon collection stats 22 owner “root@ciscoworks [1066772639687]”

spanning-tree portfast

interface FastEthernet0/23

switchport access vlan 192

switchport mode access

rmon collection stats 23 owner “root@ciscoworks [1066772639656]”

spanning-tree portfast

interface FastEthernet0/24

switchport access vlan 192

switchport mode access

rmon collection stats 24 owner “root@ciscoworks [1066772639625]”

spanning-tree portfast

interface GigabitEthernet0/1

switchport mode dynamic desirable

rmon collection stats 25 owner “root@ciscoworks [1066772639578]”

interface GigabitEthernet0/2

switchport mode dynamic desirable

rmon collection stats 26 owner “root@ciscoworks [1066772639453]”

interface Vlan1

no ip address

no ip route-cache

no ip mroute-cache

interface Vlan57

ip address 10.63.57.11 255.255.255.0

ip classless

ip http server

snmp-server community public RW

snmp-server location public

snmp-server host 10.65.160.5 rw

line con 0

password datapart

login

line vty 0 4

password datapart

login

line vty 5 15

password datapart

login

end

钻探机房C2950

wlgs#sh run

Building configuration…

Current configuration : 3233 bytes

version 12.2

no service pad

service timestamps debug uptime

service timestamps log uptime

no service password-encryption

hostname wlgs

enable secret 5 $1$t37f$JjNloQpCT20yvt.lf8VmD.

enable password datapart

no aaa new-model

system mtu routing 1500

ip subnet-zero

cluster enable datapart 0

no file verify auto

spanning-tree mode pvst

spanning-tree extend system-id

vlan internal allocation policy ascending

interface FastEthernet0/1

switchport trunk allowed vlan 57,192

switchport mode trunk

interface FastEthernet0/2

switchport access vlan 57

switchport mode access

spanning-tree portfast

interface FastEthernet0/3

switchport access vlan 57

switchport mode access

spanning-tree portfast

interface FastEthernet0/4

switchport access vlan 57

switchport mode access

spanning-tree portfast

interface FastEthernet0/5

switchport access vlan 57

switchport mode access

spanning-tree portfast

interface FastEthernet0/6

switchport access vlan 57

switchport mode access

spanning-tree portfast

interface FastEthernet0/7

switchport access vlan 57

switchport mode access

spanning-tree portfast

interface FastEthernet0/8

switchport access vlan 57

switchport mode access

spanning-tree portfast

interface FastEthernet0/9

switchport access vlan 57

switchport mode access

spanning-tree portfast

interface FastEthernet0/10

switchport access vlan 57

switchport mode access

spanning-tree portfast

interface FastEthernet0/11

switchport access vlan 57

switchport mode access

spanning-tree portfast

interface FastEthernet0/12

switchport access vlan 57

switchport mode access

spanning-tree portfast

interface FastEthernet0/13

switchport access vlan 192

switchport mode access

spanning-tree portfast

interface FastEthernet0/14

switchport access vlan 192

switchport mode access

spanning-tree portfast

interface FastEthernet0/15

switchport access vlan 192

switchport mode access

spanning-tree portfast

interface FastEthernet0/16

switchport access vlan 192

switchport mode access

spanning-tree portfast

interface FastEthernet0/17

switchport access vlan 192

switchport mode access

spanning-tree portfast

interface FastEthernet0/18

switchport access vlan 192

switchport mode access

spanning-tree portfast

interface FastEthernet0/19

switchport access vlan 192

switchport mode access

spanning-tree portfast

interface FastEthernet0/20

switchport access vlan 192

switchport mode access

spanning-tree portfast

interface FastEthernet0/21

switchport access vlan 192

switchport mode access

spanning-tree portfast

interface FastEthernet0/22

switchport access vlan 192

switchport mode access

spanning-tree portfast

interface FastEthernet0/23

switchport access vlan 192

switchport mode access

spanning-tree portfast

interface FastEthernet0/24

switchport access vlan 192

switchport mode access

spanning-tree portfast

interface GigabitEthernet0/1

interface GigabitEthernet0/2

interface Vlan1

no ip address

no ip route-cache

interface Vlan57

ip address 10.63.57.10 255.255.255.0

no ip route-cache

ip http server

control-plane

line con 0

line vty 0 4

password catv2006

login

line vty 5 15

password catv2006

login

end

 

Trunk实验配置详解http://dwz.cn/yAqZJ

你可能感兴趣的:(Trunk实验配置详解)