1、思科 Vlan 配置实例实验配置:SW-2L1、创建 VLAN,并将相应端口加入 VLANSW-2L#vlan databaseSW-2L(vlan)#vlan 10SW-2L(vlan)#vlan 20SW-2L(vlan)#vlan 30SW-2L(config)#interface f0/1SW-2L(config-if)#switch access vlan 10SW-2L(config)#interface f0/2SW-2L(config-if)#switch access vlan 20SW-2L(config)#interface f0/3SW-2L(config-if)#sw
2、itch access vlan 302、创建 TRUNKSW-2L(config)#interface f0/24SW-2L(config-if)switch mode trunkSW-3L1、创建 VLANSW-3L#vlan databaseSW-3L(vlan)#vlan 10SW-3L(vlan)#vlan 20SW-3L(vlan)#vlan30用 show vlan-switch 查看2、创建 TRUNKSW-3L(config)#interface f0/24SW-3L(config-if)#switch mode trunk3、开启三层交换路由功能SW-3L(conifg)#
3、ip routing4、配置 VLAN 的 IPSW-3L(config)#interface vlan 10SW-3L(config-if)#ip address 192.168.10.254 255.255.255.0SW-3L(config-if)#no shutdownSW-3L(config)#interface vlan 20SW-3L(config-if)#ip address 192.168.20.254 255.255.255.0SW-3L(config-if)#no shutdownSW-3L(conifg)#interface vlan30SW-3L(config-if)
4、#ip address 192.168.30.254 255.255.255.0SW-3L(config-if)#no shutdown5、配置三层交换路由接口SW-3L(config)#interface f0/23SW-3L(config-if)#no switchportSW-3L(config-if)#ip address 10.1.1.1 255.255.255.0SW-3L(config-if)#no shutdown6、配置 RIP 路由SW-3L(config)#router ripSW-3L(config-router)#no auto-summarySW-3L(config
5、-router)#network 192.168.10.0 SW-3L(config-router)#network 192.168.20.0SW-3L(config-router)#network 192.168.30.0SW-3L(conifg-router)#network 10.1.1.0RA1、配置端口 IPRA(config)#interface f0/0RA(config-if)#ip address 10.1.1.2 255.255.255.0RA(config-if)#no shutdownRA(config)#interface f0/1RA(config-if)#ip a
6、ddress 172.16.1.1 255.255.255.0RA(config-if)#no shutdown用 show run interfere vlan vlan-id 查看,或者 show interfere vlan vlan-id 查看2、配置 RIP 路由RA(config)#router ripRA(config-router)#no auto-summaryRA(config-router)#network 10.1.1.0 RA(config-router)#network 172.16.1.0 RB1、配置端口 IPRB(config)#interface f0/0RB(config-if)#ip address 172.16.1.2 255.255.255.0RB(config-if)#no shutdown2、配置 RIP 路由RB(config)#router ripRB(config-router)#no auto-summaryRB(config-router)#network 172.16.1.0 端口里面配 VLAN,VLAN 里面配 IP