通信人家园

 找回密码
 注册

只需一步,快速开始

短信验证,便捷登录

搜索

军衔等级:

  新兵

注册:2020-8-4
跳转到指定楼层
1#
发表于 2026-7-27 11:20:25 |只看该作者 |倒序浏览
交换机的配置:
SW2950#configure t
SW2950(config)#vlan 2
SW2950(config)#vlan 3
SW2950(config)#int fastEthernet 0/1
SW2950(config-if)#switchport mode trunk
SW2950(config-if)#no shutdown
SW2950(config)#int fastEthernet 0/2
SW2950(config-if)#switchport mode access
SW2950(config-if)#switchport access vlan 2
SW2950(config-if)#int fas0/3
SW2950(config-if)#switchport mode access
SW2950(config-if)#switchport access vlan 3
SW2950(config-if)#end
SW2950#sho vlan
VLAN Name                             Status    Ports
------------------------------------ --------- -------------------------------
1    default                          active    Fa0/1, 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
2    VLAN0002                         active    Fa0/2
3    VLAN0003                         active    Fa0/3
         
SW2950#
SW2950#show interfaces fastEthernet 0/1 switchport
Name: Fa0/1
Switchport: Enabled
Administrative Mode: trunk
Operational Mode: up
Administrative Trunking Encapsulation: isl
Negotiation of Trunking: On
Access Mode VLAN: 1 (default)
Trunking Native Mode VLAN: 1 (default)
Voice VLAN: none
Administrative private-vlanhost-association: none
Administrative private-vlan mapping: none
Administrative private-vlan trunk nativeVLAN: none
Administrative private-vlan trunkencapsulation: isl
Administrative private-vlan trunk normalVLANs: none
Administrative private-vlan trunk privateVLANs: none
Operational private-vlan: none
Trunking VLANs Enabled: ALL
Pruning VLANs Enabled: 2-1001
Capture Mode Disabled
Capture VLANs Allowed: ALL
Protected: false
Appliance trust: none
SW2950#
路由器的配置:
interface fastethernet 0/0
no ip address
no shutdown
interface ethernet 0/0.2
ip address 10.1.1.1 255.255.255.0  //VLAN2
的网关
encapsulation
isl 2
interface ethernet 0/0.3
ip address 10.2.2.1 255.255.255.0  //vlan3
的网关
encapsulation
isl 3
交换机的配置:
SW2950#configure t
SW2950(config)#vlan 2
SW2950(config)#vlan 3
SW2950(config)#int fastEthernet 0/1
SW2950(config-if)#switchport mode trunk
SW2950(config-if)#no shutdown
SW2950(config)#int fastEthernet 0/2
SW2950(config-if)#switchport mode access
SW2950(config-if)#switchport access vlan 2
SW2950(config-if)#int fas0/3
SW2950(config-if)#switchport mode access
SW2950(config-if)#switchport access vlan 3
SW2950(config-if)#end
SW2950#sho vlan
VLAN Name                             Status    Ports
---- ----------------------------------------- -------------------------------
1   default                         active    Fa0/1, 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
2    VLAN0002                         active    Fa0/2
3    VLAN0003                         active    Fa0/3
         
SW2950#
SW2950#show interfaces fastEthernet 0/1 switchport
Name: Fa0/1
Switchport: Enabled
Administrative Mode: trunk
Operational Mode: up
Administrative Trunking Encapsulation: dot1q
Negotiation of Trunking: On
Access Mode VLAN: 1 (default)
Trunking Native Mode VLAN: 1 (default)
Voice VLAN: none
Administrative private-vlanhost-association: none
Administrative private-vlan mapping: none
Administrative private-vlan trunk nativeVLAN: none
Administrative private-vlan trunkencapsulation: dot1q
Administrative private-vlan trunk normalVLANs: none
Administrative private-vlan trunk privateVLANs: none
Operational private-vlan: none
Trunking VLANs Enabled: ALL
Pruning VLANs Enabled: 2-1001
Capture Mode Disabled
Capture VLANs Allowed: ALL
Protected: false
Appliance trust: none
SW2950#
路由器的配置:
interface fastethernet 0/0
no ip address
no shutdown
interface ethernet 0/0.2
ip address 10.1.1.1 255.255.255.0  //VLAN2
的网关
encapsulation
dot1q  2
interface ethernet 0/0.3
ip address 10.2.2.1 255.255.255.0  //vlan3
的网关
encapsulation
dot1q 3

举报本楼

本帖有 3 个回帖,您需要登录后才能浏览 登录 | 注册
您需要登录后才可以回帖 登录 | 注册 |

版规|手机版|C114 ( 沪ICP备12002291号-1 )|联系我们 |网站地图  

GMT+8, 2026-8-1 04:34 , Processed in 0.242854 second(s), 16 queries , Gzip On.

Copyright © 1999-2025 C114 All Rights Reserved

Discuz Licensed

回顶部