码迷,mamicode.com
首页 > 其他好文 > 详细

路由交换学习第七天:交换机之间trunk_PC和路由器通信

时间:2019-08-05 20:20:14      阅读:118      评论:0      收藏:0      [点我收藏+]

标签:mic   ==   batch   res   技术   play   image   状态   七天   

技术图片

R1配置:
[HW-R1]interface GigabitEthernet 0/0/1 //配置1口
[HW-R1-GigabitEthernet0/0/1]ip address 10.10.10.1 24 //配置1口IP

SW1:
[HW-SW1]vlan batch 8 to 12 99 //SW1批量创建VLAN8到12和99
[HW-SW1]int g0/0/1 //配置g0/0/1接口
[HW-SW1-GigabitEthernet0/0/1]port link-type access //G0/0/1端口模式是access
[HW-SW1-GigabitEthernet0/0/1]port default vlan 8 //G0/0/1端口加入到VLAN8
[HW-SW1-GigabitEthernet0/0/1]int g 0/0/3 //配置g0/0/3接口
[HW-SW1-GigabitEthernet0/0/3]port link-type trunk //G0/0/3端口模式是trunk
[HW-SW1-GigabitEthernet0/0/3]port trunk allow-pass vlan all //G0/0/3允许所有VLAN通过
[HW-SW1-GigabitEthernet0/0/3]display port vlan active //查看端口的VLAN状态
T=TAG U=UNTAG

Port Link Type PVID VLAN List

GE0/0/1 access 8 U: 8
GE0/0/2 hybrid 1 U: 1
GE0/0/3 trunk 99 U: 99
T: 1 8 to 12

======================================================

SW3:
[HW-SW3]vlan batch 8 to 12 99 //SW3批量创建VLAN8到12和99
[HW-SW3]interface g 0/0/3 //配置G0/0/3接口
[HW-SW3-GigabitEthernet0/0/3]port link-type trunk //配置G0/0/3接口为trunk
[HW-SW3-GigabitEthernet0/0/3]port trunk allow-pass vlan all //G0/0/3允许所有VLAN通过
[HW-SW3]int g0/0/10 //配置G0/0/10口
[HW-SW3-GigabitEthernet0/0/10]port link-type access //配置当前端口为access
[HW-SW3-GigabitEthernet0/0/10]port default vlan 8 //配置当前端口VLAN号为8
[HW-SW3-GigabitEthernet0/0/10]int g0/0/11 //配置G0/0/11口
[HW-SW3-GigabitEthernet0/0/11] port link-type access //配置当前端口为access
[HW-SW3-GigabitEthernet0/0/11] port default vlan 8 //配置当前端口VLAN号为8

[HW-SW3]dis port v a //查看端口的VLAN状态
T=TAG U=UNTAG
----------------------------------------------------------
Port Link Type PVID VLAN List
--------------------------------------------------------------
GE0/0/1 hybrid 1 U: 1
GE0/0/2 hybrid 1 U: 1
GE0/0/3 trunk 99 U: 99
T: 1 8 to 12
GE0/0/4 hybrid 1 U: 1
GE0/0/5 hybrid 1 U: 1
GE0/0/6 hybrid 1 U: 1
GE0/0/7 hybrid 1 U: 1
GE0/0/8 hybrid 1 U: 1
GE0/0/9 hybrid 1 U: 1
GE0/0/10 access 8 U: 8
GE0/0/11 access 8 U: 8
~~

路由交换学习第七天:交换机之间trunk_PC和路由器通信

标签:mic   ==   batch   res   技术   play   image   状态   七天   

原文地址:https://blog.51cto.com/63736/2426834

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!