一、hybrid
华为路由器特有的接口
hybrid接口时多功能的,具备access和trunk接口功能
数据出口时:先查untag表,有标时,托标;无标时,查tag表,有则放行,无则丢弃
数据入口时:先查有无标签,有标时,查tag表,有则放行,无责丢弃。无标时,打上PVID放行
命令
port link-type hybrid 进入hybrid接口模式
port hybrid pvid vlan id 添加vlan id
port hybrid untagged vlan id 打标
port hybrid tagged vlan id 脱标
二、单臂路由
单臂路由–实现不同ⅥAN之间的通信
路由器的物理接口可以分化为多个逻辑子接口,每个子接口对应一个vlan网段的网关
原理:路由器重新封装MAC地址,转换vlan标签
1、配置交换机的链路类型,连接路由器的接口为 trunk,连接主机的为 access
2、配置vlan标签的封装结构和子接口地址
配置命令
SW1上配置:
配置access
[SW1]int e0/0/5
[SW1-Ethernet0/0/5]p l a ----这里用的缩写(port link-type access)
配置链路聚合:
[SW1]lacp priority 1000 --------------------配置系统LACP优先级(两边有一边配置即可)
[SW1]int eth-trunk 1 -----------------进入eth-trunk 视图
[SW1-Eth-Trunk1]bpdu enable ----------------配置接口上发送BPDU报文到CPU处理,防止产生环路
[SW1-Eth-Trunk1]mode lacp-static ------------eth-trunk为静态LACP模式
[SW1-Eth-Trunk1]q
[SW1]int e0/0/1 ------------在加入eth-trunk前接口模式要是默认模式(hybrid),配置完成后可在eth-trunk模式中改类型
[SW1-Ethernet0/0/1]eth-trunk 1 -----------当前接口加入eth-trunk 1
[SW1-Ethernet0/0/1]int e0/0/2
[SW1-Ethernet0/0/2]eth-trunk 1
[SW1-Ethernet0/0/2]int e0/0/3
[SW1-Ethernet0/0/3]eth-trunk 1
[SW1-Ethernet0/0/3]int e0/0/4
[SW1-Ethernet0/0/4]eth-trunk 1
[SW1-Ethernet0/0/4]q
[SW1]int Eth-Trunk 1
[SW1-Eth-Trunk1]max active-linknumber 3 -------同时处于活动状态的数量,最多8个,例如用四条线路做聚合,配置了这条命令后,三个处于活动状态,另一个处于备用状态。
交换机SW2与SW1配置相同(不用再配优先级了)
批量向eth-trunk增加接口
[SW2]int Eth-Trunk 1
[SW2-Eth-Trunk1]trunkport Ethernet 0/0/1 to 0/0/4
查看eth-trunk 1信息
[SW1]dis eth-trunk 1
补充:如果链路接口之前是其他类型如何改成hybrid
在undo port trunk allow-pass vlan all之后要将端口加入vlan1,不然会报错
错误提示如下:
不打undo port trunk allow-pass vlan all提示
在undo port trunk allow-pass vlan all没有将端口加入vlan1,报错