举案齐眉的造句:子接口

来源:百度文库 编辑:偶看新闻 时间:2024/04/29 03:58:12
1.1 子接口概述
子接口是以太网端口的一种逻辑表现形式,一个以太网端口称为父端口,一个父端口可以配置多个子接口,子接口之间互相独立。
1.2 配置子接口
一个父接口下可以存在多个子接口,子接口只支持三层转发,不支持二层转发,同一个父接口下的不同子接口按照802.1q值进行区分。
1.2.1 缺省配置信息
关于子接口的缺省设置信息如以下表格所示:
子接口缺省配置信息
内   容
缺省设置
备注
(端口管理状态)administrator status
up
可更改
1.2.2 子接口基本配置命令
子接口基本配置命令
命令
解释
interface ethernet
创建一个子接口,进入子接口配置模式
no interface ethernet
删除一个子接口,在全局配置模式下使用
encapsulation dot1q <2-4094>
配置802.1Q封装
no encapsulation dot1q
取消802.1Q封装
show interface subinterface {}*1
显示所有(指定)的子接口的信息
1.2.3 创建子接口
创建子接口,并配置IP地址。
配置步骤
步骤1
interface ethernet
从全局配置模式创建一个子接口,并进入子接口配置模式
步骤2
encapsulation dot1q <2-4094>
在子接口上封装802.1Q tag值
步骤3
ip address {[secondary]}*1
为子接口配置IP地址和子网掩码
步骤4
show
在VLAN配置模式下查看当前配置情况
步骤5
exit
退出到全局配置模式下
在子接口配置模式下,使用no encapsulation dot1q可以取消802.1Q的tag值封装
在子接口配置模式下,使用no shutdown可以恢复接口管理状态为默认的admin up状态。
表1-1
1、ESR交换机的子接口的封装的tag值一定和对端的tag值相同(通常是对端的VlanID值),否则,子接口收到报文后,会将其丢掉。
2、配置子接口时,先封装802.1Q的tag值,再配置IP地址。
7.3 配置案例
7.3.1 配置子接口,tag值为100
案例描述
两台交换机互连,一台交换机上有两个VLAN,vlan1和vlan2,其VlanID分别为100、200,端口1/1、1/2以tagged方式加入到vlan1,端口1/2、1/3、1/4以tagged方式加入到vlan2。另一台交换机上的以太网端口1/1配有两个子接口,子接口的tag值分别为100、200,分别对应vlan1和vlan2。

配置子接口
在交换机2上配置vlan1和vlan2配置步骤
步骤1
创建一个VLAN,名称为vlan1,vlanId为100
Harbour(config)# interface vlan vlan1 100
步骤2
将端口1/1,1/2以tagged的方式加入到v1中
Harbour(config-vlan- vlan1)# add port 1/1,1/2 tagged
步骤3
为该VLAN配置IP地址
Harbour(config-vlan- vlan1)#ip address 1.1.1.1 255.255.255.0
步骤4
退出VLAN配置节点,进入到全局配置模式
Harbour(config-vlan- vlan1)#exit
步骤5
创建一个VLAN,名称为vlan2,vlanId为200
Harbour(config)# interface vlan vlan2 200
步骤6
将端口1/2,1/3,1/4以tagged的方式加入到v2中
Harbour(config-vlan-vlan2)# add port 1/2, 1/3, 1/4 tagged
步骤7
为该VLAN配置IP地址
Harbour(config-vlan-vlan2)#ip address 2.1.1.1 255.255.255.0
步骤8
显示VLAN配置的信息
Harbour(config-vlan-vlan2)#show
步骤9
退出VLAN配置节点,进入到全局配置模式
Harbour(config-vlan-vlan2)#exit
在交换机1上配置子接口步骤
步骤1
创建一个子接口
Harbour(config)# interface ethernet 1/1.100
步骤2
封装802.1Q值
Harbour(config-subinterface-eth1/1.100)# encapsulation dot1q 100
步骤3
为该子接口配置IP地址
Harbour(config-subinterface-eth1/1.100)#ip address 1.1.1.2 255.255.255.0
步骤4
显示子接口配置的信息
Harbour(config-subinterface-eth1/1.100)#show
Interface Subinterface eth1/1.100 is down.
Physical status is down, administrator status is up.
MTU 1500 bytes.
IP address:
1.1.1.2/24
Hardware is Subinterface, Address is 0005.3b81.12a0.
Speed 1000 M, Bandwidth 1000000 Kbit.
Encapsulation DIX-802.1Q Tag 100.
Layer2's forward disabled, Layer3's forward enabled.
Metric 0.
步骤5
退出子接口配置节点,进入到全局配置模式
Harbour(config-subinterface-eth1/1.100)#exit
步骤6
创建另一个子接口
Harbour(config)# interface ethernet 1/1.200
步骤7
封装802.1Q值
Harbour(config-subinterface-eth1/1.200)# encapsulation dot1q 200
步骤8
为该子接口配置IP地址
Harbour(config-subinterface-eth1/1.200)#ip address 2.1.1.2 255.255.255.0
步骤9
显示子接口配置的信息
Harbour(config-subinterface-eth1/1.200)#show
Interface Subinterface eth1/1.200 is down.
Physical status is down, administrator status is up.
MTU 1500 bytes.
IP address:
2.1.1.2/24
Hardware is Subinterface, Address is 0005.3b81.12a0.
Speed 1000 M, Bandwidth 1000000 Kbit.
Encapsulation DIX-802.1Q Tag 200.
Layer2's forward disabled, Layer3's forward enabled.
Metric 0.
步骤10
退出子接口配置节点,进入到全局配置模式
Harbour(config-subinterface-eth1/1.200)#exit
7.4 常见故障分析
7.4.1 配置子接口后,通信失败
现象
在配置子接口后,从子接口ping另外一端的VLAN,发现ping不通
分析与解决
配子接口时,封装的tag值一定要与对端的VlanId相等,这样才能正常通信,不然,子接口会把报文丢弃